@enonic/js-utils
Version:
Enonic XP JavaScript Utils
20 lines (18 loc) • 359 B
JavaScript
// array/flatten.ts
function flatten(arr, d = 1) {
return d > 0 ? arr.reduce((acc, val) => acc.concat(
Array.isArray(val) ? flatten(val, d - 1) : val
), []) : arr.slice();
}
// storage/query/dsl/not.ts
function not(...args) {
const flattened = flatten(args);
return {
mustNot: flattened
};
}
var mustNot = not;
export {
mustNot,
not
};