Initial commit
This commit is contained in:
21
node_modules/map-cache/LICENSE
generated
vendored
Normal file
21
node_modules/map-cache/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2016, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
100
node_modules/map-cache/index.js
generated
vendored
Normal file
100
node_modules/map-cache/index.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
/*!
|
||||
* map-cache <https://github.com/jonschlinkert/map-cache>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Expose `MapCache`
|
||||
*/
|
||||
|
||||
module.exports = MapCache;
|
||||
|
||||
/**
|
||||
* Creates a cache object to store key/value pairs.
|
||||
*
|
||||
* ```js
|
||||
* var cache = new MapCache();
|
||||
* ```
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function MapCache(data) {
|
||||
this.__data__ = data || {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds `value` to `key` on the cache.
|
||||
*
|
||||
* ```js
|
||||
* cache.set('foo', 'bar');
|
||||
* ```
|
||||
*
|
||||
* @param {String} `key` The key of the value to cache.
|
||||
* @param {*} `value` The value to cache.
|
||||
* @returns {Object} Returns the `Cache` object for chaining.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
MapCache.prototype.set = function mapSet(key, value) {
|
||||
if (key !== '__proto__') {
|
||||
this.__data__[key] = value;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the cached value for `key`.
|
||||
*
|
||||
* ```js
|
||||
* cache.get('foo');
|
||||
* //=> 'bar'
|
||||
* ```
|
||||
*
|
||||
* @param {String} `key` The key of the value to get.
|
||||
* @returns {*} Returns the cached value.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
MapCache.prototype.get = function mapGet(key) {
|
||||
return key === '__proto__' ? undefined : this.__data__[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if a cached value for `key` exists.
|
||||
*
|
||||
* ```js
|
||||
* cache.has('foo');
|
||||
* //=> true
|
||||
* ```
|
||||
*
|
||||
* @param {String} `key` The key of the entry to check.
|
||||
* @returns {Boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
MapCache.prototype.has = function mapHas(key) {
|
||||
return key !== '__proto__' && hasOwn.call(this.__data__, key);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the cache.
|
||||
*
|
||||
* ```js
|
||||
* cache.del('foo');
|
||||
* ```
|
||||
* @title .del
|
||||
* @param {String} `key` The key of the value to remove.
|
||||
* @returns {Boolean} Returns `true` if the entry was removed successfully, else `false`.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
MapCache.prototype.del = function mapDelete(key) {
|
||||
return this.has(key) && delete this.__data__[key];
|
||||
};
|
||||
44
node_modules/map-cache/package.json
generated
vendored
Normal file
44
node_modules/map-cache/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "map-cache",
|
||||
"description": "Basic cache object for storing key-value pairs.",
|
||||
"version": "0.2.2",
|
||||
"homepage": "https://github.com/jonschlinkert/map-cache",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/map-cache",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^0.1.9",
|
||||
"should": "^8.3.1"
|
||||
},
|
||||
"verb": {
|
||||
"run": true,
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"config-cache",
|
||||
"option-cache",
|
||||
"cache-base"
|
||||
]
|
||||
},
|
||||
"reflinks": [
|
||||
"verb"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user