assign a value to a target structure
check if a given value is a literal Object or an Array
Convert an object/array description in it's exact representation.
import { from as fromDescription } from '@ezy/object-description'
console.log(fromDescription({
Ctor: Object,
values: [
{ path: ['value'], value: true },
{ path: ['lvl1', 'lvl2', 0, 1, '50'], value: false }
]
}))
// => { value: true, lvl1: { lvl2: [ [ undefined, { '50': false } ] ] } }
an object or array.
Retrieve the value at a given path.
The path to use.
The object to retrieve the nested property from.
The data at path
.
Convert any object/array into a description object with all values values and their associated path.
import { to as toDescription } from '@ezy/object-description'
console.log(toDescription({
value: true,
lvl1: {
lvl2: [
[undefined, { 50: false }]
]
}
}))
// => {
// Ctor: Object,
// values: [
// { path: ['value'], value: true },
// { path: ['lvl1', 'lvl2', 0, 1, '50'], value: false }
// ]
//}
an object or array.
a function to check if the given object or primitive should be considered as a value (Optional)
a description object.
Generated using TypeDoc
assign a structure to a target structure