lodash.template
Advanced tools
Comparing version 4.1.0 to 4.1.1
79
index.js
/** | ||
* lodash 4.1.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.1.1 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -14,8 +14,7 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
rest = require('lodash.rest'), | ||
root = require('lodash._root'), | ||
templateSettings = require('lodash.templatesettings'); | ||
templateSettings = require('lodash.templatesettings'), | ||
toString = require('lodash.tostring'); | ||
/** Used as references for various `Number` constants. */ | ||
var INFINITY = 1 / 0, | ||
MAX_SAFE_INTEGER = 9007199254740991; | ||
var MAX_SAFE_INTEGER = 9007199254740991; | ||
@@ -25,4 +24,3 @@ /** `Object#toString` result references. */ | ||
funcTag = '[object Function]', | ||
genTag = '[object GeneratorFunction]', | ||
symbolTag = '[object Symbol]'; | ||
genTag = '[object GeneratorFunction]'; | ||
@@ -130,9 +128,2 @@ /** Used to match empty string literals in compiled template source. */ | ||
/** Built-in value references. */ | ||
var Symbol = root.Symbol; | ||
/** Used to convert symbols to primitives and strings. */ | ||
var symbolProto = Symbol ? Symbol.prototype : undefined, | ||
symbolToString = Symbol ? symbolProto.toString : undefined; | ||
/** | ||
@@ -182,3 +173,3 @@ * Used by `_.defaults` to customize its `_.assignIn` use. | ||
/** | ||
* Checks if the provided arguments are from an iteratee call. | ||
* Checks if the given arguments are from an iteratee call. | ||
* | ||
@@ -398,58 +389,2 @@ * @private | ||
/** | ||
* Checks if `value` is classified as a `Symbol` primitive or object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @example | ||
* | ||
* _.isSymbol(Symbol.iterator); | ||
* // => true | ||
* | ||
* _.isSymbol('abc'); | ||
* // => false | ||
*/ | ||
function isSymbol(value) { | ||
return typeof value == 'symbol' || | ||
(isObjectLike(value) && objectToString.call(value) == symbolTag); | ||
} | ||
/** | ||
* Converts `value` to a string if it's not one. An empty string is returned | ||
* for `null` and `undefined` values. The sign of `-0` is preserved. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to process. | ||
* @returns {string} Returns the string. | ||
* @example | ||
* | ||
* _.toString(null); | ||
* // => '' | ||
* | ||
* _.toString(-0); | ||
* // => '-0' | ||
* | ||
* _.toString([1, 2, 3]); | ||
* // => '1,2,3' | ||
*/ | ||
function toString(value) { | ||
// Exit early for strings to avoid a performance hit in some environments. | ||
if (typeof value == 'string') { | ||
return value; | ||
} | ||
if (value == null) { | ||
return ''; | ||
} | ||
if (isSymbol(value)) { | ||
return Symbol ? symbolToString.call(value) : ''; | ||
} | ||
var result = (value + ''); | ||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; | ||
} | ||
/** | ||
* Creates a compiled template function that can interpolate data properties | ||
@@ -459,3 +394,3 @@ * in "interpolate" delimiters, HTML-escape interpolated data properties in | ||
* properties may be accessed as free variables in the template. If a setting | ||
* object is provided it takes precedence over `_.templateSettings` values. | ||
* object is given it takes precedence over `_.templateSettings` values. | ||
* | ||
@@ -462,0 +397,0 @@ * **Note:** In the development build `_.template` utilizes |
{ | ||
"name": "lodash.template", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "The lodash method `_.template` exported as a module.", | ||
@@ -20,8 +20,8 @@ "homepage": "https://lodash.com/", | ||
"lodash._reinterpolate": "^3.0.0", | ||
"lodash._root": "^3.0.0", | ||
"lodash.assigninwith": "^4.0.0", | ||
"lodash.keys": "^4.0.0", | ||
"lodash.rest": "^4.0.0", | ||
"lodash.templatesettings": "^3.0.0" | ||
"lodash.templatesettings": "^3.0.0", | ||
"lodash.tostring": "^4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.template v4.1.0 | ||
# lodash.template v4.1.1 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.template` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.template) for more details. | ||
See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.template) for more details. |
Sorry, the diff of this file is not supported yet
21918
567
+ Addedlodash.tostring@^4.0.0
+ Addedlodash.tostring@4.1.4(transitive)
- Removedlodash._root@^3.0.0