@thi.ng/idgen
Advanced tools
Comparing version 1.0.5 to 2.0.0
@@ -6,16 +6,26 @@ # Change Log | ||
## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@1.0.4...@thi.ng/idgen@1.0.5) (2021-09-03) | ||
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@1.0.5...@thi.ng/idgen@2.0.0) (2021-10-12) | ||
**Note:** Version bump only for package @thi.ng/idgen | ||
### Build System | ||
* major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6)) | ||
### BREAKING CHANGES | ||
## [0.2.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@0.2.28...@thi.ng/idgen@0.2.29) (2021-01-02) | ||
* 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 | ||
### Performance Improvements | ||
Also: | ||
- normalize/restructure/reorg all package.json files | ||
- cleanup all build scripts, remove obsolete | ||
- switch from mocha to @thi.ng/testament for all tests | ||
* **idgen:** minor updates IDGen, add doc strings ([1c0e284](https://github.com/thi-ng/umbrella/commit/1c0e284e9f48d4a37a55f74db0fb2b6eade9dc89)) | ||
@@ -26,14 +36,24 @@ | ||
# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@0.1.0...@thi.ng/idgen@0.2.0) (2020-01-24) | ||
## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@1.0.4...@thi.ng/idgen@1.0.5) (2021-09-03) | ||
### Features | ||
**Note:** Version bump only for package @thi.ng/idgen | ||
* **idgen:** add IClear impl, fix available() getter, add tests ([e467978](https://github.com/thi-ng/umbrella/commit/e467978f7cd3e82b188ce40631f7367d8e9cebdd)) | ||
* **idgen:** support increasing ID range capacity ([f040eb5](https://github.com/thi-ng/umbrella/commit/f040eb5cb04e458e753fb37fa4dc2fc32a3e0e8c)) | ||
## [0.2.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@0.2.28...@thi.ng/idgen@0.2.29) (2021-01-02) | ||
# 0.1.0 (2019-11-30) | ||
### Performance Improvements | ||
### Features | ||
- **idgen:** minor updates IDGen, add doc strings ([1c0e284](https://github.com/thi-ng/umbrella/commit/1c0e284e9f48d4a37a55f74db0fb2b6eade9dc89)) | ||
* **idgen:** add INotify impl, add tests ([7aec9b7](https://github.com/thi-ng/umbrella/commit/7aec9b7e7cd0d335e90bd50f5fb47c7b72188fbf)) | ||
* **idgen:** import as new pkg ([bff5f5b](https://github.com/thi-ng/umbrella/commit/bff5f5b66d05449c79e5087385bdecc43594a700)) | ||
# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@0.1.0...@thi.ng/idgen@0.2.0) (2020-01-24) | ||
### Features | ||
- **idgen:** add IClear impl, fix available() getter, add tests ([e467978](https://github.com/thi-ng/umbrella/commit/e467978f7cd3e82b188ce40631f7367d8e9cebdd)) | ||
- **idgen:** support increasing ID range capacity ([f040eb5](https://github.com/thi-ng/umbrella/commit/f040eb5cb04e458e753fb37fa4dc2fc32a3e0e8c)) | ||
# 0.1.0 (2019-11-30) | ||
### Features | ||
- **idgen:** add INotify impl, add tests ([7aec9b7](https://github.com/thi-ng/umbrella/commit/7aec9b7e7cd0d335e90bd50f5fb47c7b72188fbf)) | ||
- **idgen:** import as new pkg ([bff5f5b](https://github.com/thi-ng/umbrella/commit/bff5f5b66d05449c79e5087385bdecc43594a700)) |
@@ -1,2 +0,2 @@ | ||
import { Event, IClear, INotify, Listener } from "@thi.ng/api"; | ||
import type { Event, IClear, INotify, Listener } from "@thi.ng/api"; | ||
export declare const EVENT_ADDED = "added"; | ||
@@ -3,0 +3,0 @@ export declare const EVENT_REMOVED = "removed"; |
12
index.js
import { __decorate } from "tslib"; | ||
import { assert, INotifyMixin, } from "@thi.ng/api"; | ||
import { INotifyMixin } from "@thi.ng/api/mixins/inotify"; | ||
import { assert } from "@thi.ng/errors/assert"; | ||
export const EVENT_ADDED = "added"; | ||
export const EVENT_REMOVED = "removed"; | ||
let IDGen = class IDGen { | ||
ids; | ||
nextID; | ||
_freeID; | ||
start; | ||
num; | ||
_capacity; | ||
mask; | ||
vmask; | ||
shift; | ||
constructor(bits = 32, vbits = 32 - bits, cap = 2 ** bits, start = 0) { | ||
@@ -7,0 +17,0 @@ const maxCap = 2 ** bits; |
{ | ||
"name": "@thi.ng/idgen", | ||
"version": "1.0.5", | ||
"version": "2.0.0", | ||
"description": "Generator of opaque numeric identifiers with optional support for ID versioning and efficient re-use", | ||
"type": "module", | ||
"module": "./index.js", | ||
"main": "./lib/index.js", | ||
"umd:main": "./lib/index.umd.js", | ||
"typings": "./index.d.ts", | ||
"sideEffects": false, | ||
"repository": { | ||
@@ -27,24 +27,19 @@ "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/api": "^8.0.0", | ||
"@thi.ng/errors": "^2.0.0", | ||
"tslib": "^2.3.1" | ||
}, | ||
"files": [ | ||
"*.js", | ||
"*.d.ts", | ||
"lib" | ||
], | ||
"devDependencies": { | ||
"@thi.ng/testament": "^0.1.0" | ||
}, | ||
"keywords": [ | ||
@@ -62,3 +57,11 @@ "binary", | ||
}, | ||
"sideEffects": false, | ||
"files": [ | ||
"*.js", | ||
"*.d.ts" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./index.js" | ||
} | ||
}, | ||
"thi.ng": { | ||
@@ -71,3 +74,3 @@ "related": [ | ||
}, | ||
"gitHead": "d971cb3f9b215a95483f78f1a8614015e331146f" | ||
"gitHead": "9ac1344b38b565eb894306fbf72233b6c0b2d115" | ||
} |
@@ -64,11 +64,19 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
ES module import: | ||
```html | ||
// ES module | ||
<script type="module" src="https://unpkg.com/@thi.ng/idgen?module" crossorigin></script> | ||
<script type="module" src="https://cdn.skypack.dev/@thi.ng/idgen"></script> | ||
``` | ||
// UMD | ||
<script src="https://unpkg.com/@thi.ng/idgen/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 idgen = await import("@thi.ng/idgen"); | ||
``` | ||
Package sizes (gzipped, pre-treeshake): ESM: 857 bytes / CJS: 906 bytes / UMD: 1019 bytes | ||
Package sizes (gzipped, pre-treeshake): ESM: 897 bytes | ||
@@ -78,2 +86,3 @@ ## Dependencies | ||
- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api) | ||
- [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors) | ||
- [tslib](https://github.com/thi-ng/umbrella/tree/develop/packages/undefined) | ||
@@ -80,0 +89,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
207
Yes
28478
3
1
6
271
+ Added@thi.ng/errors@^2.0.0
+ Added@thi.ng/api@8.11.16(transitive)
+ Added@thi.ng/errors@2.5.22(transitive)
- Removed@thi.ng/api@7.2.0(transitive)
Updated@thi.ng/api@^8.0.0