@datadayrepos/js-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.19 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @datadayrepos/js-utils

Weekly Downloads

1

Version

0.0.1-beta.19

License

MIT

Unpacked Size

47.4 kB

Total Files

45

Last publish

Collaborators

  • ivstrand