diff options
author | Rebecca Turner <me@re-becca.org> | 2015-02-19 13:44:47 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-06-26 03:26:40 +0300 |
commit | 2d7da63bfd94e52c7ffc4d418074a6c9d20e18f3 (patch) | |
tree | 4df6dde5287d28d06670fd3b6baf708968ad2966 /node_modules/lodash._createcache | |
parent | 401540b4190a5ade00b4d6e55448bc1ad407a2be (diff) |
lodash.without@3.2.1
Diffstat (limited to 'node_modules/lodash._createcache')
-rw-r--r-- | node_modules/lodash._createcache/LICENSE.txt | 22 | ||||
-rw-r--r-- | node_modules/lodash._createcache/README.md | 20 | ||||
-rw-r--r-- | node_modules/lodash._createcache/index.js | 113 | ||||
-rw-r--r-- | node_modules/lodash._createcache/package.json | 91 |
4 files changed, 246 insertions, 0 deletions
diff --git a/node_modules/lodash._createcache/LICENSE.txt b/node_modules/lodash._createcache/LICENSE.txt new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/node_modules/lodash._createcache/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/lodash._createcache/README.md b/node_modules/lodash._createcache/README.md new file mode 100644 index 000000000..4c13df646 --- /dev/null +++ b/node_modules/lodash._createcache/README.md @@ -0,0 +1,20 @@ +# lodash._createcache v3.1.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._createcache +``` + +In Node.js/io.js: + +```js +var createCache = require('lodash._createcache'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash._createcache) for more details. diff --git a/node_modules/lodash._createcache/index.js b/node_modules/lodash._createcache/index.js new file mode 100644 index 000000000..f1a433cca --- /dev/null +++ b/node_modules/lodash._createcache/index.js @@ -0,0 +1,113 @@ +/** + * lodash 3.1.1 (Custom Build) <https://lodash.com/> + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 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 + * Available under MIT license <https://lodash.com/license> + */ +var getNative = require('lodash._getnative'); + +/** Native method references. */ +var Set = getNative(global, 'Set'); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeCreate = getNative(Object, 'create'); + +/** + * + * Creates a cache object to store unique values. + * + * @private + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var length = values ? values.length : 0; + + this.data = { 'hash': nativeCreate(null), 'set': new Set }; + while (length--) { + this.push(values[length]); + } +} + +/** + * Adds `value` to the cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ +function cachePush(value) { + var data = this.data; + if (typeof value == 'string' || isObject(value)) { + data.set.add(value); + } else { + data.hash[value] = true; + } +} + +/** + * Creates a `Set` cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [values] The values to cache. + * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. + */ +var createCache = !(nativeCreate && Set) ? constant(null) : function(values) { + return new SetCache(values); +}; + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'user': 'fred' }; + * var getter = _.constant(object); + * + * getter() === object; + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +// Add functions to the `Set` cache. +SetCache.prototype.push = cachePush; + +module.exports = createCache; diff --git a/node_modules/lodash._createcache/package.json b/node_modules/lodash._createcache/package.json new file mode 100644 index 000000000..87282e760 --- /dev/null +++ b/node_modules/lodash._createcache/package.json @@ -0,0 +1,91 @@ +{ + "name": "lodash._createcache", + "version": "3.1.1", + "description": "The modern build of lodash’s internal `createCache` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._getnative": "^3.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._createcache@3.1.1", + "_shasum": "83c2e486cef63033b3764fb50910157726487c45", + "_from": "lodash._createcache@3.1.1", + "_npmVersion": "2.9.0", + "_nodeVersion": "2.0.2", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + } + ], + "dist": { + "shasum": "83c2e486cef63033b3764fb50910157726487c45", + "tarball": "http://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.1.tgz", + "readme": "ERROR: No README data found!" +} |