mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Make _.contains work with strings similar ES6 draft String#contains.
Former-commit-id: 3cfffdcddec3e1e8175da95043ec86ac3c6a85fe
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Post-process a given minified JavaScript `source`, preparing it for
|
||||
* Post-process a given minified Lo-Dash `source`, preparing it for
|
||||
* deployment.
|
||||
*
|
||||
* @param {String} source The source to process.
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
/**
|
||||
* Pre-process a given Lo-Dash source, preparing it for minification.
|
||||
*
|
||||
* @param {String} source The Lo-Dash source to process.
|
||||
* @param {String} source The source to process.
|
||||
* @returns {String} Returns the processed source.
|
||||
*/
|
||||
function preprocess(source) {
|
||||
@@ -218,6 +218,9 @@
|
||||
// remove brackets from `_.escape()` in `_.template`
|
||||
source = source.replace(/__e *= *_\['escape']/, '__e=_.escape');
|
||||
|
||||
// remove brackets from `collection.indexOf` in `_.contains`
|
||||
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
|
||||
|
||||
// remove brackets from `result[length].value` in `_.sortBy`
|
||||
source = source.replace("result[length]['value']", 'result[length].value');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user