test fixes

This commit is contained in:
Seth Trowbridge 2025-02-21 07:55:08 -05:00
parent e089203b2f
commit 93484f3900
3 changed files with 31 additions and 9 deletions

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"deno.cacheOnSave": true,
"deno.codeLens.test": true
}

View File

@ -1,18 +1,35 @@
const person = van.state({name:"seth", age:41});
console.log(Object.hasOwn(person, "rawVal"));
//const person = van.state({name:"seth", age:41});
//console.log(Object.hasOwn(person, "rawVal"));
const isLeaf =(obj, key)=>
{
const type = typeof arg;
if(arg == null || type == "")
{
}
}
/** @type {<T>(obj:T, key:string)=>T} */
const Deep =(obj, key)=>
{
const proxInner =(context, key)=> new Proxy({}, {
get(_, prop)
{
if(typeof prop === "string")
{
const path = key+" . "+prop;
console.log(path, "accessed!");
const value = context[key];
const value = context[prop];
return proxInner(value, path);
}
else
{
return context[prop]
}
}
});
const proxOuter = new Proxy({}, {

View File

@ -4,6 +4,7 @@ import Deep from "./proxy.js";
Deno.test("proxy", ()=>{
const d1 = Deep({name:"seth", age:41, tags:[]}, "p1");
const dig = d1.name.other;
const dig2 = dig.so.deep;
const dig = d1.name;
//const dig2 = dig.so.deep;
});