ts-object-path
ts-object-path copied to clipboard
Added "_path" and "_name" properties to ObjPathProxy
This adds the ability to get the path of the ObjPathProxy object without having to use the "getPath" function every time.
Exemple:
interface IExample extends ObjPath {
one: number;
two: string;
nested: IExample;
collection: IExample[];
}
const p = createProxy<IExample>();
console.log(p.one._path); // 'one'
console.log(p.nested.collection[2].one._path); //'nested/collection/2/one'
console.log(p.one._name); // 'one'
console.log(p.nested.collection[2].one._name); //'one'