Universal data counter
- 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.
- Works with any type of data
npm install poly-count
npm test
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