a schema for the property
Gets the value of the property from the object.
an object containing a value and success properties. value is the value of the property
if it was found in the object, success is a boolean value indicating if the property was found in the object.
The name of this property within its parent object, or undefined
for the root descriptor.
When the property was created from a PropertyDescriptorTree leaf the
type narrows to the literal key string (e.g. 'id'), enabling
accessor-function-based column inference in query builders.
Sets a new value to the property. If the process was successful,
the method returns true, otherwise false.
It can return false if the property could not be set to the object
which can happen if the setValue method is called with an object
which does not comply with the schema.
for example, if you have a schema and property descriptopr like this:
const schema = object({
name: string(),
address: object({
city: string(),
country: string()
}),
id: number()
});
const addressCityDescriptor = object.getPropertiesFor(schema).address.city;
And then you try to set a new value to the address.city property on the object
which does not have address property:
const obj = {
name: 'Leo'
};
const success = addressCityDescriptor.setValue(obj, 'Venyov');
// success === false
Object to set the value to
a new value to set to the property
Optionaloptions: PropertySetterOptionsadditional optional parameters to control the process
Returns a JSON Pointer (RFC 6901) string representing this property's path from the root descriptor.
Property names are escaped per RFC 6901 (~ → ~0, / → ~1).
The root descriptor returns an empty string ('').
Gets the schema for the property described by the property descriptor.