Skip to content

Commit fed59c8

Browse files
committed
init
0 parents  commit fed59c8

File tree

10 files changed

+2966
-0
lines changed

10 files changed

+2966
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[{package.json,*.yml}]
11+
indent_style = space
12+
indent_size = 2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.js text eol=lf

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- '5'
4+
- '4'
5+
- '0.12'
6+
- '0.10'

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
var unicodelist = require('./unicode-ranges.json');
3+
4+
module.exports = function () {
5+
return unicodelist;
6+
};

license

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Michael Wuergler <wuergler@gmail.com> (numetriclabs.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "unicode-range-json",
3+
"version": "0.0.1",
4+
"description": "A list of all the Unicode Range Names and their hex/decimal range numbers.",
5+
"license": "MIT",
6+
"repository": "radiovisual/unicode-range-json",
7+
"author": {
8+
"name": "Michael Wuergler",
9+
"email": "wuergler@gmail.com",
10+
"url": "numetriclabs.com"
11+
},
12+
"engines": {
13+
"node": ">=0.10.0"
14+
},
15+
"scripts": {
16+
"test": "xo && ava"
17+
},
18+
"files": [
19+
"index.js"
20+
],
21+
"keywords": [
22+
"unicode",
23+
"range",
24+
"list",
25+
"json",
26+
"ranges",
27+
"names",
28+
"hexadecimal",
29+
"decimal"
30+
],
31+
"dependencies": {},
32+
"devDependencies": {
33+
"ava": "^0.12.0",
34+
"xo": "^0.12.1"
35+
}
36+
}

readme.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# unicode-range-json [![Build Status](https://travis-ci.org/radiovisual/unicode-range-json.svg?branch=master)](https://travis-ci.org/radiovisual/unicode-range-json)
2+
3+
> A list of all the Unicode Range Names and their hex/decimal range numbers.
4+
5+
This module simply returns the [unicode-range.json]() file.
6+
7+
## Install
8+
9+
```
10+
$ npm install --save unicode-range-json
11+
```
12+
13+
14+
## Usage
15+
16+
```js
17+
const unicodeRanges = require('unicode-range-json');
18+
19+
unicodeRanges();
20+
//=> 'unicorns & rainbows'
21+
```
22+
23+
24+
## API
25+
26+
### unicodeRanges()
27+
28+
Returns a JSON object with information about the Unicode Ranges.
29+
30+
31+
## Contribution
32+
33+
Please open an issue or pull request of you discover any of the values or ranges to be incorrect. *Thanks!*
34+
35+
36+
## License
37+
38+
MIT © [Michael Wuergler](http://numetriclabs.com)

test.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import test from 'ava';
2+
import fn from './';
3+
4+
test('returns an object', t => {
5+
t.is(typeof fn(), 'object');
6+
});
7+
8+
test('all values have category, hexrange, range', t => {
9+
var ranges = fn();
10+
11+
t.plan(ranges.length * 3);
12+
13+
ranges.forEach(range => {
14+
t.is(typeof range.category, 'string');
15+
t.true(Array.isArray(range.hexrange));
16+
t.true(Array.isArray(range.range));
17+
});
18+
});
19+
20+
test('all hexrange values have proper formatting', t => {
21+
var ranges = fn();
22+
23+
t.plan(ranges.length * 5);
24+
25+
ranges.forEach(range => {
26+
t.is(range.hexrange.length, 2);
27+
t.is(typeof range.hexrange[0], 'string');
28+
t.is(typeof range.hexrange[1], 'string');
29+
t.true(range.hexrange[0].length >= 4 && range.hexrange[0].length <= 5);
30+
t.true(range.hexrange[1].length >= 4 && range.hexrange[0].length <= 5);
31+
});
32+
});
33+
34+
test('all ranges values have proper formatting', t => {
35+
var ranges = fn();
36+
37+
t.plan(ranges.length * 5);
38+
39+
ranges.forEach(range => {
40+
t.is(range.range.length, 2);
41+
t.is(typeof range.range[0], 'number');
42+
t.is(typeof range.range[1], 'number');
43+
t.true(range.range[0] === Math.abs(parseInt(range.range[0], 10)));
44+
t.true(range.range[1] === Math.abs(parseInt(range.range[1], 10)));
45+
});
46+
});
47+

0 commit comments

Comments
 (0)