Skip to content

Commit 3d9d2ec

Browse files
author
Aurélien Ooms
authored
Merge branch 'master' into greenkeeper/update-all
2 parents 03c7de7 + 8579436 commit 3d9d2ec

File tree

132 files changed

+2278
-1636
lines changed

Some content is hidden

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

132 files changed

+2278
-1636
lines changed

.codacy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
languages:
2+
JavaScript: true
3+
exclude_paths:
4+
- "lib/**"
5+
- "doc/**"
6+
- "test/**"

.codeclimate.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
languages:
22
JavaScript: true
33
exclude_paths:
4-
- "js/dist/*.js"
5-
- "js/dist/**/*.js"
6-
- "test/*.js"
7-
- "test/**/*.js"
4+
- "lib/**"
5+
- "doc/**"
6+
- "test/**"

.gitignore

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
# Logs
2-
logs
3-
*.log
4-
5-
# Runtime data
6-
pids
7-
*.pid
8-
*.seed
9-
10-
# Directory for instrumented libs generated by jscoverage/JSCover
11-
lib-cov
12-
13-
# Coverage directory used by tools like istanbul
14-
coverage
15-
16-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17-
.grunt
18-
19-
# node-waf configuration
20-
.lock-wscript
21-
22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
24-
251
# Dependency directory
26-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
272
node_modules
3+
jspm_packages
4+
5+
# Coverage directory used by nyc
6+
coverage
7+
.nyc_output
288

29-
# groc
30-
doc
9+
# Documentation
10+
gh-pages

.groc.json

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

.jshintrc

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

