Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/arrays

Package Overview
Dependencies
Maintainers
1
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/arrays - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

3

binary-search.js

@@ -1,2 +0,3 @@

import { compare, compareNumAsc } from "@thi.ng/compare";
import { compare } from "@thi.ng/compare/compare";
import { compareNumAsc } from "@thi.ng/compare/numeric";
/**

@@ -3,0 +4,0 @@ * Returns the supposed index of `x` in pre-sorted array-like collection

@@ -6,104 +6,103 @@ # Change Log

## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@1.0.2...@thi.ng/arrays@1.0.3) (2021-09-03)
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@1.0.3...@thi.ng/arrays@2.0.0) (2021-10-12)
**Note:** Version bump only for package @thi.ng/arrays
### Build System
* major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
### BREAKING CHANGES
# [0.10.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.9.2...@thi.ng/arrays@0.10.0) (2021-01-21)
* discontinue CommonJS & UMD versions
- only ESM modules will be published from now on
- CJS obsolete due to ESM support in recent versions of node:
- i.e. launch NodeJS via:
- `node --experimental-specifier-resolution=node --experimental-repl-await`
- in the node REPL use `await import(...)` instead of `require()`
- UMD obsolete due to widespread browser support for ESM
### Bug Fixes
Also:
- normalize/restructure/reorg all package.json files
- cleanup all build scripts, remove obsolete
- switch from mocha to @thi.ng/testament for all tests
* **arrays:** fixed-length binarySearch2/4/8/16/32 ([39e5c37](https://github.com/thi-ng/umbrella/commit/39e5c3736135f9a49daceee1fe4da9fbdbb96eab))
### Features
* **arrays:** add insert/insertUnsafe() ([2a78598](https://github.com/thi-ng/umbrella/commit/2a7859823d2fb56eef4ee7a6919fe70072475f42))
## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@1.0.2...@thi.ng/arrays@1.0.3) (2021-09-03)
**Note:** Version bump only for package @thi.ng/arrays
# [0.10.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.9.2...@thi.ng/arrays@0.10.0) (2021-01-21)
# [0.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.5...@thi.ng/arrays@0.9.0) (2021-01-02)
### Bug Fixes
- **arrays:** fixed-length binarySearch2/4/8/16/32 ([39e5c37](https://github.com/thi-ng/umbrella/commit/39e5c3736135f9a49daceee1fe4da9fbdbb96eab))
### Features
### Features
* **arrays:** add bisect(), bisectWith() ([17d06a4](https://github.com/thi-ng/umbrella/commit/17d06a43e338aca5f2dc61110382363639daecc5))
* **arrays:** add into(), sortByCachedKey() ([b94f64c](https://github.com/thi-ng/umbrella/commit/b94f64c2c351cfed5ea9ade5e42ad0b7076ef9e9))
* **arrays:** update sortByCachedKey(), add tests ([64e8f6e](https://github.com/thi-ng/umbrella/commit/64e8f6e4e83c26c73e23a4831483bd328b78bc49))
- **arrays:** add insert/insertUnsafe() ([2a78598](https://github.com/thi-ng/umbrella/commit/2a7859823d2fb56eef4ee7a6919fe70072475f42))
# [0.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.5...@thi.ng/arrays@0.9.0) (2021-01-02)
### Features
- **arrays:** add bisect(), bisectWith() ([17d06a4](https://github.com/thi-ng/umbrella/commit/17d06a43e338aca5f2dc61110382363639daecc5))
- **arrays:** add into(), sortByCachedKey() ([b94f64c](https://github.com/thi-ng/umbrella/commit/b94f64c2c351cfed5ea9ade5e42ad0b7076ef9e9))
- **arrays:** update sortByCachedKey(), add tests ([64e8f6e](https://github.com/thi-ng/umbrella/commit/64e8f6e4e83c26c73e23a4831483bd328b78bc49))
# [0.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.7.0...@thi.ng/arrays@0.8.0) (2020-09-13)
# [0.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.7.0...@thi.ng/arrays@0.8.0) (2020-09-13)
### Features
- **arrays:** add first() ([3f5f722](https://github.com/thi-ng/umbrella/commit/3f5f7226e5c0495086c973a33e91fc2666f4c68c))
### Features
# [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.6.15...@thi.ng/arrays@0.7.0) (2020-08-28)
* **arrays:** add first() ([3f5f722](https://github.com/thi-ng/umbrella/commit/3f5f7226e5c0495086c973a33e91fc2666f4c68c))
### Features
- **arrays:** add non-recursive binary search fns ([29a4ee4](https://github.com/thi-ng/umbrella/commit/29a4ee4d888ccb049df9b50a57e3884ce2d4d0f3))
# [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.5.6...@thi.ng/arrays@0.6.0) (2020-03-28)
### Features
- **arrays:** add fillRange() & levenshtein() ([2f98225](https://github.com/thi-ng/umbrella/commit/2f98225d129c7c1ae6b88a4f0bea9227254fcf91))
# [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.6.15...@thi.ng/arrays@0.7.0) (2020-08-28)
# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.4.0...@thi.ng/arrays@0.5.0) (2020-01-24)
### Features
### Features
- **arrays:** add binary search predicates, tests, update readme ([b8f421e](https://github.com/thi-ng/umbrella/commit/b8f421eb8888fa1b57a9287f6841cd29952bf19f))
* **arrays:** add non-recursive binary search fns ([29a4ee4](https://github.com/thi-ng/umbrella/commit/29a4ee4d888ccb049df9b50a57e3884ce2d4d0f3))
# [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.3.0...@thi.ng/arrays@0.4.0) (2019-11-30)
### Features
- **arrays:** add arraySeq(), arrayIterator() & tests ([d94df57](https://github.com/thi-ng/umbrella/commit/d94df5786dddf6ef6915af79c3fbf0331ddfd2bd))
- **arrays:** add binarySearchNumeric() ([7b38202](https://github.com/thi-ng/umbrella/commit/7b38202480db71753d24aa52a9c09d3ac78d36ae))
# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.2.5...@thi.ng/arrays@0.3.0) (2019-11-09)
### Features
# [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.5.6...@thi.ng/arrays@0.6.0) (2020-03-28)
- **arrays:** add isSorted() ([65b29f4](https://github.com/thi-ng/umbrella/commit/65b29f487459c535acdbed3890c8a4e27d87ae2c))
- **arrays:** add shuffleRange(), refactor shuffle(), add tests ([1924a05](https://github.com/thi-ng/umbrella/commit/1924a05ea093e3d1d0b3f063cb331b330cee0c0a))
- **arrays:** add types, quickSort(), swap(), multiSwap(), update readme ([b834722](https://github.com/thi-ng/umbrella/commit/b83472237b3ba262dcbb644c8ccc516d0021bc84))
# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.1.9...@thi.ng/arrays@0.2.0) (2019-07-07)
### Features
### Features
* **arrays:** add fillRange() & levenshtein() ([2f98225](https://github.com/thi-ng/umbrella/commit/2f98225d129c7c1ae6b88a4f0bea9227254fcf91))
- **arrays:** enable TS strict compiler flags (refactor) ([8724f9e](https://github.com/thi-ng/umbrella/commit/8724f9e))
# 0.1.0 (2019-02-15)
### Features
# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.4.0...@thi.ng/arrays@0.5.0) (2020-01-24)
### Features
* **arrays:** add binary search predicates, tests, update readme ([b8f421e](https://github.com/thi-ng/umbrella/commit/b8f421eb8888fa1b57a9287f6841cd29952bf19f))
# [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.3.0...@thi.ng/arrays@0.4.0) (2019-11-30)
### Features
* **arrays:** add arraySeq(), arrayIterator() & tests ([d94df57](https://github.com/thi-ng/umbrella/commit/d94df5786dddf6ef6915af79c3fbf0331ddfd2bd))
* **arrays:** add binarySearchNumeric() ([7b38202](https://github.com/thi-ng/umbrella/commit/7b38202480db71753d24aa52a9c09d3ac78d36ae))
# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.2.5...@thi.ng/arrays@0.3.0) (2019-11-09)
### Features
* **arrays:** add isSorted() ([65b29f4](https://github.com/thi-ng/umbrella/commit/65b29f487459c535acdbed3890c8a4e27d87ae2c))
* **arrays:** add shuffleRange(), refactor shuffle(), add tests ([1924a05](https://github.com/thi-ng/umbrella/commit/1924a05ea093e3d1d0b3f063cb331b330cee0c0a))
* **arrays:** add types, quickSort(), swap(), multiSwap(), update readme ([b834722](https://github.com/thi-ng/umbrella/commit/b83472237b3ba262dcbb644c8ccc516d0021bc84))
# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.1.9...@thi.ng/arrays@0.2.0) (2019-07-07)
### Features
* **arrays:** enable TS strict compiler flags (refactor) ([8724f9e](https://github.com/thi-ng/umbrella/commit/8724f9e))
# 0.1.0 (2019-02-15)
### Features
* **arrays:** add find/findIndex() ([0007152](https://github.com/thi-ng/umbrella/commit/0007152))
* **arrays:** extract as new package ([361ba37](https://github.com/thi-ng/umbrella/commit/361ba37))
- **arrays:** add find/findIndex() ([0007152](https://github.com/thi-ng/umbrella/commit/0007152))
- **arrays:** extract as new package ([361ba37](https://github.com/thi-ng/umbrella/commit/361ba37))

@@ -1,2 +0,3 @@

import { isArray, isArrayLike } from "@thi.ng/checks";
import { isArray } from "@thi.ng/checks/is-array";
import { isArrayLike } from "@thi.ng/checks/is-arraylike";
import { ensureIterable } from "./ensure-iterable";

@@ -3,0 +4,0 @@ /**

@@ -1,2 +0,2 @@

import { illegalArgs } from "@thi.ng/errors";
import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
/**

@@ -3,0 +3,0 @@ * Attempts to obtain an iterator from `x` and throws error if `x` is

@@ -1,2 +0,2 @@

import { compare } from "@thi.ng/compare";
import { compare } from "@thi.ng/compare/compare";
/**

@@ -3,0 +3,0 @@ * Returns true if the given array and its elements in the selected

{
"name": "@thi.ng/arrays",
"version": "1.0.3",
"version": "2.0.0",
"description": "Array / Arraylike utilities",
"type": "module",
"module": "./index.js",
"main": "./lib/index.js",
"umd:main": "./lib/index.umd.js",
"typings": "./index.d.ts",
"sideEffects": false,
"repository": {

@@ -27,28 +27,22 @@ "type": "git",

"scripts": {
"build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
"build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
"build:es6": "tsc --declaration",
"build:test": "rimraf build && tsc -p test/tsconfig.json",
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
"clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc": "typedoc --excludePrivate --out doc --theme ../../tools/doc/typedoc-theme src/index.ts",
"build": "yarn clean && tsc --declaration",
"clean": "rimraf *.js *.d.ts *.map doc",
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
"pub": "yarn build:release && yarn publish --access public"
"doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
"doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
"pub": "yarn build && yarn publish --access public",
"test": "testament test"
},
"dependencies": {
"@thi.ng/api": "^7.2.0",
"@thi.ng/checks": "^2.9.11",
"@thi.ng/compare": "^1.3.34",
"@thi.ng/equiv": "^1.0.45",
"@thi.ng/errors": "^1.3.4",
"@thi.ng/random": "^2.4.8"
"@thi.ng/api": "^8.0.0",
"@thi.ng/checks": "^3.0.0",
"@thi.ng/compare": "^2.0.0",
"@thi.ng/equiv": "^2.0.0",
"@thi.ng/errors": "^2.0.0",
"@thi.ng/random": "^3.0.0"
},
"files": [
"*.js",
"*.d.ts",
"lib"
],
"devDependencies": {
"@thi.ng/testament": "^0.1.0"
},
"keywords": [

@@ -67,7 +61,78 @@ "aos",

},
"sideEffects": false,
"files": [
"*.js",
"*.d.ts"
],
"exports": {
".": {
"import": "./index.js"
},
"./api": {
"import": "./api.js"
},
"./binary-search": {
"import": "./binary-search.js"
},
"./bisect": {
"import": "./bisect.js"
},
"./ends-with": {
"import": "./ends-with.js"
},
"./ensure-array": {
"import": "./ensure-array.js"
},
"./ensure-iterable": {
"import": "./ensure-iterable.js"
},
"./fill-range": {
"import": "./fill-range.js"
},
"./find": {
"import": "./find.js"
},
"./fuzzy-match": {
"import": "./fuzzy-match.js"
},
"./insert": {
"import": "./insert.js"
},
"./into": {
"import": "./into.js"
},
"./is-sorted": {
"import": "./is-sorted.js"
},
"./iterator": {
"import": "./iterator.js"
},
"./levenshtein": {
"import": "./levenshtein.js"
},
"./peek": {
"import": "./peek.js"
},
"./quicksort": {
"import": "./quicksort.js"
},
"./shuffle": {
"import": "./shuffle.js"
},
"./sort-cached": {
"import": "./sort-cached.js"
},
"./starts-with": {
"import": "./starts-with.js"
},
"./swap": {
"import": "./swap.js"
},
"./swizzle": {
"import": "./swizzle.js"
}
},
"thi.ng": {
"year": 2018
},
"gitHead": "d971cb3f9b215a95483f78f1a8614015e331146f"
"gitHead": "9ac1344b38b565eb894306fbf72233b6c0b2d115"
}

@@ -1,2 +0,2 @@

import { compare } from "@thi.ng/compare";
import { compare } from "@thi.ng/compare/compare";
import { swap } from "./swap";

@@ -3,0 +3,0 @@ // prettier-ignore

@@ -37,11 +37,19 @@ <!-- This file is generated - DO NOT EDIT! -->

ES module import:
```html
// ES module
<script type="module" src="https://unpkg.com/@thi.ng/arrays?module" crossorigin></script>
<script type="module" src="https://cdn.skypack.dev/@thi.ng/arrays"></script>
```
// UMD
<script src="https://unpkg.com/@thi.ng/arrays/lib/index.umd.js" crossorigin></script>
[Skypack documentation](https://docs.skypack.dev/)
For NodeJS (v14.6+):
```text
node --experimental-specifier-resolution=node --experimental-repl-await
> const arrays = await import("@thi.ng/arrays");
```
Package sizes (gzipped, pre-treeshake): ESM: 2.08 KB / CJS: 2.27 KB / UMD: 2.23 KB
Package sizes (gzipped, pre-treeshake): ESM: 2.12 KB

@@ -48,0 +56,0 @@ ## Dependencies

@@ -1,3 +0,3 @@

import { TypedArray } from "@thi.ng/api";
import { IRandom } from "@thi.ng/random";
import type { TypedArray } from "@thi.ng/api";
import type { IRandom } from "@thi.ng/random";
import type { AnyArray } from "./api";

@@ -4,0 +4,0 @@ /**

@@ -1,3 +0,3 @@

import { assert } from "@thi.ng/api";
import { SYSTEM } from "@thi.ng/random";
import { assert } from "@thi.ng/errors/assert";
import { SYSTEM } from "@thi.ng/random/system";
/**

@@ -4,0 +4,0 @@ * Shuffles the items in the given index range of array `buf` using

@@ -1,2 +0,2 @@

import { Comparator, Fn } from "@thi.ng/api";
import type { Comparator, Fn } from "@thi.ng/api";
/**

@@ -3,0 +3,0 @@ * Takes a `src` array and `key` array of function to provide the sort key of

@@ -1,4 +0,4 @@

import { assert } from "@thi.ng/api";
import { isFunction } from "@thi.ng/checks";
import { compare } from "@thi.ng/compare";
import { isFunction } from "@thi.ng/checks/is-function";
import { compare } from "@thi.ng/compare/compare";
import { assert } from "@thi.ng/errors/assert";
import { quickSort } from "./quicksort";

@@ -5,0 +5,0 @@ import { multiSwap } from "./swap";

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc