mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Remove semicolons.
This commit is contained in:
22
cloneWith.js
22
cloneWith.js
@@ -1,13 +1,13 @@
|
||||
import baseClone from './.internal/baseClone.js';
|
||||
import baseClone from './.internal/baseClone.js'
|
||||
|
||||
/** Used to compose bitmasks for cloning. */
|
||||
const CLONE_SYMBOLS_FLAG = 4;
|
||||
const 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]).
|
||||
* up to four arguments (value [, index|key, object, stack]).
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
@@ -19,22 +19,22 @@ const CLONE_SYMBOLS_FLAG = 4;
|
||||
*
|
||||
* function customizer(value) {
|
||||
* if (isElement(value)) {
|
||||
* return value.cloneNode(false);
|
||||
* return value.cloneNode(false)
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const el = cloneWith(document.body, customizer);
|
||||
* const el = cloneWith(document.body, customizer)
|
||||
*
|
||||
* console.log(el === document.body);
|
||||
* console.log(el === document.body)
|
||||
* // => false
|
||||
* console.log(el.nodeName);
|
||||
* console.log(el.nodeName)
|
||||
* // => 'BODY'
|
||||
* console.log(el.childNodes.length);
|
||||
* console.log(el.childNodes.length)
|
||||
* // => 0
|
||||
*/
|
||||
function cloneWith(value, customizer) {
|
||||
customizer = typeof customizer == 'function' ? customizer : undefined;
|
||||
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
||||
customizer = typeof customizer == 'function' ? customizer : undefined
|
||||
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer)
|
||||
}
|
||||
|
||||
export default cloneWith;
|
||||
export default cloneWith
|
||||
|
||||
Reference in New Issue
Block a user