astro-ghostcms/.pnpm-store/v3/files/b8/7a4fe469ce9ed4b834e5488cac2...

11 lines
299 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
import { objectKeys } from '../typings/common-types.js';
export function objFilter(original = {}, filter = () => true) {
const obj = {};
objectKeys(original).forEach(key => {
if (filter(key, original[key])) {
obj[key] = original[key];
}
});
return obj;
}