mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Add _.chain tests and ensure they pass.
Former-commit-id: e365b65da8a740383c975c7b904ad2156d1cc8ab
This commit is contained in:
9
build.js
9
build.js
@@ -367,14 +367,13 @@
|
||||
].join('\n' + indent));
|
||||
});
|
||||
|
||||
// replace `lodash.chain` assignment
|
||||
// replace `chain` assignments
|
||||
source = source.replace(getMethodAssignments(source), function(match) {
|
||||
return match.replace(/^( *lodash\.chain *= *).+/m, '$1chain;');
|
||||
return match
|
||||
.replace(/^( *lodash\.chain *= *)[\s\S]+?(?=;\n)/m, '$1chain')
|
||||
.replace(/^( *lodash\.prototype\.chain *= *)[\s\S]+?(?=;\n)/m, '$1wrapperChain');
|
||||
});
|
||||
|
||||
// add `lodash.prototype.chain` assignment
|
||||
source = source.replace(/^( *)lodash\.prototype\.value *=.+\n/m, '$1lodash.prototype.chain = wrapperChain;\n$&');
|
||||
|
||||
// remove `lodash.prototype.toString` and `lodash.prototype.valueOf` assignments
|
||||
source = source.replace(/^ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/gm, '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user