Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
'use strict';
const recurse = require('./recurse.js').recurse;
function findObj(container,obj) {
if (container === obj) {
return { found: true, path: '#/', parent: null };
}
let result = { found: false, path: null, parent: null };
recurse(container,{},function(o,key,state){
if ((o[key] === obj) && (!result.found)) {
result = { found: true, path: state.path, parent: o };
}
});
return result;
}
module.exports = {
findObj: findObj
};