@datadayrepos/js-utils
v0.0.1-beta.19
Published
General utils for object and array manipulations in javascript
Downloads
2
Readme
ts-template
General utils for object and array manipulations in javascript
🛠 Usage
pnpm i @datadayrepos/js-utils
💻 Code
Several helpers across the main js types:
// any methods
import { getTypeOf } from '@datadayrepos/js-utils'
// array methods
import {
cutOff,
dedupe,
ensure,
fillArr,
insert,
intersection,
isFirst,
isLast,
merge,
moveDown,
moveDownAt,
moveUp,
moveUpAt,
remove,
removeAt,
toMap,
union,
} from '@datadayrepos/js-utils'
// array-objects methods
import {
filterArrayOfObjectsSingleKey,
filterArrayOfObjectsTwoKeys,
} from '@datadayrepos/js-utils'
// copy methods
import { copy, copyStrict, createCopier, createStrictCopier } from '@datadayrepos/js-utils'
// json (schema) object methods
import {
getPathVal,
setPathVal,
deleteRootPathVal, // todo difference?
deleteRootArrVal,
nodePath2ClassName,
isRootNodePath,
computedCurPath,
path2prop,
} from '@datadayrepos/js-utils'
// json pointer "/" notation RFC 6901
import {
jsonPointer, // class style
getJsonPointer,
setJsonPointer,
removeJsonPointer,
joinJsonPointer,
splitJsonPointer,
splitLastJsonPointer,
isRootJsonPointer,
removeUndefinedItemsJsonPointer,
} from '@datadayrepos/js-utils'
// number methods
import {
gcd, // greatest common divisor
lcm, // least common multiple
} from '@datadayrepos/js-utils'
// object methods
import {
isEmptyObject,
isObject,
isObjectSimple,
isArguments,
mergeObjects,
removeMatchingProperties,
deepEquals,
filterObject,
} from '@datadayrepos/js-utils'
// string methods
import {
capitalizeWords,
lowerCase,
pad,
slicestr,
toCamelCase,
toSnakeCase,
} from '@datadayrepos/js-utils'
📄 License
MIT License © 2023 Ivar Strand