fix(core): update

This commit is contained in:
2023-07-12 19:40:41 +02:00
parent 61fcd5b992
commit a58c2881b9
21 changed files with 2181 additions and 28432 deletions

View File

@@ -1,4 +1,4 @@
import * as plugins from '../smartobject.plugins';
import * as plugins from '../smartobject.plugins.js';
/**
* runs a function for all properties of an object whose key matches a regex expression
@@ -6,12 +6,16 @@ import * as plugins from '../smartobject.plugins';
* @param wildcardArg the rege expression to match the property keys against
* @param callbackArg the function to run with those properties
*/
export let forEachMinimatch = async (parentObjectArg: any, wildcardArg: string, callbackArg: (matchedArg: string) => void) => {
export let forEachMinimatch = async (
parentObjectArg: any,
wildcardArg: string,
callbackArg: (matchedArg: string) => void
) => {
let propertyNames = Object.getOwnPropertyNames(parentObjectArg);
let propertyNamesMatched = propertyNames.filter(propertyNameArg => {
let propertyNamesMatched = propertyNames.filter((propertyNameArg) => {
return plugins.minimatch(propertyNameArg, wildcardArg);
});
for (let propertyNameArg of propertyNamesMatched) {
await callbackArg(parentObjectArg[propertyNameArg]);
}
};
};