Skip to content

Commit a9f5376

Browse files
keep only heapq code
1 parent 2ecd779 commit a9f5376

File tree

155 files changed

+556
-7824
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+556
-7824
lines changed

README.md

Lines changed: 25 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,35 @@
1-
[js-collections](http://aureooms.github.io/js-collections)
1+
[js-heapq](http://aureooms.github.io/js-heapq)
22
==
33

4-
Collections library for JavaScript. Parent is
4+
Python's heap and priority queue library for JavaScript. Parent is
55
[js-data-structures](https://github.com/aureooms/js-data-structures).
66

7-
JavaScript version of
8-
[Python's collections library](https://docs.python.org/3.6/library/collections.html)
9-
together with
10-
[Python's heapq library](https://docs.python.org/3.6/library/heapq.html)
11-
and
12-
[Python's bisect library](https://docs.python.org/3.6/library/bisect.html).
137

148
```js
159
let {
16-
heapq , bisect ,
17-
namedtuple ,
18-
deque ,
19-
set ,
20-
dict , defaultdict , ordereddict , counter , chainmap
21-
} = collections ;
10+
heapify ,
11+
heappop ,
12+
heappush ,
13+
heappushpop ,
14+
heapreplace ,
15+
merge ,
16+
nlargest ,
17+
nsmallest ,
18+
} = heapq ;
2219
```
2320

24-
[![NPM license](http://img.shields.io/npm/l/aureooms-js-collections.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-collections/master/LICENSE)
25-
[![NPM version](http://img.shields.io/npm/v/aureooms-js-collections.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-collections)
26-
[![Build Status](http://img.shields.io/travis/aureooms/js-collections.svg?style=flat)](https://travis-ci.org/aureooms/js-collections)
27-
[![Coverage Status](http://img.shields.io/coveralls/aureooms/js-collections.svg?style=flat)](https://coveralls.io/r/aureooms/js-collections)
28-
[![Dependencies Status](http://img.shields.io/david/aureooms/js-collections.svg?style=flat)](https://david-dm.org/aureooms/js-collections#info=dependencies)
29-
[![devDependencies Status](http://img.shields.io/david/dev/aureooms/js-collections.svg?style=flat)](https://david-dm.org/aureooms/js-collections#info=devDependencies)
30-
[![Code Climate](http://img.shields.io/codeclimate/github/aureooms/js-collections.svg?style=flat)](https://codeclimate.com/github/aureooms/js-collections)
31-
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-collections.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-collections)
32-
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-collections.svg?style=flat)](https://github.com/aureooms/js-collections/issues)
33-
[![Documentation](https://aureooms.github.io/js-collections/badge.svg)](https://aureooms.github.io/js-collections/source.html)
21+
[![NPM license](http://img.shields.io/npm/l/aureooms-js-heapq.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-heapq/master/LICENSE)
22+
[![NPM version](http://img.shields.io/npm/v/aureooms-js-heapq.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-heapq)
23+
[![Build Status](http://img.shields.io/travis/aureooms/js-heapq.svg?style=flat)](https://travis-ci.org/aureooms/js-heapq)
24+
[![Coverage Status](http://img.shields.io/coveralls/aureooms/js-heapq.svg?style=flat)](https://coveralls.io/r/aureooms/js-heapq)
25+
[![Dependencies Status](http://img.shields.io/david/aureooms/js-heapq.svg?style=flat)](https://david-dm.org/aureooms/js-heapq#info=dependencies)
26+
[![devDependencies Status](http://img.shields.io/david/dev/aureooms/js-heapq.svg?style=flat)](https://david-dm.org/aureooms/js-heapq#info=devDependencies)
27+
[![Code Climate](http://img.shields.io/codeclimate/github/aureooms/js-heapq.svg?style=flat)](https://codeclimate.com/github/aureooms/js-heapq)
28+
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-heapq.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-heapq)
29+
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-heapq.svg?style=flat)](https://github.com/aureooms/js-heapq/issues)
30+
[![Documentation](https://aureooms.github.io/js-heapq/badge.svg)](https://aureooms.github.io/js-heapq/source.html)
3431

35-
### Some changes w.r.t. Python's API
36-
37-
#### `heapq`
32+
## Changes w.r.t. Python's API
3833

3934
```js
4035
let array = [ 2 , 1 , 3 ] ;
@@ -45,31 +40,7 @@ heapq.heappop( heap ) ; // 2
4540
heapq.heappop( heap ) ; // 3
4641
array.length ; // 0
4742
```
48-
#### `set`
4943

50-
##### `set( iterable = null ) -> this`
51-
##### `set.inclusion( A , B ) -> {-1,0,1}`
52-
##### `set.prototype[Symbol.iterator]( ) -> iterable`
53-
##### `set.prototype.keys( ) -> iterable`
54-
##### `set.prototype.len( ) -> integer`
55-
##### `set.prototype.has( key ) -> boolean`
56-
##### `set.prototype.isdisjoint( other ) -> boolean`
57-
##### `set.prototype.isequal( other ) -> boolean`
58-
##### `set.prototype.issubset( other ) -> boolean`
59-
##### `set.prototype.ispropersubset( other ) -> boolean`
60-
##### `set.prototype.issuperset( other ) -> boolean`
61-
##### `set.prototype.ispropersuperset( other ) -> boolean`
62-
##### `set.prototype.union( ...others ) -> set`
63-
##### `set.prototype.intersection( ...others ) -> set`
64-
##### `set.prototype.difference( ...others ) -> set`
65-
##### `set.prototype.symmetric_difference( other ) -> set`
66-
##### `set.prototype.copy( ) -> set`
67-
##### `set.prototype.update( ...others ) -> this`
68-
##### `set.prototype.intersection_update( ...others ) -> this`
69-
##### `set.prototype.difference_update( ...others ) -> this`
70-
##### `set.prototype.symmetric_difference_update( other ) -> this`
71-
##### `set.prototype.add( key ) -> this`
72-
##### `set.prototype.remove( key ) -> this`
73-
##### `set.prototype.discard( key ) -> this`
74-
##### `set.prototype.pop( ) -> key`
75-
##### `set.prototype.clear( ) -> this`
44+
## References
45+
46+
- [Python's heapq library](https://docs.python.org/3.6/library/heapq.html).

doc/manual/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ or [npm](https://github.com/npm/npm).
44

55
### jspm
66
```terminal
7-
jspm install npm:aureooms-js-collections
7+
jspm install npm:aureooms-js-heapq
88
```
99

1010
### npm
1111
```terminal
12-
npm install aureooms-js-collections --save
12+
npm install aureooms-js-heapq --save
1313
```

doc/manual/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'babel-polyfill' ;
88

99
Then
1010
```js
11-
const number = require( 'aureooms-js-collections' ) ;
11+
const number = require( 'aureooms-js-heapq' ) ;
1212
// or
13-
import number from 'aureooms-js-collections' ;
13+
import number from 'aureooms-js-heapq' ;
1414
```

doc/scripts/header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ domReady(function(){
1313

1414
var projectname = document.createElement('a');
1515
projectname.classList.add('project-name');
16-
projectname.text = 'aureooms/js-collections';
16+
projectname.text = 'aureooms/js-heapq';
1717
projectname.href = './index.html' ;
1818

1919
var header = document.getElementsByTagName('header')[0] ;
2020
header.insertBefore(projectname,header.firstChild);
2121

2222
var testlink = document.querySelector('header > a[data-ice="testLink"]') ;
23-
testlink.href = 'https://coveralls.io/github/aureooms/js-collections' ;
23+
testlink.href = 'https://coveralls.io/github/aureooms/js-heapq' ;
2424
testlink.target = '_BLANK' ;
2525

2626
var searchBox = document.querySelector('.search-box');

esdoc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"debug": false,
1010
"index": "./README.md",
1111
"package": "./package.json",
12-
"title": "aureooms/js-collections",
12+
"title": "aureooms/js-heapq",
1313
"test": {
1414
"type": "ava",
1515
"source": "./test/src"

lib/bisect/bisect_left.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/bisect/bisect_right.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/bisect/index.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

lib/bisect/insort_left.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

lib/bisect/insort_right.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)