MCPcopy
hub / github.com/imbrn/v8n / proxyContext

Function proxyContext

src/v8n.js:21–41  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

19};
20
21function proxyContext(context) {
22 return new Proxy(context, {
23 get(obj, prop) {
24 if (prop in obj) {
25 return obj[prop];
26 }
27
28 const newContext = proxyContext(context._clone());
29
30 if (prop in availableModifiers) {
31 return newContext._applyModifier(availableModifiers[prop], prop);
32 }
33 if (prop in customRules) {
34 return newContext._applyRule(customRules[prop], prop);
35 }
36 if (prop in availableRules) {
37 return newContext._applyRule(availableRules[prop], prop);
38 }
39 },
40 });
41}
42
43function proxylessContext(context) {
44 const addRuleSet = (ruleSet, targetContext) => {

Callers 2

v8nFunction · 0.85
getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected