File manager - Edit - /home/premiey/www/wp-content/plugins/ameliabooking/v3/src/assets/js/common/objectAndArrayManipulation.js
Back
function usePopulateMultiDimensionalObject (needle, haystack, customFunction) { let stack = [] function loop(haystack, stack) { for (let [location, v] of Object.entries(haystack)) { stack.push(location); if (location === needle) { customFunction(v) break; } else if (typeof v === 'object') { loop(v, stack); } } } loop(haystack, stack); } function useOverrideValuesOfOneObjectWithAnother (needle, haystack, target, customFunction) { let stack = [] function loop(stack, haystack, target) { for (let [location, v] of Object.entries(haystack)) { stack.push(location); if (location === needle) { customFunction(haystack, target) break; } else if (typeof v === 'object' && v !== null) { loop(stack, v, target[location]); } } } loop(stack, haystack, target); } export { usePopulateMultiDimensionalObject , useOverrideValuesOfOneObjectWithAnother}
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings