1.0.0 • Published 7 years ago
poly-count v1.0.0
poly-count
Universal data counter
Motivation
- To correct JS behaviour when strings are treated as lists of characters rather than single pieces of data when it comes to length calculation.
- To allow counting items in point-free style expressions.
Features
- Works with any type of data
Installation
npm install poly-count
Testing
npm test
Usage
var count = require('poly-count');
console.log(count(['a', 'c'])); // => 2
console.log(count({ a: 100, b: 500 })); // => 2
console.log(count(100500)); // => 1
console.log(count('100500')); // => 1
1.0.0
7 years ago