Skip to content

Commit

Permalink
showcase of the object proxy working
Browse files Browse the repository at this point in the history
  • Loading branch information
nopeless committed Sep 17, 2021
1 parent 776d2bc commit 0e65fc3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions showcase/push.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const handler = require(`../src/index.js`)(`./file.json`, {});
const file = handler.file;

let obj = {
prop:[],
};
file.test = obj;
// obj.prop = [1,2]; // doesn't work
obj.prop.push(42); // works

obj = file.test;
obj.prop = 42; // works
obj.someattr = `hi`; // works

0 comments on commit 0e65fc3

Please sign in to comment.