standaardisation updates
This commit is contained in:
22
convert/lodash/lodash._basecreatecallback/LICENSE.txt
Normal file
22
convert/lodash/lodash._basecreatecallback/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
Based on Underscore.js 1.5.2, copyright 2009-2013 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.
|
||||
15
convert/lodash/lodash._basecreatecallback/README.md
Normal file
15
convert/lodash/lodash._basecreatecallback/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# lodash._basecreatecallback v2.3.0
|
||||
|
||||
The internal [Lo-Dash](http://lodash.com/) function `baseCreateCallback` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||
|
||||
## Author
|
||||
|
||||
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||
|---|
|
||||
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||
|
||||
## Contributors
|
||||
|
||||
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|---|---|
|
||||
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||
80
convert/lodash/lodash._basecreatecallback/index.js
Normal file
80
convert/lodash/lodash._basecreatecallback/index.js
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* Available under MIT license <http://lodash.com/license>
|
||||
*/
|
||||
var bind = require('./../lodash.bind'),
|
||||
identity = require('./../lodash.identity'),
|
||||
setBindData = require('./../lodash._setbinddata'),
|
||||
support = require('./../lodash.support');
|
||||
|
||||
/** Used to detected named functions */
|
||||
var reFuncName = /^\s*function[ \n\r\t]+\w/;
|
||||
|
||||
/** Used to detect functions containing a `this` reference */
|
||||
var reThis = /\bthis\b/;
|
||||
|
||||
/** Native method shortcuts */
|
||||
var fnToString = Function.prototype.toString;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.createCallback` without support for creating
|
||||
* "_.pluck" or "_.where" style callbacks.
|
||||
*
|
||||
* @private
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
*/
|
||||
function baseCreateCallback(func, thisArg, argCount) {
|
||||
if (typeof func != 'function') {
|
||||
return identity;
|
||||
}
|
||||
// exit early for no `thisArg` or already bound by `Function#bind`
|
||||
if (typeof thisArg == 'undefined' || !('prototype' in func)) {
|
||||
return func;
|
||||
}
|
||||
var bindData = func.__bindData__;
|
||||
if (typeof bindData == 'undefined') {
|
||||
if (support.funcNames) {
|
||||
bindData = !func.name;
|
||||
}
|
||||
bindData = bindData || !support.funcDecomp;
|
||||
if (!bindData) {
|
||||
var source = fnToString.call(func);
|
||||
if (!support.funcNames) {
|
||||
bindData = !reFuncName.test(source);
|
||||
}
|
||||
if (!bindData) {
|
||||
// checks if `func` references the `this` keyword and stores the result
|
||||
bindData = reThis.test(source);
|
||||
setBindData(func, bindData);
|
||||
}
|
||||
}
|
||||
}
|
||||
// exit early if there are no `this` references or `func` is bound
|
||||
if (bindData === false || (bindData !== true && bindData[1] & 1)) {
|
||||
return func;
|
||||
}
|
||||
switch (argCount) {
|
||||
case 1: return function(value) {
|
||||
return func.call(thisArg, value);
|
||||
};
|
||||
case 2: return function(a, b) {
|
||||
return func.call(thisArg, a, b);
|
||||
};
|
||||
case 3: return function(value, index, collection) {
|
||||
return func.call(thisArg, value, index, collection);
|
||||
};
|
||||
case 4: return function(accumulator, value, index, collection) {
|
||||
return func.call(thisArg, accumulator, value, index, collection);
|
||||
};
|
||||
}
|
||||
return bind(func, thisArg);
|
||||
}
|
||||
|
||||
module.exports = baseCreateCallback;
|
||||
22
convert/lodash/lodash._basecreatecallback/package.json
Normal file
22
convert/lodash/lodash._basecreatecallback/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "lodash._basecreatecallback",
|
||||
"version": "2.3.0",
|
||||
"description": "The internal Lo-Dash function `baseCreateCallback` as a Node.js module generated by lodash-cli.",
|
||||
"homepage": "http://lodash.com/custom-builds",
|
||||
"license": "MIT",
|
||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"contributors": [
|
||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||
],
|
||||
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||
"dependencies": {
|
||||
"lodash.bind": "~2.3.0",
|
||||
"lodash.identity": "~2.3.0",
|
||||
"lodash._setbinddata": "~2.3.0",
|
||||
"lodash.support": "~2.3.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user