reference-map
Advanced tools
Comparing version 0.0.0 to 0.1.0
18
API.md
@@ -5,3 +5,3 @@ <!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
[index.js:5-7](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L5-L7 "Source code on GitHub") | ||
[index.js:5-7](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L5-L7 "Source code on GitHub") | ||
@@ -12,3 +12,3 @@ Handle mapping arbitary JS object to ints | ||
[index.js:15-17](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L15-L17 "Source code on GitHub") | ||
[index.js:15-17](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L15-L17 "Source code on GitHub") | ||
@@ -26,3 +26,3 @@ Adds an object to the referance map returning an int to be used as a | ||
[index.js:24-30](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L24-L30 "Source code on GitHub") | ||
[index.js:24-30](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L24-L30 "Source code on GitHub") | ||
@@ -39,3 +39,3 @@ gets a POJO given a refernce as an int | ||
[index.js:37-39](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L37-L39 "Source code on GitHub") | ||
[index.js:37-39](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L37-L39 "Source code on GitHub") | ||
@@ -53,4 +53,12 @@ deletes an object given a referance as an int | ||
[index.js:44-46](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L44-L46 "Source code on GitHub") | ||
[index.js:44-46](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L44-L46 "Source code on GitHub") | ||
clears the referance map of a objects | ||
# size | ||
[index.js:52-54](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L52-L54 "Source code on GitHub") | ||
returns the number of items in the refernace map | ||
Returns **integer** |
@@ -1,1 +0,1 @@ | ||
{"/home/null/code/referanceMap/index.js":{"path":"/home/null/code/referanceMap/index.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":47,"column":1}},"1":{"start":{"line":6,"column":4},"end":{"line":6,"column":18}},"2":{"start":{"line":16,"column":4},"end":{"line":16,"column":34}},"3":{"start":{"line":25,"column":16},"end":{"line":25,"column":30}},"4":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"5":{"start":{"line":27,"column":6},"end":{"line":27,"column":42}},"6":{"start":{"line":29,"column":4},"end":{"line":29,"column":14}},"7":{"start":{"line":38,"column":4},"end":{"line":38,"column":25}},"8":{"start":{"line":45,"column":4},"end":{"line":45,"column":18}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":2},"end":{"line":5,"column":3}},"loc":{"start":{"line":5,"column":17},"end":{"line":7,"column":3}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":2},"end":{"line":15,"column":3}},"loc":{"start":{"line":15,"column":12},"end":{"line":17,"column":3}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":24,"column":2},"end":{"line":24,"column":3}},"loc":{"start":{"line":24,"column":12},"end":{"line":30,"column":3}},"line":24},"3":{"name":"(anonymous_3)","decl":{"start":{"line":37,"column":2},"end":{"line":37,"column":3}},"loc":{"start":{"line":37,"column":15},"end":{"line":39,"column":3}},"line":37},"4":{"name":"(anonymous_4)","decl":{"start":{"line":44,"column":2},"end":{"line":44,"column":3}},"loc":{"start":{"line":44,"column":11},"end":{"line":46,"column":3}},"line":44}},"branchMap":{"0":{"loc":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},{"start":{"line":26,"column":4},"end":{"line":28,"column":5}}],"line":26}},"s":{"0":1,"1":1,"2":2,"3":4,"4":4,"5":2,"6":2,"7":1,"8":1},"f":{"0":1,"1":2,"2":4,"3":1,"4":1},"b":{"0":[2,2]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"63e451c69643727ab472b518c87c6bf161c889be"}} | ||
{"/home/null/code/referenceMap/index.js":{"path":"/home/null/code/referenceMap/index.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":55,"column":1}},"1":{"start":{"line":6,"column":4},"end":{"line":6,"column":18}},"2":{"start":{"line":16,"column":4},"end":{"line":16,"column":34}},"3":{"start":{"line":25,"column":16},"end":{"line":25,"column":30}},"4":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"5":{"start":{"line":27,"column":6},"end":{"line":27,"column":42}},"6":{"start":{"line":29,"column":4},"end":{"line":29,"column":14}},"7":{"start":{"line":38,"column":4},"end":{"line":38,"column":25}},"8":{"start":{"line":45,"column":4},"end":{"line":45,"column":18}},"9":{"start":{"line":53,"column":4},"end":{"line":53,"column":27}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":2},"end":{"line":5,"column":3}},"loc":{"start":{"line":5,"column":17},"end":{"line":7,"column":3}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":2},"end":{"line":15,"column":3}},"loc":{"start":{"line":15,"column":12},"end":{"line":17,"column":3}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":24,"column":2},"end":{"line":24,"column":3}},"loc":{"start":{"line":24,"column":12},"end":{"line":30,"column":3}},"line":24},"3":{"name":"(anonymous_3)","decl":{"start":{"line":37,"column":2},"end":{"line":37,"column":3}},"loc":{"start":{"line":37,"column":15},"end":{"line":39,"column":3}},"line":37},"4":{"name":"(anonymous_4)","decl":{"start":{"line":44,"column":2},"end":{"line":44,"column":3}},"loc":{"start":{"line":44,"column":11},"end":{"line":46,"column":3}},"line":44},"5":{"name":"(anonymous_5)","decl":{"start":{"line":52,"column":2},"end":{"line":52,"column":3}},"loc":{"start":{"line":52,"column":14},"end":{"line":54,"column":3}},"line":52}},"branchMap":{"0":{"loc":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},{"start":{"line":26,"column":4},"end":{"line":28,"column":5}}],"line":26}},"s":{"0":1,"1":1,"2":2,"3":4,"4":4,"5":2,"6":2,"7":1,"8":1,"9":1},"f":{"0":1,"1":2,"2":4,"3":1,"4":1,"5":1},"b":{"0":[2,2]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"501819713a08e964a8dd82a76a2836b39d1a9a97"}} |
@@ -47,2 +47,10 @@ module.exports = class ReferanceMap { | ||
} | ||
/** | ||
* returns the number of items in the refernace map | ||
* @return {integer} | ||
*/ | ||
get size () { | ||
return this._map.length | ||
} | ||
} |
{ | ||
"name": "reference-map", | ||
"version": "0.0.0", | ||
"version": "0.1.0", | ||
"description": "This is a simple determinstic map that maps POJOs to an integer", | ||
@@ -22,2 +22,9 @@ "main": "index.js", | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:wanderer/referenceMap.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/wanderer/referenceMap/issues" | ||
}, | ||
"devDependencies": { | ||
@@ -24,0 +31,0 @@ "coveralls": "^2.13.1", |
@@ -1,4 +0,4 @@ | ||
[![NPM Package](https://img.shields.io/npm/v/referanceMap.svg?style=flat-square)](https://www.npmjs.org/package/referanceMap) | ||
[![Build Status](https://img.shields.io/travis/wanderer/referanceMap.svg?branch=master&style=flat-square)](https://travis-ci.org/wanderer/referanceMap) | ||
[![Coverage Status](https://img.shields.io/coveralls/wanderer/referanceMap.svg?style=flat-square)](https://coveralls.io/wanderer/referanceMap) | ||
[![NPM Package](https://img.shields.io/npm/v/reference-map.svg?style=flat-square)](https://www.npmjs.org/package/reference-map) | ||
[![Build Status](https://img.shields.io/travis/wanderer/referenceMap.svg?branch=master&style=flat-square)](https://travis-ci.org/wanderer/referenceMap) | ||
[![Coverage Status](https://img.shields.io/coveralls/wanderer/referenceMap.svg?style=flat-square)](https://coveralls.io/wanderer/referenceMap) | ||
@@ -17,3 +17,3 @@ [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) | ||
[index.js:5-7](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L5-L7 "Source code on GitHub") | ||
[index.js:5-7](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L5-L7 "Source code on GitHub") | ||
@@ -24,3 +24,3 @@ Handle mapping arbitary JS object to ints | ||
[index.js:15-17](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L15-L17 "Source code on GitHub") | ||
[index.js:15-17](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L15-L17 "Source code on GitHub") | ||
@@ -38,3 +38,3 @@ Adds an object to the referance map returning an int to be used as a | ||
[index.js:24-30](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L24-L30 "Source code on GitHub") | ||
[index.js:24-30](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L24-L30 "Source code on GitHub") | ||
@@ -51,3 +51,3 @@ gets a POJO given a refernce as an int | ||
[index.js:37-39](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L37-L39 "Source code on GitHub") | ||
[index.js:37-39](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L37-L39 "Source code on GitHub") | ||
@@ -65,7 +65,15 @@ deletes an object given a referance as an int | ||
[index.js:44-46](https://github.com/wanderer/referanceMap/blob/59a99b6e465120b17057b03bebda1ea33087fb45/index.js#L44-L46 "Source code on GitHub") | ||
[index.js:44-46](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L44-L46 "Source code on GitHub") | ||
clears the referance map of a objects | ||
## size | ||
[index.js:52-54](https://github.com/wanderer/referanceMap/blob/31b26dc43440dd6bb683c2f0e63e413890f26274/index.js#L52-L54 "Source code on GitHub") | ||
returns the number of items in the refernace map | ||
Returns **integer** | ||
# LICENSE | ||
[MPL-2.0](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)) |
@@ -5,3 +5,3 @@ const tape = require('tape') | ||
tape('referance mapping', t => { | ||
t.plan(6) | ||
t.plan(7) | ||
const referanceMap = new ReferanceMap() | ||
@@ -21,2 +21,4 @@ const obj1 = {} | ||
t.equals(referanceMap.size, 2, 'should return the correct size') | ||
referanceMap.delete(ref1) | ||
@@ -23,0 +25,0 @@ try { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
48180
494
75
0