ts-object-path icon indicating copy to clipboard operation
ts-object-path copied to clipboard

Added "_path" and "_name" properties to ObjPathProxy

Open tran-simon opened this issue 4 years ago • 0 comments

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'

tran-simon avatar Sep 30 '20 21:09 tran-simon