obj-walker
Version:
Walk or map over objects in a depth-first preorder or postorder manner.
37 lines (36 loc) • 999 B
TypeScript
import { Node } from './types';
/**
* Is the value a plain object or an array?
*/
export declare const isObjectOrArray: (x: unknown) => x is object | Array<any>;
/**
* Skip if the value is undefined and the node's parent is not array.
*/
export declare const defShouldSkip: (val: any, node: Node) => boolean;
/**
* Is the parent of the node an array?
*/
export declare const parentIsArray: (node: Node) => boolean;
/**
* Is the value a non-empty object or array? If yes, then traverse it.
*/
export declare const defTraverse: (x: any) => false;
export declare const getRoot: (obj: object, jsonCompat?: boolean) => Node;
/**
* Size in bytes
*/
export declare const ECMA_SIZES: {
STRING: number;
BOOLEAN: number;
BYTES: number;
NUMBER: number;
Int8Array: number;
Uint8Array: number;
Uint8ClampedArray: number;
Int16Array: number;
Uint16Array: number;
Int32Array: number;
Uint32Array: number;
Float32Array: number;
Float64Array: number;
};