- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
26 lines
670 B
JavaScript
26 lines
670 B
JavaScript
'use strict';
|
|
|
|
var is = require('./is.cjs');
|
|
|
|
function walkObject(target, predicate, options = {}) {
|
|
const { stop, getKey } = options;
|
|
function inner(value, path = []) {
|
|
if (is.isObject(value) || Array.isArray(value)) {
|
|
const result = {};
|
|
for (const [prop, child] of Object.entries(value)) {
|
|
const key = getKey?.(prop) ?? prop;
|
|
const childPath = [...path, key];
|
|
if (stop?.(value, childPath)) {
|
|
return predicate(value, path);
|
|
}
|
|
result[key] = inner(child, childPath);
|
|
}
|
|
return result;
|
|
}
|
|
return predicate(value, path);
|
|
}
|
|
return inner(target);
|
|
}
|
|
|
|
exports.walkObject = walkObject;
|