2.6.2 • Published 1 year ago

@tinkoff/utils v2.6.2

Weekly downloads
403
License
Apache-2.0
Repository
github
Last release
1 year ago

Tinkoff Utils Build status Coverage Status

Fast, small and purely functional utility library

Install

$ npm install @tinkoff/utils

Features

Structure of the library

  • /object – for objects
  • /string – for strings
  • /promise – for promises
  • /array – for arrays or array-like objects
  • /function – for functions – composition, currying and so on, also a set of simple functions (noop, T, F)
  • /is – set of type checking methods
  • / – root contains utilities which don't satisfy any of the above categories or are universal

Usage

import pathOr from '@tinkoff/utils/object/pathOr';
import compose from '@tinkoff/utils/function/compose';
import toLower from '@tinkoff/utils/string/toLower';
import map from '@tinkoff/utils/array/map'

const toLowerName = compose(
    toLower,
    pathOr(['name'], '')
);
const result = map(toLowerName)([{name: 'testA'}, {name: 'testb'}])

Benchmarks

$ npm run benchmark
UtilityLodashRamdaUtils
clone120,807 ops/sec112,053 ops/sec293,572 ops/sec
array/filter2,080,728 ops/sec1,849,633 ops/sec2,046,113 ops/sec
is/empty1,506,963 ops/sec474,177 ops/sec3,731,564 ops/sec
function/flip7,528,745 ops/sec3,735,143 ops/sec3,490,207 ops/sec
object/path12,023,128 ops/sec8,894,639 ops/sec7,587,076 ops/sec
string/trim4,215,928 ops/sec1,034,655 ops/sec6,029,794 ops/sec

Browser support

  • Chrome >= 40
  • Firefox >= 52
  • Edge >= 14
  • IE >= 11
  • Safari >= 10
  • iOS >= 10
  • Android >= 4.4

Node support

  • 6.4.0 and higher

Bundle size

LibraryBundle size
import _ from 'lodash'70.1 kb
import ... from 'lodash/...'21.8 kb
import R from 'ramda'41.3 kb
import ... from 'ramda/src/...'10 kb
import ... from '@tinkoff/utils/...'2.32 kb

For detailed comparison with specific libraries see COMPARE.md

2.6.1

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.6.0

1 year ago

2.5.4

1 year ago

2.6.2

1 year ago

2.5.3

1 year ago

2.5.6

1 year ago

2.5.5

1 year ago

2.5.0

2 years ago

2.4.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

0.6.2

2 years ago

0.4.0

2 years ago

2.3.0

2 years ago

2.2.1

3 years ago

2.2.0

4 years ago

2.1.3

4 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

6 years ago

2.0.0-alpha.6

6 years ago

2.0.0-alpha.5

6 years ago

2.0.0-alpha.4

6 years ago

2.0.0-alpha.3

6 years ago

2.0.0-alpha.2

6 years ago

2.0.0-alpha.1

6 years ago

2.0.0-alpha.0

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago