any-size
Advanced tools
Comparing version 1.0.2 to 1.1.0
12
index.js
@@ -11,2 +11,6 @@ "use strict" | ||
if (is.string(input)) { | ||
return stringLength(input) | ||
} | ||
if (is.arrayLike(input)) { | ||
@@ -16,6 +20,2 @@ return input.length | ||
if (is.string(input)) { | ||
return stringLength(input) | ||
} | ||
if (is.number(input)) { | ||
@@ -29,3 +29,7 @@ return input.toString().length | ||
if (is.arrayBuffer(input)) { | ||
return input.byteLength | ||
} | ||
return 0 | ||
} |
{ | ||
"name": "any-size", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Get the size of any type of value.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/Richienb/any-size.git", |
# Any Size [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/any-size/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/any-size) | ||
Get the size of a value. Supports objects, array-like objects, strings (with ansi stripping and unicode character recognition), numbers, maps and sets. | ||
Get the size of a value. Supports objects, array-like values, strings (with ansi stripping and unicode character recognition), numbers, maps, sets and array buffers. | ||
@@ -5,0 +5,0 @@ [![NPM Badge](https://nodei.co/npm/any-size.png)](https://npmjs.com/package/any-size) |
3440
40