.travis.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
language: node_js
2+
23
node_js:
3-
- "iojs"
4-
- "0.12"
5-
- "0.11"
6-
- "0.10"
4+
- node
5+
76
install:
8-
- npm -d install
7+
- npm install
8+
99
script:
10-
- npm test
10+
- npm run cover
11+
1112
after_success:
12-
- ./node_modules/.bin/coveralls < coverage/lcov.info || true
13-
- ./node_modules/.bin/codeclimate < coverage/lcov.info || true
13+
- bash <(curl -s https://codecov.io/bash) || true
14+
- coveralls < coverage/lcov.info || true
15+
- codeclimate-test-reporter < coverage/lcov.info || true

README.md

Lines changed: 17 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,24 @@
1-
[js-permutation](http://aureooms.github.io/js-permutation)
1+
[@aureooms/js-permutation](https://aureooms.github.io/js-permutation)
22
==
33

4-
Permutations code bricks for JavaScript.
4+
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e0/Symmetric_group_3;_Cayley_table;_matrices.svg" width="864">
55

6-
```js
7-
next( reversed( identity( 3 ) ) ) ; // [ 0 , 1 , 2 ]
8-
```
9-
10-
[![NPM license](http://img.shields.io/npm/l/aureooms-js-permutation.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-permutation/master/LICENSE)
11-
[![NPM version](http://img.shields.io/npm/v/aureooms-js-permutation.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-permutation)
12-
[![Bower version](http://img.shields.io/bower/v/aureooms-js-permutation.svg?style=flat)](http://bower.io/search/?q=aureooms-js-permutation)
13-
[![Build Status](http://img.shields.io/travis/aureooms/js-permutation.svg?style=flat)](https://travis-ci.org/aureooms/js-permutation)
14-
[![Coverage Status](http://img.shields.io/coveralls/aureooms/js-permutation.svg?style=flat)](https://coveralls.io/r/aureooms/js-permutation)
15-
[![Dependencies Status](http://img.shields.io/david/aureooms/js-permutation.svg?style=flat)](https://david-dm.org/aureooms/js-permutation#info=dependencies)
16-
[![devDependencies Status](http://img.shields.io/david/dev/aureooms/js-permutation.svg?style=flat)](https://david-dm.org/aureooms/js-permutation#info=devDependencies)
17-
[![Code Climate](http://img.shields.io/codeclimate/github/aureooms/js-permutation.svg?style=flat)](https://codeclimate.com/github/aureooms/js-permutation)
18-
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-permutation.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-permutation)
19-
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-permutation.svg?style=flat)](https://github.com/aureooms/js-permutation/issues)
20-
[![Inline docs](http://inch-ci.org/github/aureooms/js-permutation.svg?branch=master&style=shields)](http://inch-ci.org/github/aureooms/js-permutation)
21-
22-
Can be managed through [jspm](https://github.com/jspm/jspm-cli),
23-
[duo](https://github.com/duojs/duo),
24-
[component](https://github.com/componentjs/component),
25-
[bower](https://github.com/bower/bower),
26-
[ender](https://github.com/ender-js/Ender),
27-
[jam](https://github.com/caolan/jam),
28-
[spm](https://github.com/spmjs/spm),
29-
and [npm](https://github.com/npm/npm).
30-
31-
## Caveat
32-
33-
Requires `regeneratorRuntime` to be defined, see
34-
[babel docs](http://babeljs.io/docs/usage/polyfill/).
35-
36-
## Install
37-
38-
### jspm
39-
```terminal
40-
jspm install github:aureooms/js-permutation
41-
# or
42-
jspm install npm:aureooms-js-permutation
43-
```
44-
### duo
45-
No install step needed for duo!
46-
47-
### component
48-
```terminal
49-
component install aureooms/js-permutation
50-
```
6+
Permutation library for JavaScript.
7+
See [docs](https://aureooms.github.io/js-permutation).
8+
Parent is [@aureooms/js-algorithms](https://github.com/aureooms/js-algorithms).
519

52-
### bower
53-
```terminal
54-
bower install aureooms-js-permutation
55-
```
56-
57-
### ender
58-
```terminal
59-
ender add aureooms-js-permutation
60-
```
61-
62-
### jam
63-
```terminal
64-
jam install aureooms-js-permutation
65-
```
66-
67-
### spm
68-
```terminal
69-
spm install aureooms-js-permutation --save
70-
```
71-
72-
### npm
73-
```terminal
74-
npm install aureooms-js-permutation --save
75-
```
76-
77-
## Require
78-
### jspm
7910
```js
80-
let permutation = require( "github:aureooms/js-permutation" ) ;
81-
// or
82-
import permutation from 'aureooms-js-permutation' ;
83-
```
84-
### duo
85-
```js
86-
let permutation = require( "aureooms/js-permutation" ) ;
87-
```
88-
89-
### component, ender, spm, npm
90-
```js
91-
let permutation = require( "aureooms-js-permutation" ) ;
92-
```
93-
94-
### bower
95-
The script tag exposes the global variable `permutation`.
96-
```html
97-
<script src="bower_components/aureooms-js-permutation/js/dist/permutation.min.js"></script>
98-
```
99-
Alternatively, you can use any tool mentioned [here](http://bower.io/docs/tools/).
100-
101-
### jam
102-
```js
103-
require( [ "aureooms-js-permutation" ] , function ( permutation ) { ... } ) ;
11+
import { next , reversed , identity } from '@aureooms/js-permutation' ;
12+
next( reversed( identity( 3 ) ) ) ; // [ 0 , 1 , 2 ]
10413
```
10514

106-
## Use
107-
108-
```js
109-
let sigma = permutation.identity( 3 ) ;
110-
111-
sigma ; // [ 0 , 1 , 2 ]
112-
113-
permutation.reversed( sigma ) ; // [ 2 , 1 , 0 ]
114-
115-
permutation.next( sigma ) ; // [ 0 , 2 , 1 ]
116-
117-
for ( let tau of permutation.permutations( 3 ) ) {
118-
119-
... // yields [ 0 , 1 , 2 ]
120-
// [ 0 , 2 , 1 ]
121-
// [ 1 , 0 , 2 ]
122-
// [ 1 , 2 , 0 ]
123-
// [ 2 , 0 , 1 ]
124-
// [ 2 , 1 , 0 ]
125-
126-
}
127-
128-
permutation.invert( [ 0 , 1 , 2 ] ) ; // [ 0 , 1 , 2 ]
129-
permutation.invert( [ 0 , 2 , 1 ] ) ; // [ 0 , 2 , 1 ]
130-
permutation.invert( [ 1 , 0 , 2 ] ) ; // [ 1 , 0 , 2 ]
131-
permutation.invert( [ 1 , 2 , 0 ] ) ; // [ 2 , 0 , 1 ]
132-
permutation.invert( [ 2 , 0 , 1 ] ) ; // [ 1 , 2 , 0 ]
133-
permutation.invert( [ 2 , 1 , 0 ] ) ; // [ 2 , 1 , 0 ]
134-
135-
permutation.compose( "abc" , [ 2 , 0 , 1 ] ) ; // [ "c" , "a" , "b" ]
136-
137-
permutation.bitreversal( 8 ) ; // [ 0 , 4 , 2 , 6 , 1 , 5 , 3 , 7 ]
138-
```
15+
[![License](https://img.shields.io/github/license/aureooms/js-permutation.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-permutation/master/LICENSE)
16+
[![NPM version](https://img.shields.io/npm/v/@aureooms/js-permutation.svg?style=flat)](https://www.npmjs.org/package/@aureooms/js-permutation)
17+
[![Build Status](https://img.shields.io/travis/aureooms/js-permutation.svg?style=flat)](https://travis-ci.org/aureooms/js-permutation)
18+
[![Coverage Status](https://img.shields.io/coveralls/aureooms/js-permutation.svg?style=flat)](https://coveralls.io/r/aureooms/js-permutation)
19+
[![Dependencies Status](https://img.shields.io/david/aureooms/js-permutation.svg?style=flat)](https://david-dm.org/aureooms/js-permutation#info=dependencies)
20+
[![devDependencies Status](https://img.shields.io/david/dev/aureooms/js-permutation.svg?style=flat)](https://david-dm.org/aureooms/js-permutation#info=devDependencies)
21+
[![Code Climate](https://img.shields.io/codeclimate/github/aureooms/js-permutation.svg?style=flat)](https://codeclimate.com/github/aureooms/js-permutation)
22+
[![NPM downloads per month](https://img.shields.io/npm/dm/@aureooms/js-permutation.svg?style=flat)](https://www.npmjs.org/package/@aureooms/js-permutation)
23+
[![GitHub issues](https://img.shields.io/github/issues/aureooms/js-permutation.svg?style=flat)](https://github.com/aureooms/js-permutation/issues)
24+
[![Documentation](https://aureooms.github.io/js-permutation/badge.svg)](https://aureooms.github.io/js-permutation/source.html)

bower.json

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

component.json

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

doc/css/style.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
h1,
2+
h2,
3+
.navigation,
4+
.layout-container > header,
5+
footer
6+
{
7+
border: none;
8+
}
9+
10+
.project-name {
11+
color: #FC913A;
12+
font-weight: bold;
13+
}
14+
15+
.layout-container > header > a.repo-url-github {
16+
font-size: inherit;
17+
display: inline;
18+
background: none;
19+
vertical-align: inherit;
20+
}
21+
22+
.search-box img {
23+
display: none;
24+
}
25+
26+
.search-box::before{
27+
content: "search";
28+
}
29+
30+
.search-input-edge {
31+
height: 0px;
32+
}
33+
34+
.search-result {
35+
width: 300px;
36+
margin-left: 42px;
37+
box-shadow: 1px 1px 13px rgba(0,0,0,0.2);
38+
}
39+
40+
.search-input {
41+
visibility: visible;
42+
}
43+
44+
.search-result li.search-separator {
45+
text-transform: capitalize;
46+
background-color: #ccc;
47+
}
48+
49+
span[data-ice="signature"] > span {
50+
/*font-weight: bold;*/
51+
font-style: italic;
52+
}

doc/manual/example.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
```js
2+
import {
3+
identity ,
4+
reversed ,
5+
next
6+
} from '@aureooms/js-permutation' ;
7+
8+
let sigma = identity( 3 ) ;
9+
10+
sigma ; // [ 0 , 1 , 2 ]
11+
12+
reversed( sigma ) ; // [ 2 , 1 , 0 ]
13+
14+
next( sigma ) ; // [ 0 , 2 , 1 ]
15+
16+
17+
import { permutations } from '@aureooms/js-permutation' ;
18+
19+
for ( let tau of permutations( 3 ) ) {
20+
21+
... // yields [ 0 , 1 , 2 ]
22+
// [ 0 , 2 , 1 ]
23+
// [ 1 , 0 , 2 ]
24+
// [ 1 , 2 , 0 ]
25+
// [ 2 , 0 , 1 ]
26+
// [ 2 , 1 , 0 ]
27+
28+
}
29+
30+
31+
import { invert } from '@aureooms/js-permutation' ;
32+
33+
invert( [ 0 , 1 , 2 ] ) ; // [ 0 , 1 , 2 ]
34+
invert( [ 0 , 2 , 1 ] ) ; // [ 0 , 2 , 1 ]
35+
invert( [ 1 , 0 , 2 ] ) ; // [ 1 , 0 , 2 ]
36+
invert( [ 1 , 2 , 0 ] ) ; // [ 2 , 0 , 1 ]
37+
invert( [ 2 , 0 , 1 ] ) ; // [ 1 , 2 , 0 ]
38+
invert( [ 2 , 1 , 0 ] ) ; // [ 2 , 1 , 0 ]
39+
40+
41+
import { compose } from '@aureooms/js-permutation' ;
42+
43+
compose( "abc" , [ 2 , 0 , 1 ] ) ; // [ "c" , "a" , "b" ]
44+
45+
46+
import { bitreversal } from '@aureooms/js-permutation' ;
47+
48+
bitreversal( 8 ) ; // [ 0 , 4 , 2 , 6 , 1 , 5 , 3 , 7 ]
49+
```

0 commit comments

Comments
 (0)