@thi.ng/heaps
Advanced tools
Comparing version 0.3.1 to 1.0.0
@@ -1,2 +0,2 @@ | ||
import { Comparator } from "@thi.ng/api/api"; | ||
import { Comparator } from "@thi.ng/api"; | ||
export interface HeapOpts<T> { | ||
@@ -3,0 +3,0 @@ compare: Comparator<T>; |
@@ -6,2 +6,24 @@ # Change Log | ||
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@0.3.1...@thi.ng/heaps@1.0.0) (2019-01-21) | ||
### Build System | ||
* update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703)) | ||
### BREAKING CHANGES | ||
* enabled multi-outputs (ES6 modules, CJS, UMD) | ||
- build scripts now first build ES6 modules in package root, then call | ||
`scripts/bundle-module` to build minified CJS & UMD bundles in `/lib` | ||
- all imports MUST be updated to only refer to package level | ||
(not individual files anymore). tree shaking in user land will get rid of | ||
all unused imported symbols. | ||
## [0.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@0.3.0...@thi.ng/heaps@0.3.1) (2018-12-15) | ||
@@ -8,0 +30,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ICopy, IEmpty } from "@thi.ng/api/api"; | ||
import { ICopy, IEmpty } from "@thi.ng/api"; | ||
import { DHeapOpts } from "./api"; | ||
@@ -3,0 +3,0 @@ import { Heap } from "./heap"; |
11
dheap.js
@@ -1,5 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const compare_1 = require("@thi.ng/compare"); | ||
const heap_1 = require("./heap"); | ||
import { compare } from "@thi.ng/compare"; | ||
import { Heap } from "./heap"; | ||
/** | ||
@@ -14,5 +12,5 @@ * Generic d-ary heap / priority queue with configurable arity (default | ||
*/ | ||
class DHeap extends heap_1.Heap { | ||
export class DHeap extends Heap { | ||
constructor(values, opts) { | ||
super(null, Object.assign({ compare: compare_1.compare }, opts)); | ||
super(null, Object.assign({ compare }, opts)); | ||
this.d = (opts && opts.d) || 4; | ||
@@ -111,2 +109,1 @@ this.values = []; | ||
} | ||
exports.DHeap = DHeap; |
@@ -1,2 +0,2 @@ | ||
import { Comparator, ICopy, IEmpty, ILength } from "@thi.ng/api/api"; | ||
import { Comparator, ICopy, IEmpty, ILength } from "@thi.ng/api"; | ||
import { HeapOpts } from "./api"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,4 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const compare_1 = require("@thi.ng/compare"); | ||
import { compare } from "@thi.ng/compare"; | ||
/** | ||
@@ -20,5 +18,5 @@ * Generic binary heap / priority queue with customizable ordering via | ||
*/ | ||
class Heap { | ||
export class Heap { | ||
constructor(values, opts) { | ||
opts = Object.assign({ compare: compare_1.compare }, opts); | ||
opts = Object.assign({ compare: compare }, opts); | ||
this.compare = opts.compare; | ||
@@ -215,3 +213,2 @@ this.values = []; | ||
} | ||
exports.Heap = Heap; | ||
function binarySearch(vals, x, lo, hi, cmp) { | ||
@@ -218,0 +215,0 @@ let m; |
@@ -1,7 +0,2 @@ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./dheap")); | ||
__export(require("./heap")); | ||
export * from "./dheap"; | ||
export * from "./heap"; |
{ | ||
"name": "@thi.ng/heaps", | ||
"version": "0.3.1", | ||
"version": "1.0.0", | ||
"description": "Generic binary heap & d-ary heap implementations with customizable ordering", | ||
"main": "./index.js", | ||
"module": "./index.js", | ||
"main": "./lib/index.js", | ||
"umd:main": "./lib/index.umd.js", | ||
"typings": "./index.d.ts", | ||
@@ -15,8 +17,10 @@ "repository": { | ||
"scripts": { | ||
"build": "yarn run clean && tsc --declaration", | ||
"clean": "rm -rf *.js *.d.ts .nyc_output build coverage doc", | ||
"build": "yarn clean && yarn build:es6 && yarn build:bundle", | ||
"build:es6": "tsc --declaration", | ||
"build:bundle": "../../scripts/bundle-module heaps api compare", | ||
"test": "rimraf build && tsc -p test/tsconfig.json && nyc mocha build/test/*.js", | ||
"clean": "rimraf *.js *.d.ts .nyc_output build coverage doc lib", | ||
"cover": "yarn test && nyc report --reporter=lcov", | ||
"doc": "node_modules/.bin/typedoc --mode modules --out doc src", | ||
"pub": "yarn run build && yarn publish --access public", | ||
"test": "rm -rf build && tsc -p test && nyc mocha build/test/*.js" | ||
"pub": "yarn build && yarn publish --access public" | ||
}, | ||
@@ -28,8 +32,8 @@ "devDependencies": { | ||
"nyc": "^13.1.0", | ||
"typedoc": "^0.13.0", | ||
"typedoc": "^0.14.0", | ||
"typescript": "^3.2.2" | ||
}, | ||
"dependencies": { | ||
"@thi.ng/api": "^4.2.4", | ||
"@thi.ng/compare": "^0.1.12" | ||
"@thi.ng/api": "^5.0.0", | ||
"@thi.ng/compare": "^1.0.0" | ||
}, | ||
@@ -48,3 +52,4 @@ "keywords": [ | ||
}, | ||
"gitHead": "159ce8f6b1d2dad1e12f2ba3f4f7b60d1623acee" | ||
"sideEffects": false, | ||
"gitHead": "348e7303b8b4d2749a02dd43e3f78d711242e4fe" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
68584
16
1003
0
+ Added@thi.ng/api@5.1.07.2.0(transitive)
+ Added@thi.ng/compare@1.3.34(transitive)
+ Added@thi.ng/errors@1.3.4(transitive)
- Removed@thi.ng/api@4.2.4(transitive)
- Removed@thi.ng/compare@0.1.12(transitive)
- Removed@thi.ng/errors@0.1.12(transitive)
Updated@thi.ng/api@^5.0.0
Updated@thi.ng/compare@^1.0.0