Skip to content

Commit fef63e1

Browse files
up deps, use es6 modules
1 parent b5089e2 commit fef63e1

Some content is hidden

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

62 files changed

+886
-467
lines changed

.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+
- "doc/**"
5+
- "lib/**"
6+
- "test/**"

.gitignore

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +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-
# Compiled binary addons (http://nodejs.org/api/addons.html)
20-
build/Release
21-
221
# Dependency directory
23-
# Commenting this out is preferred by some people, see
24-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
252
node_modules
3+
jspm_packages
264

27-
# Users Environment Variables
28-
.lock-wscript
5+
# Coverage directory used by nyc
6+
coverage
7+
.nyc_output
298

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

.groc.json

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

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
language: node_js
2+
23
node_js:
3-
- "node"
4+
- node
5+
46
install:
5-
- npm -d install
7+
- npm install
8+
69
script:
7-
- npm test
10+
- npm run cover
11+
812
after_success:
9-
- ./node_modules/.bin/coveralls < coverage/lcov.info || true
10-
- ./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: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,16 @@
44
<img src="https://cdn.rawgit.com/aureooms/js-random/master/media/sketch.png" width="864">
55

66
Randomness algorithms for JavaScript.
7+
See [docs](https://aureooms.github.io/js-random).
8+
Parent is [@aureooms/js-algorithms](https://aureooms.github.io/js-algorithms).
79

810
[![NPM license](http://img.shields.io/npm/l/aureooms-js-random.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-random/master/LICENSE)
911
[![NPM version](http://img.shields.io/npm/v/aureooms-js-random.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-random)
10-
[![Bower version](http://img.shields.io/bower/v/aureooms-js-random.svg?style=flat)](http://bower.io/search/?q=aureooms-js-random)
1112
[![Build Status](http://img.shields.io/travis/aureooms/js-random.svg?style=flat)](https://travis-ci.org/aureooms/js-random)
1213
[![Coverage Status](http://img.shields.io/coveralls/aureooms/js-random.svg?style=flat)](https://coveralls.io/r/aureooms/js-random)
1314
[![Dependencies Status](http://img.shields.io/david/aureooms/js-random.svg?style=flat)](https://david-dm.org/aureooms/js-random#info=dependencies)
1415
[![devDependencies Status](http://img.shields.io/david/dev/aureooms/js-random.svg?style=flat)](https://david-dm.org/aureooms/js-random#info=devDependencies)
1516
[![Code Climate](http://img.shields.io/codeclimate/github/aureooms/js-random.svg?style=flat)](https://codeclimate.com/github/aureooms/js-random)
1617
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-random.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-random)
1718
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-random.svg?style=flat)](https://github.com/aureooms/js-random/issues)
18-
[![Inline docs](http://inch-ci.org/github/aureooms/js-random.svg?branch=master&style=shields)](http://inch-ci.org/github/aureooms/js-random)
19-
20-
Can be managed through [duo](https://github.com/duojs/duo),
21-
[component](https://github.com/componentjs/component),
22-
[bower](https://github.com/bower/bower), or
23-
[npm](https://github.com/npm/npm).
24-
25-
```js
26-
let random = require( "aureooms-js-random" ) ;
27-
```
28-
29-
Example usage:
30-
31-
```js
32-
random.randfloat( 0 , 1 ) ; // 0.19876947347074747
33-
random.randfloat( 0 , 1 ) ; // 0.23755912738852203
34-
35-
random.randint( 0 , 100 ) ; // 57
36-
random.randint( 0 , 100 ) ; // 31
37-
38-
let a = [ 0 , 1 , 2 , 3 ] ;
39-
40-
random.sample( 1 , a , 0 , 4 ) ;
41-
a ; // [ 0 , 1 , 2 , 3 ]
42-
43-
random.sample( 1 , a , 0 , 4 ) ;
44-
a ; // [ 1 , 0 , 2 , 3 ]
45-
46-
random.shuffle( a , 0 , 4 ) ;
47-
a ; // [ 1 , 3 , 0 , 2 ]
48-
49-
random.shuffle( a , 0 , 4 ) ;
50-
a ; // [ 3 , 2 , 1 , 0 ]
51-
```
19+
[![Documentation](https://aureooms.github.io/js-random/badge.svg)](https://aureooms.github.io/js-random/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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```js
2+
import { randint , randfloat , sample , shuffle } from 'aureooms-js-random' ;
3+
4+
randfloat( 0 , 1 ) ; // 0.19876947347074747
5+
randfloat( 0 , 1 ) ; // 0.23755912738852203
6+
7+
randint( 0 , 100 ) ; // 57
8+
randint( 0 , 100 ) ; // 31
9+
10+
let a = [ 0 , 1 , 2 , 3 ] ;
11+
12+
sample( 1 , a , 0 , 4 ) ;
13+
a ; // [ 0 , 1 , 2 , 3 ]
14+
15+
sample( 1 , a , 0 , 4 ) ;
16+
a ; // [ 1 , 0 , 2 , 3 ]
17+
18+
shuffle( a , 0 , 4 ) ;
19+
a ; // [ 1 , 3 , 0 , 2 ]
20+
21+
shuffle( a , 0 , 4 ) ;
22+
a ; // [ 3 , 2 , 1 , 0 ]
23+
```

doc/manual/installation.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Can be managed using
2+
[jspm](http://jspm.io)
3+
or [npm](https://github.com/npm/npm).
4+
5+
### jspm
6+
```terminal
7+
jspm install npm:aureooms-js-random
8+
```
9+
10+
### npm
11+
```terminal
12+
npm install aureooms-js-random --save
13+
```

doc/manual/overview.md

Whitespace-only changes.

doc/manual/usage.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
The code needs a ES2015+ polyfill to work, for example
2+
[babel-polyfill](https://babeljs.io/docs/usage/polyfill).
3+
```js
4+
require( 'babel-polyfill' ) ;
5+
// or
6+
import 'babel-polyfill' ;
7+
```
8+
9+
Then
10+
```js
11+
const random = require( 'aureooms-js-random' ) ;
12+
// or
13+
import * as random from 'aureooms-js-random' ;
14+
```

doc/scripts/header.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var domReady = function(callback) {
2+
var state = document.readyState ;
3+
if ( state === 'interactive' || state === 'complete' ) {
4+
callback() ;
5+
}
6+
else {
7+
document.addEventListener('DOMContentLoaded', callback);
8+
}
9+
} ;
10+
11+
12+
domReady(function(){
13+
14+
var projectname = document.createElement('a');
15+
projectname.classList.add('project-name');
16+
projectname.text = 'aureooms/js-random';
17+
projectname.href = './index.html' ;
18+
19+
var header = document.getElementsByTagName('header')[0] ;
20+
header.insertBefore(projectname,header.firstChild);
21+
22+
var testlink = document.querySelector('header > a[data-ice="testLink"]') ;
23+
testlink.href = 'https://coveralls.io/github/aureooms/js-random' ;
24+
testlink.target = '_BLANK' ;
25+
26+
var searchBox = document.querySelector('.search-box');
27+
var input = document.querySelector('.search-input');
28+
29+
// active search box when focus on searchBox.
30+
input.addEventListener('focus', function(){
31+
searchBox.classList.add('active');
32+
});
33+
34+
});

esdoc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"source": "./src",
3+
"destination": "./gh-pages",
4+
"access": [
5+
"public",
6+
"protected",
7+
"private"
8+
],
9+
"debug": false,
10+
"index": "./README.md",
11+
"package": "./package.json",
12+
"title": "aureooms/js-random",
13+
"test": {
14+
"type": "ava",
15+
"source": "./test/src"
16+
},
17+
"manual": {
18+
"overview": [
19+
"./doc/manual/overview.md"
20+
],
21+
"installation": [
22+
"./doc/manual/installation.md"
23+
],
24+
"usage": [
25+
"./doc/manual/usage.md"
26+
],
27+
"example": [
28+
"./doc/manual/example.md"
29+
]
30+
},
31+
"styles": [
32+
"./doc/css/style.css"
33+
],
34+
"scripts": [
35+
"./doc/scripts/header.js"
36+
]
37+
}

inch.json

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

0 commit comments

Comments
 (0)