Comparing version 0.0.111 to 0.0.112
{ | ||
"name": "webdetta", | ||
"version": "0.0.111", | ||
"version": "0.0.112", | ||
"author": "Fedot Kriutchenko <fodyadev@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -45,5 +45,5 @@ import { parseFn } from './common.js'; | ||
}); | ||
const sharedValue = (handlerId, initial) => { | ||
const stateValue = (handlerId, initial, sync) => { | ||
const initval = [ | ||
`const V = this["#internals"]['#vals'] ??= {};`, | ||
`const V = this["#internals"]["#vals"] ??= {};`, | ||
`const H = ${JSON.stringify(handlerId)};`, | ||
@@ -53,3 +53,3 @@ `if (!(H in V)) V[H] = JSON.parse(${JSON.stringify(initial)});`, | ||
return { | ||
rpcHandler: new Function('...a', [ | ||
rpcHandler: !sync ? null : new Function('...a', [ | ||
...initval, | ||
@@ -64,2 +64,5 @@ `return a.length > 0 ? (V[H] = a[0]) : V[H];` | ||
set: new Function('value', [ | ||
...initval, | ||
`V[H] = value;`, | ||
!sync ? '' : | ||
`this["#internals"].cast(${JSON.stringify(handlerId)}, value);` | ||
@@ -95,6 +98,3 @@ ].join('')), | ||
Client: SdkEntry((initial) => ({ | ||
client: (handlerId) => ({ | ||
rpcHandler: null, | ||
instanceProperty: { writable: false, value: initial } | ||
}), | ||
client: stateValue(handlerId, initial, false), | ||
server: null | ||
@@ -104,13 +104,7 @@ })), | ||
client: null, | ||
server: (handlerId) => ({ | ||
rpcHandler: null, | ||
instanceProperty: { | ||
writable: false, | ||
value: tructuredClone(initial) | ||
} | ||
}) | ||
server: stateValue(handlerId, initial, false) | ||
})), | ||
Sync: SdkEntry((initial) => ({ | ||
client: (handlerId) => sharedValue(handlerId, initial), | ||
server: (handlerId) => sharedValue(handlerId, initial) | ||
client: (handlerId) => stateValue(handlerId, initial, true), | ||
server: (handlerId) => stateValue(handlerId, initial, true) | ||
})) | ||
@@ -117,0 +111,0 @@ }; |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
106379
3129