@@ -325,7 +325,7 @@ export class NodeApi<N extends JsonNode = JsonNode> implements Printable {
325325 diff . merge ( this , value ) ;
326326 }
327327
328- public proxy ( ) : types . ProxyNode < N > {
328+ public get s ( ) : types . ProxyNode < N > {
329329 return { $ : this } as unknown as types . ProxyNode < N > ;
330330 }
331331
@@ -353,7 +353,7 @@ export class ConApi<N extends ConNode<any> = ConNode<any>> extends NodeApi<N> {
353353 /**
354354 * Returns a proxy object for this node.
355355 */
356- public proxy ( ) : types . ProxyNodeCon < N > {
356+ public get s ( ) : types . ProxyNodeCon < N > {
357357 return { $ : this } as unknown as types . ProxyNodeCon < N > ;
358358 }
359359}
@@ -390,13 +390,13 @@ export class ValApi<N extends ValNode<any> = ValNode<any>> extends NodeApi<N> {
390390 * Returns a proxy object for this node. Allows to access the value of the
391391 * node by accessing the `.val` property.
392392 */
393- public proxy ( ) : types . ProxyNodeVal < N > {
393+ public get s ( ) : types . ProxyNodeVal < N > {
394394 const self = this ;
395395 const proxy = {
396396 $ : this ,
397397 get val ( ) {
398398 const childNode = self . node . node ( ) ;
399- return ( < any > self ) . api . wrap ( childNode ) . proxy ( ) ;
399+ return ( < any > self ) . api . wrap ( childNode ) . s ;
400400 } ,
401401 } ;
402402 return < any > proxy ;
@@ -455,7 +455,7 @@ export class VecApi<N extends VecNode<any> = VecNode<any>> extends NodeApi<N> {
455455 * Returns a proxy object for this node. Allows to access vector elements by
456456 * index.
457457 */
458- public proxy ( ) : types . ProxyNodeVec < N > {
458+ public get s ( ) : types . ProxyNodeVec < N > {
459459 const proxy = new Proxy (
460460 { } ,
461461 {
@@ -466,7 +466,7 @@ export class VecApi<N extends VecNode<any> = VecNode<any>> extends NodeApi<N> {
466466 if ( Number . isNaN ( index ) ) throw new Error ( 'INVALID_INDEX' ) ;
467467 const child = this . node . get ( index ) ;
468468 if ( ! child ) throw new Error ( 'OUT_OF_BOUNDS' ) ;
469- return ( < any > this ) . api . wrap ( child ) . proxy ( ) ;
469+ return ( < any > this ) . api . wrap ( child ) . s ;
470470 } ,
471471 } ,
472472 ) ;
@@ -538,7 +538,7 @@ export class ObjApi<N extends ObjNode<any> = ObjNode<any>> extends NodeApi<N> {
538538 * Returns a proxy object for this node. Allows to access object properties
539539 * by key.
540540 */
541- public proxy ( ) : types . ProxyNodeObj < N > {
541+ public get s ( ) : types . ProxyNodeObj < N > {
542542 const proxy = new Proxy (
543543 { } ,
544544 {
@@ -547,7 +547,7 @@ export class ObjApi<N extends ObjNode<any> = ObjNode<any>> extends NodeApi<N> {
547547 const key = String ( prop ) ;
548548 const child = this . node . get ( key ) ;
549549 if ( ! child ) throw new Error ( 'NO_SUCH_KEY' ) ;
550- return ( < any > this ) . api . wrap ( child ) . proxy ( ) ;
550+ return ( < any > this ) . api . wrap ( child ) . s ;
551551 } ,
552552 } ,
553553 ) ;
@@ -649,7 +649,7 @@ export class StrApi extends NodeApi<StrNode> {
649649 /**
650650 * Returns a proxy object for this node.
651651 */
652- public proxy ( ) : types . ProxyNodeStr {
652+ public get s ( ) : types . ProxyNodeStr {
653653 return { $ : this } ;
654654 }
655655}
@@ -704,7 +704,7 @@ export class BinApi extends NodeApi<BinNode> {
704704 /**
705705 * Returns a proxy object for this node.
706706 */
707- public proxy ( ) : types . ProxyNodeBin {
707+ public get s ( ) : types . ProxyNodeBin {
708708 return { $ : this } ;
709709 }
710710}
@@ -800,7 +800,7 @@ export class ArrApi<N extends ArrNode<any> = ArrNode<any>> extends NodeApi<N> {
800800 *
801801 * @returns Proxy object that allows to access array elements by index.
802802 */
803- public proxy ( ) : types . ProxyNodeArr < N > {
803+ public get s ( ) : types . ProxyNodeArr < N > {
804804 const proxy = new Proxy (
805805 { } ,
806806 {
@@ -810,7 +810,7 @@ export class ArrApi<N extends ArrNode<any> = ArrNode<any>> extends NodeApi<N> {
810810 if ( Number . isNaN ( index ) ) throw new Error ( 'INVALID_INDEX' ) ;
811811 const child = this . node . getNode ( index ) ;
812812 if ( ! child ) throw new Error ( 'OUT_OF_BOUNDS' ) ;
813- return ( this . api . wrap ( child ) as any ) . proxy ( ) ;
813+ return ( this . api . wrap ( child ) as any ) . s ;
814814 } ,
815815 } ,
816816 ) ;
0 commit comments