lodash.template
Advanced tools
Comparing version 3.1.0 to 3.2.0
61
index.js
/** | ||
* lodash 3.1.0 (Custom Build) <https://lodash.com/> | ||
* lodash 3.2.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
@@ -11,10 +11,11 @@ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
baseSlice = require('lodash._baseslice'), | ||
baseToString = require('lodash._basetostring'), | ||
baseValues = require('lodash._basevalues'), | ||
isIterateeCall = require('lodash._isiterateecall'), | ||
reInterpolate = require('lodash._reinterpolate'), | ||
isError = require('lodash.iserror'), | ||
keys = require('lodash.keys'), | ||
templateSettings = require('lodash.templatesettings'); | ||
/** `Object#toString` result references. */ | ||
var errorTag = '[object Error]'; | ||
/** Used to match empty string literals in compiled template source. */ | ||
@@ -49,2 +50,17 @@ var reEmptyStringLeading = /\b__p \+= '';/g, | ||
/** | ||
* Converts `value` to a string if it is not one. An empty string is returned | ||
* for `null` or `undefined` values. | ||
* | ||
* @private | ||
* @param {*} value The value to process. | ||
* @returns {string} Returns the string. | ||
*/ | ||
function baseToString(value) { | ||
if (typeof value == 'string') { | ||
return value; | ||
} | ||
return value == null ? '' : (value + ''); | ||
} | ||
/** | ||
* Used by `_.template` to escape characters for inclusion in compiled | ||
@@ -61,2 +77,13 @@ * string literals. | ||
/** | ||
* Checks if `value` is object-like. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
*/ | ||
function isObjectLike(value) { | ||
return (value && typeof value == 'object') || false; | ||
} | ||
/** Used for native method references. */ | ||
@@ -69,2 +96,9 @@ var objectProto = Object.prototype; | ||
/** | ||
* Used to resolve the `toStringTag` of values. | ||
* See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) | ||
* for more details. | ||
*/ | ||
var objToString = objectProto.toString; | ||
/** | ||
* Used by `_.template` to customize its `_.assign` use. | ||
@@ -120,2 +154,23 @@ * | ||
/** | ||
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, | ||
* `SyntaxError`, `TypeError`, or `URIError` object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is an error object, else `false`. | ||
* @example | ||
* | ||
* _.isError(new Error); | ||
* // => true | ||
* | ||
* _.isError(Error); | ||
* // => false | ||
*/ | ||
function isError(value) { | ||
return (isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag) || false; | ||
} | ||
/** | ||
* Creates a compiled template function that can interpolate data properties | ||
@@ -122,0 +177,0 @@ * in "interpolate" delimiters, HTML-escape interpolated data properties in |
{ | ||
"name": "lodash.template", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "The modern build of lodash’s `_.template` as a module.", | ||
@@ -22,7 +22,5 @@ "homepage": "https://lodash.com/", | ||
"lodash._baseslice": "^3.0.0", | ||
"lodash._basetostring": "^3.0.0", | ||
"lodash._basevalues": "^3.0.0", | ||
"lodash._isiterateecall": "^3.0.0", | ||
"lodash._reinterpolate": "^3.0.0", | ||
"lodash.iserror": "^3.0.0", | ||
"lodash.keys": "^3.0.0", | ||
@@ -29,0 +27,0 @@ "lodash.templatesettings": "^3.0.0" |
@@ -1,2 +0,2 @@ | ||
# lodash.template v3.1.0 | ||
# lodash.template v3.2.0 | ||
@@ -20,2 +20,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.template` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/3.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/3.2.0-npm-packages/lodash.template) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16819
7
362
- Removedlodash._basetostring@^3.0.0
- Removedlodash.iserror@^3.0.0
- Removedlodash._basetostring@3.0.1(transitive)
- Removedlodash.iserror@3.1.1(transitive)