Files
starface-outlook-sync-addin/node_modules/@jsonjoy.com/json-pointer/lib/codegen/find.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

16 lines
545 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.$$find = void 0;
const $$find = (path) => {
if (path.length === 0)
return '(function(x){return x})';
let fn = '(function(){var h=Object.prototype.hasOwnProperty;return(function(o){var k,u=void 0;try{';
for (let i = 0; i < path.length; i++) {
fn += 'k=' + JSON.stringify(path[i]) + ';';
fn += 'if(!h.call(o,k))return u;o=o[k];';
}
fn += 'return o}catch(e){return u}})})()';
return fn;
};
exports.$$find = $$find;