File tree Expand file tree Collapse file tree 5 files changed +30
-14
lines changed Expand file tree Collapse file tree 5 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,13 @@ User:Watchduck
1313</p >
1414
1515Permutation library for JavaScript.
16- See [ docs] ( https://computational-combinatorics.github.io/permutation ) .
16+ See [ docs] ( https://computational-combinatorics.github.io/permutation/index.html ) .
1717Parent is [ js-algorithms] ( https://github.com/make-github-pseudonymous-again/js-algorithms ) .
1818
19+ > :warning : Depending on your environment, the code may require
20+ > ` regeneratorRuntime ` to be defined, for instance by importing
21+ > [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
22+
1923``` js
2024import { next , reversed , identity } from ' @combinatorics/permutation' ;
2125next ( reversed ( identity ( 3 ) ) ) ; // [ 0 , 1 , 2 ]
Original file line number Diff line number Diff line change 1- # Example
1+ # Examples
2+
3+ > More examples in [ the test files] ( https://github.com/computational-combinatorics/permutation/tree/main/test/src ) .
24
35``` js
46import {
Original file line number Diff line number Diff line change 11# Installation
22
33Can be managed using
4- [ jspm] ( http://jspm.io )
5- or [ npm] ( https://github.com/npm/npm ) .
4+ [ yarn] ( https://yarnpkg.com/en/docs ) ,
5+ [ npm] ( https://docs.npmjs.com ) ,
6+ or [ jspm] ( https://jspm.org/docs ) .
67
7- ### jspm
8+
9+ ### yarn
810``` terminal
9- jspm install npm: @combinatorics/permutation
11+ yarn add @combinatorics/permutation
1012```
1113
1214### npm
1315``` terminal
1416npm install @combinatorics/permutation --save
1517```
18+
19+ ### jspm
20+ ``` terminal
21+ jspm install npm:@combinatorics/permutation
22+ ```
Original file line number Diff line number Diff line change 11# Usage
22
3- The code needs a ES2015+ polyfill to work, for example
4- [ regenerator-runtime/runtime] ( https://babeljs.io/docs/usage/polyfill ) .
3+ > :warning : Depending on your environment, the code may require
4+ > ` regeneratorRuntime ` to be defined, for instance by importing
5+ > [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
6+
7+ First, require the polyfill at the entry point of your application
58``` js
6- await import ( ' regenerator-runtime/runtime.js' ) ;
9+ await import (' regenerator-runtime/runtime.js' ) ;
710// or
8- import ' regenerator-runtime/runtime.js' ;
11+ import ' regenerator-runtime/runtime.js' ;
912```
1013
11- Then
14+ Then, import the library where needed
1215``` js
13- const permutation = await import ( ' @combinatorics/permutation' ) ;
16+ const permutation = await import (' @combinatorics/permutation' ) ;
1417// or
15- import * as permutation from ' @combinatorics/permutation' ;
18+ import * as permutation from ' @combinatorics/permutation' ;
1619```
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const domReady = function (callback) {
1010domReady ( ( ) => {
1111 const projectname = document . createElement ( 'a' ) ;
1212 projectname . classList . add ( 'project-name' ) ;
13- projectname . text = 'combinatorics/permutation' ;
13+ projectname . text = '@ combinatorics/permutation' ;
1414 projectname . href = './index.html' ;
1515
1616 const header = document . querySelector ( 'header' ) ;
You can’t perform that action at this time.
0 commit comments