lodash.istypedarray
Advanced tools
Comparing version 3.0.2 to 3.0.3
84
index.js
/** | ||
* lodash 3.0.2 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
* lodash 3.0.3 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
*/ | ||
/** Used as references for various `Number` constants. */ | ||
var MAX_SAFE_INTEGER = 9007199254740991; | ||
/** `Object#toString` result references. */ | ||
@@ -51,36 +54,34 @@ var argsTag = '[object Arguments]', | ||
/** | ||
* Checks if `value` is object-like. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** Used for built-in method references. */ | ||
var objectProto = global.Object.prototype; | ||
/** Used for native method references. */ | ||
var objectProto = Object.prototype; | ||
/** | ||
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) | ||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objToString = objectProto.toString; | ||
var objectToString = objectProto.toString; | ||
/** | ||
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) | ||
* of an array-like value. | ||
*/ | ||
var MAX_SAFE_INTEGER = 9007199254740991; | ||
/** | ||
* Checks if `value` is a valid array-like length. | ||
* | ||
* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). | ||
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
* | ||
* @private | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | ||
* @example | ||
* | ||
* _.isLength(3); | ||
* // => true | ||
* | ||
* _.isLength(Number.MIN_VALUE); | ||
* // => false | ||
* | ||
* _.isLength(Infinity); | ||
* // => false | ||
* | ||
* _.isLength('3'); | ||
* // => false | ||
*/ | ||
@@ -92,2 +93,29 @@ function isLength(value) { | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is classified as a typed array. | ||
@@ -109,5 +137,5 @@ * | ||
function isTypedArray(value) { | ||
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; | ||
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; | ||
} | ||
module.exports = isTypedArray; |
{ | ||
"name": "lodash.istypedarray", | ||
"version": "3.0.2", | ||
"description": "The modern build of lodash’s `_.isTypedArray` as a module.", | ||
"version": "3.0.3", | ||
"description": "The lodash method `_.isTypedArray` exported as a module.", | ||
"homepage": "https://lodash.com/", | ||
"icon": "https://lodash.com/icon.svg", | ||
"license": "MIT", | ||
"keywords": "lodash, lodash-modularized, stdlib, util", | ||
"keywords": "lodash, lodash-modularized, stdlib, util, istypedarray", | ||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"contributors": [ | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)", | ||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -16,0 +14,0 @@ ], |
@@ -1,4 +0,4 @@ | ||
# lodash.istypedarray v3.0.2 | ||
# lodash.istypedarray v3.0.3 | ||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isTypedArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
The [lodash](https://lodash.com/) method `_.isTypedArray` exported as a [Node.js](https://nodejs.org/) module. | ||
@@ -8,3 +8,2 @@ ## Installation | ||
Using npm: | ||
```bash | ||
@@ -15,4 +14,3 @@ $ {sudo -H} npm i -g npm | ||
In Node.js/io.js: | ||
In Node.js: | ||
```js | ||
@@ -22,2 +20,2 @@ var isTypedArray = require('lodash.istypedarray'); | ||
See the [documentation](https://lodash.com/docs#isTypedArray) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.istypedarray) for more details. | ||
See the [documentation](https://lodash.com/docs#isTypedArray) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.istypedarray) for more details. |
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
6631
128
19