Add support for collection keys in toObject.
This commit is contained in:
@@ -40,7 +40,11 @@ const lines = [
|
||||
` Further comments below. As I will now demonstrate, there is no simple`,
|
||||
` even if embedded`,
|
||||
` way of dealing with this problem.`,
|
||||
``
|
||||
`author`,
|
||||
` name Second Person`,
|
||||
` email second@secondperson.com`,
|
||||
` More text,`,
|
||||
` across two lines.`,
|
||||
]
|
||||
|
||||
// Schema
|
||||
@@ -76,7 +80,10 @@ async function main() {
|
||||
}),
|
||||
'scripts': () => toObject({ '#any': true }),
|
||||
'devDependencies': () => toObject(),
|
||||
'author': () => toObject({ name: true, email: true, '#text': true })
|
||||
'author': {
|
||||
type: 'collection',
|
||||
handle: () => toObject({ name: true, email: true, '#text': true })
|
||||
}
|
||||
})
|
||||
|
||||
console.dir(structure, { depth: null })
|
||||
|
||||
Reference in New Issue
Block a user