MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / _isSlimmableObject

Function _isSlimmableObject

apps/client/src/code/pages/slim.ts:4–14  ·  view source on GitHub ↗
(key: any, value: any, defaults: any)

Source from the content-addressed store, hash-verified

2import { isObject } from 'lodash';
3
4function _isSlimmableObject(key: any, value: any, defaults: any): boolean {
5 return (
6 defaults != null &&
7 key in defaults &&
8 key !== 'value' &&
9 key !== 'label' &&
10 key !== 'pos' &&
11 isObject(value) &&
12 !('push' in value)
13 );
14}
15
16export function makeSlim<T extends object>(root: T, defaults: T): T {
17 for (const [key, value] of Object.entries(root)) {

Callers 2

makeSlimFunction · 0.85
wrapSlimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected