Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 4605a44b

Přidáno uživatelem Jan Čarnogurský před téměř 4 roky(ů)

re #8149 - odstranění šablon 2 část

Zobrazit rozdíly:

templetes/node_modules/core-js/library/modules/_ctx.js
1
// optional / simple context binding
2
var aFunction = require('./_a-function');
3
module.exports = function (fn, that, length) {
4
  aFunction(fn);
5
  if (that === undefined) return fn;
6
  switch (length) {
7
    case 1: return function (a) {
8
      return fn.call(that, a);
9
    };
10
    case 2: return function (a, b) {
11
      return fn.call(that, a, b);
12
    };
13
    case 3: return function (a, b, c) {
14
      return fn.call(that, a, b, c);
15
    };
16
  }
17
  return function (/* ...args */) {
18
    return fn.apply(that, arguments);
19
  };
20
};
templetes/node_modules/core-js/modules/_ctx.js
1
// optional / simple context binding
2
var aFunction = require('./_a-function');
3
module.exports = function (fn, that, length) {
4
  aFunction(fn);
5
  if (that === undefined) return fn;
6
  switch (length) {
7
    case 1: return function (a) {
8
      return fn.call(that, a);
9
    };
10
    case 2: return function (a, b) {
11
      return fn.call(that, a, b);
12
    };
13
    case 3: return function (a, b, c) {
14
      return fn.call(that, a, b, c);
15
    };
16
  }
17
  return function (/* ...args */) {
18
    return fn.apply(that, arguments);
19
  };
20
};
templetes/node_modules/lodash/_createCurry.js
1
var apply = require('./_apply'),
2
    createCtor = require('./_createCtor'),
3
    createHybrid = require('./_createHybrid'),
4
    createRecurry = require('./_createRecurry'),
5
    getHolder = require('./_getHolder'),
6
    replaceHolders = require('./_replaceHolders'),
7
    root = require('./_root');
8

  
9
/**
10
 * Creates a function that wraps `func` to enable currying.
11
 *
12
 * @private
13
 * @param {Function} func The function to wrap.
14
 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
15
 * @param {number} arity The arity of `func`.
16
 * @returns {Function} Returns the new wrapped function.
17
 */
18
function createCurry(func, bitmask, arity) {
19
  var Ctor = createCtor(func);
20

  
21
  function wrapper() {
22
    var length = arguments.length,
23
        args = Array(length),
24
        index = length,
25
        placeholder = getHolder(wrapper);
26

  
27
    while (index--) {
28
      args[index] = arguments[index];
29
    }
30
    var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
31
      ? []
32
      : replaceHolders(args, placeholder);
33

  
34
    length -= holders.length;
35
    if (length < arity) {
36
      return createRecurry(
37
        func, bitmask, createHybrid, wrapper.placeholder, undefined,
38
        args, holders, undefined, undefined, arity - length);
39
    }
40
    var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
41
    return apply(fn, this, args);
42
  }
43
  return wrapper;
44
}
45

  
46
module.exports = createCurry;
templetes/node_modules/lodash/_createFind.js
1
var baseIteratee = require('./_baseIteratee'),
2
    isArrayLike = require('./isArrayLike'),
3
    keys = require('./keys');
4

  
5
/**
6
 * Creates a `_.find` or `_.findLast` function.
7
 *
8
 * @private
9
 * @param {Function} findIndexFunc The function to find the collection index.
10
 * @returns {Function} Returns the new find function.
11
 */
12
function createFind(findIndexFunc) {
13
  return function(collection, predicate, fromIndex) {
14
    var iterable = Object(collection);
15
    if (!isArrayLike(collection)) {
16
      var iteratee = baseIteratee(predicate, 3);
17
      collection = keys(collection);
18
      predicate = function(key) { return iteratee(iterable[key], key, iterable); };
19
    }
20
    var index = findIndexFunc(collection, predicate, fromIndex);
21
    return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
22
  };
23
}
24

  
25
module.exports = createFind;
templetes/node_modules/lodash/_createFlow.js
1
var LodashWrapper = require('./_LodashWrapper'),
2
    flatRest = require('./_flatRest'),
3
    getData = require('./_getData'),
4
    getFuncName = require('./_getFuncName'),
5
    isArray = require('./isArray'),
6
    isLaziable = require('./_isLaziable');
7

  
8
/** Error message constants. */
9
var FUNC_ERROR_TEXT = 'Expected a function';
10

  
11
/** Used to compose bitmasks for function metadata. */
12
var WRAP_CURRY_FLAG = 8,
13
    WRAP_PARTIAL_FLAG = 32,
14
    WRAP_ARY_FLAG = 128,
15
    WRAP_REARG_FLAG = 256;
16

  
17
/**
18
 * Creates a `_.flow` or `_.flowRight` function.
19
 *
20
 * @private
21
 * @param {boolean} [fromRight] Specify iterating from right to left.
22
 * @returns {Function} Returns the new flow function.
23
 */
24
function createFlow(fromRight) {
25
  return flatRest(function(funcs) {
26
    var length = funcs.length,
27
        index = length,
28
        prereq = LodashWrapper.prototype.thru;
29

  
30
    if (fromRight) {
31
      funcs.reverse();
32
    }
33
    while (index--) {
34
      var func = funcs[index];
35
      if (typeof func != 'function') {
36
        throw new TypeError(FUNC_ERROR_TEXT);
37
      }
38
      if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
39
        var wrapper = new LodashWrapper([], true);
40
      }
41
    }
42
    index = wrapper ? index : length;
43
    while (++index < length) {
44
      func = funcs[index];
45

  
46
      var funcName = getFuncName(func),
47
          data = funcName == 'wrapper' ? getData(func) : undefined;
48

  
49
      if (data && isLaziable(data[0]) &&
50
            data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
51
            !data[4].length && data[9] == 1
52
          ) {
53
        wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
54
      } else {
55
        wrapper = (func.length == 1 && isLaziable(func))
56
          ? wrapper[funcName]()
57
          : wrapper.thru(func);
58
      }
59
    }
60
    return function() {
61
      var args = arguments,
62
          value = args[0];
63

  
64
      if (wrapper && args.length == 1 && isArray(value)) {
65
        return wrapper.plant(value).value();
66
      }
67
      var index = 0,
68
          result = length ? funcs[index].apply(this, args) : value;
69

  
70
      while (++index < length) {
71
        result = funcs[index].call(this, result);
72
      }
73
      return result;
74
    };
75
  });
76
}
77

  
78
module.exports = createFlow;
templetes/node_modules/lodash/_createHybrid.js
1
var composeArgs = require('./_composeArgs'),
2
    composeArgsRight = require('./_composeArgsRight'),
3
    countHolders = require('./_countHolders'),
4
    createCtor = require('./_createCtor'),
5
    createRecurry = require('./_createRecurry'),
6
    getHolder = require('./_getHolder'),
7
    reorder = require('./_reorder'),
8
    replaceHolders = require('./_replaceHolders'),
9
    root = require('./_root');
10

  
11
/** Used to compose bitmasks for function metadata. */
12
var WRAP_BIND_FLAG = 1,
13
    WRAP_BIND_KEY_FLAG = 2,
14
    WRAP_CURRY_FLAG = 8,
15
    WRAP_CURRY_RIGHT_FLAG = 16,
16
    WRAP_ARY_FLAG = 128,
17
    WRAP_FLIP_FLAG = 512;
18

  
19
/**
20
 * Creates a function that wraps `func` to invoke it with optional `this`
21
 * binding of `thisArg`, partial application, and currying.
22
 *
23
 * @private
24
 * @param {Function|string} func The function or method name to wrap.
25
 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
26
 * @param {*} [thisArg] The `this` binding of `func`.
27
 * @param {Array} [partials] The arguments to prepend to those provided to
28
 *  the new function.
29
 * @param {Array} [holders] The `partials` placeholder indexes.
30
 * @param {Array} [partialsRight] The arguments to append to those provided
31
 *  to the new function.
32
 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
33
 * @param {Array} [argPos] The argument positions of the new function.
34
 * @param {number} [ary] The arity cap of `func`.
35
 * @param {number} [arity] The arity of `func`.
36
 * @returns {Function} Returns the new wrapped function.
37
 */
38
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
39
  var isAry = bitmask & WRAP_ARY_FLAG,
40
      isBind = bitmask & WRAP_BIND_FLAG,
41
      isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
42
      isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
43
      isFlip = bitmask & WRAP_FLIP_FLAG,
44
      Ctor = isBindKey ? undefined : createCtor(func);
45

  
46
  function wrapper() {
47
    var length = arguments.length,
48
        args = Array(length),
49
        index = length;
50

  
51
    while (index--) {
52
      args[index] = arguments[index];
53
    }
54
    if (isCurried) {
55
      var placeholder = getHolder(wrapper),
56
          holdersCount = countHolders(args, placeholder);
57
    }
58
    if (partials) {
59
      args = composeArgs(args, partials, holders, isCurried);
60
    }
61
    if (partialsRight) {
62
      args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
63
    }
64
    length -= holdersCount;
65
    if (isCurried && length < arity) {
66
      var newHolders = replaceHolders(args, placeholder);
67
      return createRecurry(
68
        func, bitmask, createHybrid, wrapper.placeholder, thisArg,
69
        args, newHolders, argPos, ary, arity - length
70
      );
71
    }
72
    var thisBinding = isBind ? thisArg : this,
73
        fn = isBindKey ? thisBinding[func] : func;
74

  
75
    length = args.length;
76
    if (argPos) {
77
      args = reorder(args, argPos);
78
    } else if (isFlip && length > 1) {
79
      args.reverse();
80
    }
81
    if (isAry && ary < length) {
82
      args.length = ary;
83
    }
84
    if (this && this !== root && this instanceof wrapper) {
85
      fn = Ctor || createCtor(fn);
86
    }
87
    return fn.apply(thisBinding, args);
88
  }
89
  return wrapper;
90
}
91

  
92
module.exports = createHybrid;
templetes/node_modules/lodash/_createInverter.js
1
var baseInverter = require('./_baseInverter');
2

  
3
/**
4
 * Creates a function like `_.invertBy`.
5
 *
6
 * @private
7
 * @param {Function} setter The function to set accumulator values.
8
 * @param {Function} toIteratee The function to resolve iteratees.
9
 * @returns {Function} Returns the new inverter function.
10
 */
11
function createInverter(setter, toIteratee) {
12
  return function(object, iteratee) {
13
    return baseInverter(object, setter, toIteratee(iteratee), {});
14
  };
15
}
16

  
17
module.exports = createInverter;
templetes/node_modules/lodash/_createMathOperation.js
1
var baseToNumber = require('./_baseToNumber'),
2
    baseToString = require('./_baseToString');
3

  
4
/**
5
 * Creates a function that performs a mathematical operation on two values.
6
 *
7
 * @private
8
 * @param {Function} operator The function to perform the operation.
9
 * @param {number} [defaultValue] The value used for `undefined` arguments.
10
 * @returns {Function} Returns the new mathematical operation function.
11
 */
12
function createMathOperation(operator, defaultValue) {
13
  return function(value, other) {
14
    var result;
15
    if (value === undefined && other === undefined) {
16
      return defaultValue;
17
    }
18
    if (value !== undefined) {
19
      result = value;
20
    }
21
    if (other !== undefined) {
22
      if (result === undefined) {
23
        return other;
24
      }
25
      if (typeof value == 'string' || typeof other == 'string') {
26
        value = baseToString(value);
27
        other = baseToString(other);
28
      } else {
29
        value = baseToNumber(value);
30
        other = baseToNumber(other);
31
      }
32
      result = operator(value, other);
33
    }
34
    return result;
35
  };
36
}
37

  
38
module.exports = createMathOperation;
templetes/node_modules/lodash/_createOver.js
1
var apply = require('./_apply'),
2
    arrayMap = require('./_arrayMap'),
3
    baseIteratee = require('./_baseIteratee'),
4
    baseRest = require('./_baseRest'),
5
    baseUnary = require('./_baseUnary'),
6
    flatRest = require('./_flatRest');
7

  
8
/**
9
 * Creates a function like `_.over`.
10
 *
11
 * @private
12
 * @param {Function} arrayFunc The function to iterate over iteratees.
13
 * @returns {Function} Returns the new over function.
14
 */
15
function createOver(arrayFunc) {
16
  return flatRest(function(iteratees) {
17
    iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
18
    return baseRest(function(args) {
19
      var thisArg = this;
20
      return arrayFunc(iteratees, function(iteratee) {
21
        return apply(iteratee, thisArg, args);
22
      });
23
    });
24
  });
25
}
26

  
27
module.exports = createOver;
templetes/node_modules/lodash/_createPadding.js
1
var baseRepeat = require('./_baseRepeat'),
2
    baseToString = require('./_baseToString'),
3
    castSlice = require('./_castSlice'),
4
    hasUnicode = require('./_hasUnicode'),
5
    stringSize = require('./_stringSize'),
6
    stringToArray = require('./_stringToArray');
7

  
8
/* Built-in method references for those with the same name as other `lodash` methods. */
9
var nativeCeil = Math.ceil;
10

  
11
/**
12
 * Creates the padding for `string` based on `length`. The `chars` string
13
 * is truncated if the number of characters exceeds `length`.
14
 *
15
 * @private
16
 * @param {number} length The padding length.
17
 * @param {string} [chars=' '] The string used as padding.
18
 * @returns {string} Returns the padding for `string`.
19
 */
20
function createPadding(length, chars) {
21
  chars = chars === undefined ? ' ' : baseToString(chars);
22

  
23
  var charsLength = chars.length;
24
  if (charsLength < 2) {
25
    return charsLength ? baseRepeat(chars, length) : chars;
26
  }
27
  var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
28
  return hasUnicode(chars)
29
    ? castSlice(stringToArray(result), 0, length).join('')
30
    : result.slice(0, length);
31
}
32

  
33
module.exports = createPadding;
templetes/node_modules/lodash/_createPartial.js
1
var apply = require('./_apply'),
2
    createCtor = require('./_createCtor'),
3
    root = require('./_root');
4

  
5
/** Used to compose bitmasks for function metadata. */
6
var WRAP_BIND_FLAG = 1;
7

  
8
/**
9
 * Creates a function that wraps `func` to invoke it with the `this` binding
10
 * of `thisArg` and `partials` prepended to the arguments it receives.
11
 *
12
 * @private
13
 * @param {Function} func The function to wrap.
14
 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
15
 * @param {*} thisArg The `this` binding of `func`.
16
 * @param {Array} partials The arguments to prepend to those provided to
17
 *  the new function.
18
 * @returns {Function} Returns the new wrapped function.
19
 */
20
function createPartial(func, bitmask, thisArg, partials) {
21
  var isBind = bitmask & WRAP_BIND_FLAG,
22
      Ctor = createCtor(func);
23

  
24
  function wrapper() {
25
    var argsIndex = -1,
26
        argsLength = arguments.length,
27
        leftIndex = -1,
28
        leftLength = partials.length,
29
        args = Array(leftLength + argsLength),
30
        fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
31

  
32
    while (++leftIndex < leftLength) {
33
      args[leftIndex] = partials[leftIndex];
34
    }
35
    while (argsLength--) {
36
      args[leftIndex++] = arguments[++argsIndex];
37
    }
38
    return apply(fn, isBind ? thisArg : this, args);
39
  }
40
  return wrapper;
41
}
42

  
43
module.exports = createPartial;
templetes/node_modules/lodash/_createRange.js
1
var baseRange = require('./_baseRange'),
2
    isIterateeCall = require('./_isIterateeCall'),
3
    toFinite = require('./toFinite');
4

  
5
/**
6
 * Creates a `_.range` or `_.rangeRight` function.
7
 *
8
 * @private
9
 * @param {boolean} [fromRight] Specify iterating from right to left.
10
 * @returns {Function} Returns the new range function.
11
 */
12
function createRange(fromRight) {
13
  return function(start, end, step) {
14
    if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
15
      end = step = undefined;
16
    }
17
    // Ensure the sign of `-0` is preserved.
18
    start = toFinite(start);
19
    if (end === undefined) {
20
      end = start;
21
      start = 0;
22
    } else {
23
      end = toFinite(end);
24
    }
25
    step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
26
    return baseRange(start, end, step, fromRight);
27
  };
28
}
29

  
30
module.exports = createRange;
templetes/node_modules/lodash/_createRecurry.js
1
var isLaziable = require('./_isLaziable'),
2
    setData = require('./_setData'),
3
    setWrapToString = require('./_setWrapToString');
4

  
5
/** Used to compose bitmasks for function metadata. */
6
var WRAP_BIND_FLAG = 1,
7
    WRAP_BIND_KEY_FLAG = 2,
8
    WRAP_CURRY_BOUND_FLAG = 4,
9
    WRAP_CURRY_FLAG = 8,
10
    WRAP_PARTIAL_FLAG = 32,
11
    WRAP_PARTIAL_RIGHT_FLAG = 64;
12

  
13
/**
14
 * Creates a function that wraps `func` to continue currying.
15
 *
16
 * @private
17
 * @param {Function} func The function to wrap.
18
 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
19
 * @param {Function} wrapFunc The function to create the `func` wrapper.
20
 * @param {*} placeholder The placeholder value.
21
 * @param {*} [thisArg] The `this` binding of `func`.
22
 * @param {Array} [partials] The arguments to prepend to those provided to
23
 *  the new function.
24
 * @param {Array} [holders] The `partials` placeholder indexes.
25
 * @param {Array} [argPos] The argument positions of the new function.
26
 * @param {number} [ary] The arity cap of `func`.
27
 * @param {number} [arity] The arity of `func`.
28
 * @returns {Function} Returns the new wrapped function.
29
 */
30
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
31
  var isCurry = bitmask & WRAP_CURRY_FLAG,
32
      newHolders = isCurry ? holders : undefined,
33
      newHoldersRight = isCurry ? undefined : holders,
34
      newPartials = isCurry ? partials : undefined,
35
      newPartialsRight = isCurry ? undefined : partials;
36

  
37
  bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
38
  bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
39

  
40
  if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
41
    bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
42
  }
43
  var newData = [
44
    func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
45
    newHoldersRight, argPos, ary, arity
46
  ];
47

  
48
  var result = wrapFunc.apply(undefined, newData);
49
  if (isLaziable(func)) {
50
    setData(result, newData);
51
  }
52
  result.placeholder = placeholder;
53
  return setWrapToString(result, func, bitmask);
54
}
55

  
56
module.exports = createRecurry;
templetes/node_modules/lodash/_createRelationalOperation.js
1
var toNumber = require('./toNumber');
2

  
3
/**
4
 * Creates a function that performs a relational operation on two values.
5
 *
6
 * @private
7
 * @param {Function} operator The function to perform the operation.
8
 * @returns {Function} Returns the new relational operation function.
9
 */
10
function createRelationalOperation(operator) {
11
  return function(value, other) {
12
    if (!(typeof value == 'string' && typeof other == 'string')) {
13
      value = toNumber(value);
14
      other = toNumber(other);
15
    }
16
    return operator(value, other);
17
  };
18
}
19

  
20
module.exports = createRelationalOperation;
templetes/node_modules/lodash/_createRound.js
1
var root = require('./_root'),
2
    toInteger = require('./toInteger'),
3
    toNumber = require('./toNumber'),
4
    toString = require('./toString');
5

  
6
/* Built-in method references for those with the same name as other `lodash` methods. */
7
var nativeIsFinite = root.isFinite,
8
    nativeMin = Math.min;
9

  
10
/**
11
 * Creates a function like `_.round`.
12
 *
13
 * @private
14
 * @param {string} methodName The name of the `Math` method to use when rounding.
15
 * @returns {Function} Returns the new round function.
16
 */
17
function createRound(methodName) {
18
  var func = Math[methodName];
19
  return function(number, precision) {
20
    number = toNumber(number);
21
    precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
22
    if (precision && nativeIsFinite(number)) {
23
      // Shift with exponential notation to avoid floating-point issues.
24
      // See [MDN](https://mdn.io/round#Examples) for more details.
25
      var pair = (toString(number) + 'e').split('e'),
26
          value = func(pair[0] + 'e' + (+pair[1] + precision));
27

  
28
      pair = (toString(value) + 'e').split('e');
29
      return +(pair[0] + 'e' + (+pair[1] - precision));
30
    }
31
    return func(number);
32
  };
33
}
34

  
35
module.exports = createRound;
templetes/node_modules/lodash/_createSet.js
1
var Set = require('./_Set'),
2
    noop = require('./noop'),
3
    setToArray = require('./_setToArray');
4

  
5
/** Used as references for various `Number` constants. */
6
var INFINITY = 1 / 0;
7

  
8
/**
9
 * Creates a set object of `values`.
10
 *
11
 * @private
12
 * @param {Array} values The values to add to the set.
13
 * @returns {Object} Returns the new set.
14
 */
15
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
16
  return new Set(values);
17
};
18

  
19
module.exports = createSet;
templetes/node_modules/lodash/_createToPairs.js
1
var baseToPairs = require('./_baseToPairs'),
2
    getTag = require('./_getTag'),
3
    mapToArray = require('./_mapToArray'),
4
    setToPairs = require('./_setToPairs');
5

  
6
/** `Object#toString` result references. */
7
var mapTag = '[object Map]',
8
    setTag = '[object Set]';
9

  
10
/**
11
 * Creates a `_.toPairs` or `_.toPairsIn` function.
12
 *
13
 * @private
14
 * @param {Function} keysFunc The function to get the keys of a given object.
15
 * @returns {Function} Returns the new pairs function.
16
 */
17
function createToPairs(keysFunc) {
18
  return function(object) {
19
    var tag = getTag(object);
20
    if (tag == mapTag) {
21
      return mapToArray(object);
22
    }
23
    if (tag == setTag) {
24
      return setToPairs(object);
25
    }
26
    return baseToPairs(object, keysFunc(object));
27
  };
28
}
29

  
30
module.exports = createToPairs;
templetes/node_modules/lodash/_createWrap.js
1
var baseSetData = require('./_baseSetData'),
2
    createBind = require('./_createBind'),
3
    createCurry = require('./_createCurry'),
4
    createHybrid = require('./_createHybrid'),
5
    createPartial = require('./_createPartial'),
6
    getData = require('./_getData'),
7
    mergeData = require('./_mergeData'),
8
    setData = require('./_setData'),
9
    setWrapToString = require('./_setWrapToString'),
10
    toInteger = require('./toInteger');
11

  
12
/** Error message constants. */
13
var FUNC_ERROR_TEXT = 'Expected a function';
14

  
15
/** Used to compose bitmasks for function metadata. */
16
var WRAP_BIND_FLAG = 1,
17
    WRAP_BIND_KEY_FLAG = 2,
18
    WRAP_CURRY_FLAG = 8,
19
    WRAP_CURRY_RIGHT_FLAG = 16,
20
    WRAP_PARTIAL_FLAG = 32,
21
    WRAP_PARTIAL_RIGHT_FLAG = 64;
22

  
23
/* Built-in method references for those with the same name as other `lodash` methods. */
24
var nativeMax = Math.max;
25

  
26
/**
27
 * Creates a function that either curries or invokes `func` with optional
28
 * `this` binding and partially applied arguments.
29
 *
30
 * @private
31
 * @param {Function|string} func The function or method name to wrap.
32
 * @param {number} bitmask The bitmask flags.
33
 *    1 - `_.bind`
34
 *    2 - `_.bindKey`
35
 *    4 - `_.curry` or `_.curryRight` of a bound function
36
 *    8 - `_.curry`
37
 *   16 - `_.curryRight`
38
 *   32 - `_.partial`
39
 *   64 - `_.partialRight`
40
 *  128 - `_.rearg`
41
 *  256 - `_.ary`
42
 *  512 - `_.flip`
43
 * @param {*} [thisArg] The `this` binding of `func`.
44
 * @param {Array} [partials] The arguments to be partially applied.
45
 * @param {Array} [holders] The `partials` placeholder indexes.
46
 * @param {Array} [argPos] The argument positions of the new function.
47
 * @param {number} [ary] The arity cap of `func`.
48
 * @param {number} [arity] The arity of `func`.
49
 * @returns {Function} Returns the new wrapped function.
50
 */
51
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
52
  var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
53
  if (!isBindKey && typeof func != 'function') {
54
    throw new TypeError(FUNC_ERROR_TEXT);
55
  }
56
  var length = partials ? partials.length : 0;
57
  if (!length) {
58
    bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
59
    partials = holders = undefined;
60
  }
61
  ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
62
  arity = arity === undefined ? arity : toInteger(arity);
63
  length -= holders ? holders.length : 0;
64

  
65
  if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
66
    var partialsRight = partials,
67
        holdersRight = holders;
68

  
69
    partials = holders = undefined;
70
  }
71
  var data = isBindKey ? undefined : getData(func);
72

  
73
  var newData = [
74
    func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
75
    argPos, ary, arity
76
  ];
77

  
78
  if (data) {
79
    mergeData(newData, data);
80
  }
81
  func = newData[0];
82
  bitmask = newData[1];
83
  thisArg = newData[2];
84
  partials = newData[3];
85
  holders = newData[4];
86
  arity = newData[9] = newData[9] === undefined
87
    ? (isBindKey ? 0 : func.length)
88
    : nativeMax(newData[9] - length, 0);
89

  
90
  if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
91
    bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
92
  }
93
  if (!bitmask || bitmask == WRAP_BIND_FLAG) {
94
    var result = createBind(func, bitmask, thisArg);
95
  } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
96
    result = createCurry(func, bitmask, arity);
97
  } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
98
    result = createPartial(func, bitmask, thisArg, partials);
99
  } else {
100
    result = createHybrid.apply(undefined, newData);
101
  }
102
  var setter = data ? baseSetData : setData;
103
  return setWrapToString(setter(result, newData), func, bitmask);
104
}
105

  
106
module.exports = createWrap;
templetes/node_modules/lodash/_customDefaultsAssignIn.js
1
var eq = require('./eq');
2

  
3
/** Used for built-in method references. */
4
var objectProto = Object.prototype;
5

  
6
/** Used to check objects for own properties. */
7
var hasOwnProperty = objectProto.hasOwnProperty;
8

  
9
/**
10
 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
11
 * of source objects to the destination object for all destination properties
12
 * that resolve to `undefined`.
13
 *
14
 * @private
15
 * @param {*} objValue The destination value.
16
 * @param {*} srcValue The source value.
17
 * @param {string} key The key of the property to assign.
18
 * @param {Object} object The parent object of `objValue`.
19
 * @returns {*} Returns the value to assign.
20
 */
21
function customDefaultsAssignIn(objValue, srcValue, key, object) {
22
  if (objValue === undefined ||
23
      (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
24
    return srcValue;
25
  }
26
  return objValue;
27
}
28

  
29
module.exports = customDefaultsAssignIn;
templetes/node_modules/lodash/_customDefaultsMerge.js
1
var baseMerge = require('./_baseMerge'),
2
    isObject = require('./isObject');
3

  
4
/**
5
 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
6
 * objects into destination objects that are passed thru.
7
 *
8
 * @private
9
 * @param {*} objValue The destination value.
10
 * @param {*} srcValue The source value.
11
 * @param {string} key The key of the property to merge.
12
 * @param {Object} object The parent object of `objValue`.
13
 * @param {Object} source The parent object of `srcValue`.
14
 * @param {Object} [stack] Tracks traversed source values and their merged
15
 *  counterparts.
16
 * @returns {*} Returns the value to assign.
17
 */
18
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
19
  if (isObject(objValue) && isObject(srcValue)) {
20
    // Recursively merge objects and arrays (susceptible to call stack limits).
21
    stack.set(srcValue, objValue);
22
    baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
23
    stack['delete'](srcValue);
24
  }
25
  return objValue;
26
}
27

  
28
module.exports = customDefaultsMerge;
templetes/node_modules/lodash/_customOmitClone.js
1
var isPlainObject = require('./isPlainObject');
2

  
3
/**
4
 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
5
 * objects.
6
 *
7
 * @private
8
 * @param {*} value The value to inspect.
9
 * @param {string} key The key of the property to inspect.
10
 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
11
 */
12
function customOmitClone(value) {
13
  return isPlainObject(value) ? undefined : value;
14
}
15

  
16
module.exports = customOmitClone;

Také k dispozici: Unified diff