Permalink
Cannot retrieve contributors at this time
42 lines (39 sloc)
1.17 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/cloneWith.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseClone = require('./_baseClone'); | |
/** Used to compose bitmasks for cloning. */ | |
var CLONE_SYMBOLS_FLAG = 4; | |
/** | |
* This method is like `_.clone` except that it accepts `customizer` which | |
* is invoked to produce the cloned value. If `customizer` returns `undefined`, | |
* cloning is handled by the method instead. The `customizer` is invoked with | |
* up to four arguments; (value [, index|key, object, stack]). | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.0.0 | |
* @category Lang | |
* @param {*} value The value to clone. | |
* @param {Function} [customizer] The function to customize cloning. | |
* @returns {*} Returns the cloned value. | |
* @see _.cloneDeepWith | |
* @example | |
* | |
* function customizer(value) { | |
* if (_.isElement(value)) { | |
* return value.cloneNode(false); | |
* } | |
* } | |
* | |
* var el = _.cloneWith(document.body, customizer); | |
* | |
* console.log(el === document.body); | |
* // => false | |
* console.log(el.nodeName); | |
* // => 'BODY' | |
* console.log(el.childNodes.length); | |
* // => 0 | |
*/ | |
function cloneWith(value, customizer) { | |
customizer = typeof customizer == 'function' ? customizer : undefined; | |
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); | |
} | |
module.exports = cloneWith; |