Skip to content

Commit 7167378

Browse files
committed
add: scaffold
0 parents  commit 7167378

File tree

6 files changed

+112
-0
lines changed

6 files changed

+112
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
*.swp
3+
src-cov
4+
coverage.html

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
TEST_TIMEOUT = 2000
2+
TEST_REPORTER = spec
3+
4+
test:
5+
@NODE_ENV=test \
6+
./node_modules/.bin/mocha \
7+
--require should \
8+
--timeout $(TEST_TIMEOUT) \
9+
--reporter $(TEST_REPORTER) \
10+
--recursive \
11+
--check-leaks \
12+
--bail \
13+
test
14+
15+
test-cov: src-cov
16+
@TEST_COV=1 $(MAKE) test TEST_REPORTER=html-cov > coverage.html
17+
18+
src-cov: clean
19+
@jscoverage src src-cov
20+
21+
benchmark:
22+
@node benchmark/benchmark.js
23+
24+
clean:
25+
@rm -f coverage.html
26+
@rm -rf src-cov
27+
28+
.PHONY: test test-cov src-cov benchmark clean

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# immutable-array.js
2+
3+
[![Build Status](https://travis-ci.org/qiao/immutable-array.js.svg?branch=master)](https://travis-ci.org/qiao/immutable-array.js)
4+
5+
Implementation of Immutable Array in JavaScript, based on [Finger Tree](https://github.com/qiao/fingertree.js).
6+
7+
## Installation (Node.js)
8+
9+
```
10+
npm install immutable-array
11+
```
12+
13+
Then, in your program:
14+
15+
```javascript
16+
var ImmutableArray = require('immutable-array');
17+
```
18+
19+
## Quick Examples
20+
21+
```javascript
22+
```
23+
24+
25+
## License
26+
27+
[MIT License](http://www.opensource.org/licenses/mit-license.php)
28+
29+
© 2014 Xueqiao Xu <[email protected]>
30+
31+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
32+
33+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
34+
35+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = process.env.TEST_COV ?
2+
require('./src-cov/immutable_array') :
3+
require('./src/immutable_array');

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "immutable-array",
3+
"version": "0.0.1",
4+
"description": "Immutable array",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "make test"
8+
},
9+
"dependencies": {
10+
"fingertree": "0.1.2"
11+
},
12+
"devDependencies": {
13+
"mocha": "1.18.2",
14+
"should": "3.3.1"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "git://github.com/qiao/immutable-array.js.git"
19+
},
20+
"keywords": [
21+
"datastructure",
22+
"algorithm",
23+
"persistent",
24+
"array"
25+
],
26+
"author": "Xueqiao Xu <[email protected]>",
27+
"license": "MIT",
28+
"bugs": {
29+
"url": "https://github.com/qiao/immutable-array.js/issues"
30+
},
31+
"homepage": "https://github.com/qiao/immutable-array.js"
32+
}

test/immutable_array.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* globals describe, it */
2+
3+
var ImmutableArray = require('..');
4+
5+
describe('Immutable Array', function () {
6+
it('should be initialized as an empty array', function () {
7+
var a = new ImmutableArray();
8+
a.length.should.eql(0);
9+
});
10+
});

0 commit comments

Comments
 (0)