1.0.36 • Published 3 years ago

red-panda-utils v1.0.36

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

red-panda-utils

Simple utilities for work with objects like trees.

Leaf - a primitive value or object with keys count not equal to 1.

Path object - object with a single key, value can be path object or leaf.

Flat presentation of path object - [string[], Leaf].

Exported functions

createPathObject

creates path objects from leaf and path. Throw error in case of empty path.

naiveClone

clones primitives by value - functions by reference, creates new array with clones of items, creates new object with clones of values.

deepMerge

takes two arguments for merge, returns clone of second if arguments cannot be merged. Primitives, functions and arrays cannot be merged.

toFlat

gets path object and returns flat presentation.

pathsSlice

slice object into array of path objects.

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago