Skip to content

Commit 55d7d99

Browse files
committed
deploy: 6f30465
1 parent 5d2561b commit 55d7d99

File tree

150 files changed

+652
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+652
-300
lines changed

after.js.html

+2-2
Large diffs are not rendered by default.

allKeys.js.html

+2-2
Large diffs are not rendered by default.

allKeysIn.js.html

+2-2
Large diffs are not rendered by default.

before.js.html

+2-2
Large diffs are not rendered by default.

camelCase.js.html

+2-2
Large diffs are not rendered by default.

capitalize.js.html

+2-2
Large diffs are not rendered by default.

castArray.js.html

+2-2
Large diffs are not rendered by default.

ceil.js.html

+2-2
Large diffs are not rendered by default.

chunk.js.html

+2-2
Large diffs are not rendered by default.

clamp.js.html

+2-2
Large diffs are not rendered by default.

compact.js.html

+2-2
Large diffs are not rendered by default.

conforms.js.html

+2-2
Large diffs are not rendered by default.

conformsTo.js.html

+2-2
Large diffs are not rendered by default.

constant.js.html

+2-2
Large diffs are not rendered by default.

countBy.js.html

+2-2
Large diffs are not rendered by default.

curry.js.html

+2-2
Large diffs are not rendered by default.

debounce.js.html

+2-2
Large diffs are not rendered by default.

defaultTo.js.html

+2-2
Large diffs are not rendered by default.

delay.js.html

+2-2
Large diffs are not rendered by default.

difference.js.html

+2-2
Large diffs are not rendered by default.

eq.js.html

+2-2
Large diffs are not rendered by default.

escape.js.html

+2-2
Large diffs are not rendered by default.

escapeRegExp.js.html

+2-2
Large diffs are not rendered by default.

every.js.html

+2-2
Large diffs are not rendered by default.

filter.js.html

+2-2
Large diffs are not rendered by default.

find.js.html

+2-2
Large diffs are not rendered by default.

findKey.js.html

+2-2
Large diffs are not rendered by default.

floor.js.html

+2-2
Large diffs are not rendered by default.

forEach.js.html

+2-2
Large diffs are not rendered by default.

forEachRight.js.html

+2-2
Large diffs are not rendered by default.

global.html

+2-2
Large diffs are not rendered by default.

groupBy.js.html

+2-2
Large diffs are not rendered by default.

gt.js.html

+2-2
Large diffs are not rendered by default.

gte.js.html

+2-2
Large diffs are not rendered by default.

guard.js.html

+2-2
Large diffs are not rendered by default.

identity.js.html

+2-2
Large diffs are not rendered by default.

inRange.js.html

+2-2
Large diffs are not rendered by default.

index.html

+2-2
Large diffs are not rendered by default.

index.js.html

+3-2
Large diffs are not rendered by default.

internals_helpers.js.html

+2-2
Large diffs are not rendered by default.

internals_native.js.html

+2-2
Large diffs are not rendered by default.

internals_root.js.html

+2-2
Large diffs are not rendered by default.

intersection.js.html

+2-2
Large diffs are not rendered by default.

invert.js.html

+2-2
Large diffs are not rendered by default.

isArguments.js.html

+2-2
Large diffs are not rendered by default.

isArray.js.html

+2-2
Large diffs are not rendered by default.

isArrayBuffer.js.html

+2-2
Large diffs are not rendered by default.

isArrayLike.js.html

+2-2
Large diffs are not rendered by default.

isArrayLikeObject.js.html

+2-2
Large diffs are not rendered by default.

isBigInt.js.html

+2-2
Large diffs are not rendered by default.

isBlob.js.html

+2-2
Large diffs are not rendered by default.

isBoolean.js.html

+2-2
Large diffs are not rendered by default.

isBuffer.js.html

+2-2
Large diffs are not rendered by default.

isDataView.js.html

+2-2
Large diffs are not rendered by default.

isDate.js.html

+2-2
Large diffs are not rendered by default.

isElement.js.html

+2-2
Large diffs are not rendered by default.

isEmpty.js.html

+2-2
Large diffs are not rendered by default.

isEqual.js.html

+2-2
Large diffs are not rendered by default.

isError.js.html

+2-2
Large diffs are not rendered by default.

isFile.js.html

+2-2
Large diffs are not rendered by default.

isFinite.js.html

+2-2
Large diffs are not rendered by default.

isFunction.js.html

+2-2
Large diffs are not rendered by default.

isInteger.js.html

+2-2
Large diffs are not rendered by default.

isLength.js.html

+2-2
Large diffs are not rendered by default.

isMap.js.html

+2-2
Large diffs are not rendered by default.

isMatch.js.html

+2-2
Large diffs are not rendered by default.

isNaN.js.html

+2-2
Large diffs are not rendered by default.

isNil.js.html

+2-2
Large diffs are not rendered by default.

isNull.js.html

+2-2
Large diffs are not rendered by default.

isNumber.js.html

+2-2
Large diffs are not rendered by default.

isObject.js.html

+2-2
Large diffs are not rendered by default.

isObjectLike.js.html

+2-2
Large diffs are not rendered by default.

isPlainObject.js.html

+2-2
Large diffs are not rendered by default.

isPromiseLike.js.html

+2-2
Large diffs are not rendered by default.

isRegExp.js.html

+2-2
Large diffs are not rendered by default.

isSafeInteger.js.html

+2-2
Large diffs are not rendered by default.

isSet.js.html

+2-2
Large diffs are not rendered by default.

isString.js.html

+2-2
Large diffs are not rendered by default.

isSymbol.js.html

+2-2
Large diffs are not rendered by default.

isTypedArray.js.html

+2-2
Large diffs are not rendered by default.

isUndefined.js.html

+2-2
Large diffs are not rendered by default.

isWeakMap.js.html

+2-2
Large diffs are not rendered by default.

isWeakSet.js.html

+2-2
Large diffs are not rendered by default.

isWindow.js.html

+2-2
Large diffs are not rendered by default.

kebabCase.js.html

+2-2
Large diffs are not rendered by default.

keyBy.js.html

+2-2
Large diffs are not rendered by default.

keys.js.html

+2-2
Large diffs are not rendered by default.

keysIn.js.html

+2-2
Large diffs are not rendered by default.

list.js.html

+2-2
Large diffs are not rendered by default.

lowerCase.js.html

+2-2
Large diffs are not rendered by default.

lowerFirst.js.html

+2-2
Large diffs are not rendered by default.

lt.js.html

+2-2
Large diffs are not rendered by default.

lte.js.html

+2-2
Large diffs are not rendered by default.

map.js.html

+2-2
Large diffs are not rendered by default.

max.js.html

+2-2
Large diffs are not rendered by default.

merge.js.html

+2-2
Large diffs are not rendered by default.

mergeObject.js.html

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
5+
<meta charset="utf-8">
6+
<link rel="shortcut icon" type="image/x-icon" href="https://www.caijinfeng.com/favicon.ico" />
7+
<title>mergeObject.js - ut2 </title>
8+
9+
<meta name="description" content="一个现代 JavaScript 实用工具库" />
10+
11+
<meta name="keywords" content="util, modules, es5, es6, es2015" />
12+
<meta name="keyword" content="util, modules, es5, es6, es2015" />
13+
14+
15+
16+
<meta property="og:title" content="ut2"/>
17+
<meta property="og:type" content="website"/>
18+
<meta property="og:image" content=""/>
19+
<meta property="og:site_name" content="ut2"/>
20+
<meta property="og:url" content="https://caijf.github.io/ut2/index.html"/>
21+
22+
<script src="scripts/prettify/prettify.js"></script>
23+
<script src="scripts/prettify/lang-css.js"></script>
24+
<!--[if lt IE 9]>
25+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
26+
<![endif]-->
27+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
28+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
29+
<script src="scripts/nav.js" defer></script>
30+
31+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
32+
<!-- Google tag (gtag.js) -->
33+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K3H2W4JQNH"></script>
34+
<script>
35+
window.dataLayer = window.dataLayer || [];
36+
function gtag(){dataLayer.push(arguments);}
37+
gtag('js', new Date());
38+
39+
gtag('config', 'G-K3H2W4JQNH');
40+
</script>
41+
<script src="https://unpkg.com/ut2@latest/dist/ut2.min.js"></script>
42+
</head>
43+
<body>
44+
45+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
46+
<label for="nav-trigger" class="navicon-button x">
47+
<div class="navicon"></div>
48+
</label>
49+
50+
<label for="nav-trigger" class="overlay"></label>
51+
52+
<nav >
53+
54+
<input type="text" id="nav-search" placeholder="Search" />
55+
56+
57+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/caijf/ut2" target="_blank" class="menu-item" id="repo_link" >Github</a></h2><h2><a href="https://github.com/caijf/ut2/releases" target="_blank" class="menu-item" id="repo_link" >Changelog</a></h2><h3>Modules</h3><ul><li><a href="module-Array.html">Array</a><ul class='methods'><li data-type='method'><a href="module-Array.html#.chunk">chunk</a></li><li data-type='method'><a href="module-Array.html#.compact">compact</a></li><li data-type='method'><a href="module-Array.html#.difference">difference</a></li><li data-type='method'><a href="module-Array.html#.intersection">intersection</a></li><li data-type='method'><a href="module-Array.html#.move">move</a></li><li data-type='method'><a href="module-Array.html#.nth">nth</a></li><li data-type='method'><a href="module-Array.html#.shuffle">shuffle</a></li><li data-type='method'><a href="module-Array.html#.union">union</a></li><li data-type='method'><a href="module-Array.html#.uniq">uniq</a></li><li data-type='method'><a href="module-Array.html#.unzip">unzip</a></li><li data-type='method'><a href="module-Array.html#.xor">xor</a></li><li data-type='method'><a href="module-Array.html#.zip">zip</a></li></ul></li><li><a href="module-Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="module-Collection.html#.countBy">countBy</a></li><li data-type='method'><a href="module-Collection.html#.every">every</a></li><li data-type='method'><a href="module-Collection.html#.filter">filter</a></li><li data-type='method'><a href="module-Collection.html#.find">find</a></li><li data-type='method'><a href="module-Collection.html#.forEach">forEach</a></li><li data-type='method'><a href="module-Collection.html#.forEachRight">forEachRight</a></li><li data-type='method'><a href="module-Collection.html#.groupBy">groupBy</a></li><li data-type='method'><a href="module-Collection.html#.keyBy">keyBy</a></li><li data-type='method'><a href="module-Collection.html#.map">map</a></li><li data-type='method'><a href="module-Collection.html#.orderBy">orderBy</a></li><li data-type='method'><a href="module-Collection.html#.partition">partition</a></li><li data-type='method'><a href="module-Collection.html#.reduce">reduce</a></li><li data-type='method'><a href="module-Collection.html#.reduceRight">reduceRight</a></li><li data-type='method'><a href="module-Collection.html#.some">some</a></li></ul></li><li><a href="module-Function.html">Function</a><ul class='methods'><li data-type='method'><a href="module-Function.html#.after">after</a></li><li data-type='method'><a href="module-Function.html#.before">before</a></li><li data-type='method'><a href="module-Function.html#.curry">curry</a></li><li data-type='method'><a href="module-Function.html#.debounce">debounce</a></li><li data-type='method'><a href="module-Function.html#.delay">delay</a></li><li data-type='method'><a href="module-Function.html#.negate">negate</a></li><li data-type='method'><a href="module-Function.html#.once">once</a></li><li data-type='method'><a href="module-Function.html#.partial">partial</a></li><li data-type='method'><a href="module-Function.html#.throttle">throttle</a></li></ul></li><li><a href="module-Language.html">Language</a><ul class='methods'><li data-type='method'><a href="module-Language.html#.isArguments">isArguments</a></li><li data-type='method'><a href="module-Language.html#.isArray">isArray</a></li><li data-type='method'><a href="module-Language.html#.isArrayBuffer">isArrayBuffer</a></li><li data-type='method'><a href="module-Language.html#.isArrayLike">isArrayLike</a></li><li data-type='method'><a href="module-Language.html#.isArrayLikeObject">isArrayLikeObject</a></li><li data-type='method'><a href="module-Language.html#.isBigInt">isBigInt</a></li><li data-type='method'><a href="module-Language.html#.isBlob">isBlob</a></li><li data-type='method'><a href="module-Language.html#.isBoolean">isBoolean</a></li><li data-type='method'><a href="module-Language.html#.isBuffer">isBuffer</a></li><li data-type='method'><a href="module-Language.html#.isDataView">isDataView</a></li><li data-type='method'><a href="module-Language.html#.isDate">isDate</a></li><li data-type='method'><a href="module-Language.html#.isElement">isElement</a></li><li data-type='method'><a href="module-Language.html#.isEmpty">isEmpty</a></li><li data-type='method'><a href="module-Language.html#.isEqual">isEqual</a></li><li data-type='method'><a href="module-Language.html#.isError">isError</a></li><li data-type='method'><a href="module-Language.html#.isFile">isFile</a></li><li data-type='method'><a href="module-Language.html#.isFinite">isFinite</a></li><li data-type='method'><a href="module-Language.html#.isFunction">isFunction</a></li><li data-type='method'><a href="module-Language.html#.isInteger">isInteger</a></li><li data-type='method'><a href="module-Language.html#.isLength">isLength</a></li><li data-type='method'><a href="module-Language.html#.isMap">isMap</a></li><li data-type='method'><a href="module-Language.html#.isMatch">isMatch</a></li><li data-type='method'><a href="module-Language.html#.isNaN">isNaN</a></li><li data-type='method'><a href="module-Language.html#.isNil">isNil</a></li><li data-type='method'><a href="module-Language.html#.isNull">isNull</a></li><li data-type='method'><a href="module-Language.html#.isNumber">isNumber</a></li><li data-type='method'><a href="module-Language.html#.isObject">isObject</a></li><li data-type='method'><a href="module-Language.html#.isObjectLike">isObjectLike</a></li><li data-type='method'><a href="module-Language.html#.isPlainObject">isPlainObject</a></li><li data-type='method'><a href="module-Language.html#.isPromiseLike">isPromiseLike</a></li><li data-type='method'><a href="module-Language.html#.isRegExp">isRegExp</a></li><li data-type='method'><a href="module-Language.html#.isSafeInteger">isSafeInteger</a></li><li data-type='method'><a href="module-Language.html#.isSet">isSet</a></li><li data-type='method'><a href="module-Language.html#.isString">isString</a></li><li data-type='method'><a href="module-Language.html#.isSymbol">isSymbol</a></li><li data-type='method'><a href="module-Language.html#.isTypedArray">isTypedArray</a></li><li data-type='method'><a href="module-Language.html#.isUndefined">isUndefined</a></li><li data-type='method'><a href="module-Language.html#.isWeakMap">isWeakMap</a></li><li data-type='method'><a href="module-Language.html#.isWeakSet">isWeakSet</a></li><li data-type='method'><a href="module-Language.html#.isWindow">isWindow</a></li></ul></li><li><a href="module-Math.html">Math</a><ul class='methods'><li data-type='method'><a href="module-Math.html#.ceil">ceil</a></li><li data-type='method'><a href="module-Math.html#.floor">floor</a></li><li data-type='method'><a href="module-Math.html#.max">max</a></li><li data-type='method'><a href="module-Math.html#.min">min</a></li><li data-type='method'><a href="module-Math.html#.round">round</a></li></ul></li><li><a href="module-Number.html">Number</a><ul class='methods'><li data-type='method'><a href="module-Number.html#.clamp">clamp</a></li><li data-type='method'><a href="module-Number.html#.inRange">inRange</a></li><li data-type='method'><a href="module-Number.html#.random">random</a></li><li data-type='method'><a href="module-Number.html#.randomInt">randomInt</a></li></ul></li><li><a href="module-Object.html">Object</a><ul class='methods'><li data-type='method'><a href="module-Object.html#.allKeys">allKeys</a></li><li data-type='method'><a href="module-Object.html#.allKeysIn">allKeysIn</a></li><li data-type='method'><a href="module-Object.html#.findKey">findKey</a></li><li data-type='method'><a href="module-Object.html#.invert">invert</a></li><li data-type='method'><a href="module-Object.html#.keys">keys</a></li><li data-type='method'><a href="module-Object.html#.keysIn">keysIn</a></li><li data-type='method'><a href="module-Object.html#.merge">merge</a></li><li data-type='method'><a href="module-Object.html#.mergeObject">mergeObject</a></li><li data-type='method'><a href="module-Object.html#.omit">omit</a></li><li data-type='method'><a href="module-Object.html#.omitBy">omitBy</a></li><li data-type='method'><a href="module-Object.html#.pick">pick</a></li><li data-type='method'><a href="module-Object.html#.pickBy">pickBy</a></li></ul></li><li><a href="module-String.html">String</a><ul class='methods'><li data-type='method'><a href="module-String.html#.camelCase">camelCase</a></li><li data-type='method'><a href="module-String.html#.capitalize">capitalize</a></li><li data-type='method'><a href="module-String.html#.escape">escape</a></li><li data-type='method'><a href="module-String.html#.escapeRegExp">escapeRegExp</a></li><li data-type='method'><a href="module-String.html#.kebabCase">kebabCase</a></li><li data-type='method'><a href="module-String.html#.lowerCase">lowerCase</a></li><li data-type='method'><a href="module-String.html#.lowerFirst">lowerFirst</a></li><li data-type='method'><a href="module-String.html#.pascalCase">pascalCase</a></li><li data-type='method'><a href="module-String.html#.snakeCase">snakeCase</a></li><li data-type='method'><a href="module-String.html#.unescape">unescape</a></li><li data-type='method'><a href="module-String.html#.upperCase">upperCase</a></li><li data-type='method'><a href="module-String.html#.upperFirst">upperFirst</a></li><li data-type='method'><a href="module-String.html#.words">words</a></li></ul></li><li><a href="module-Util.html">Util</a><ul class='methods'><li data-type='method'><a href="module-Util.html#.castArray">castArray</a></li><li data-type='method'><a href="module-Util.html#.conforms">conforms</a></li><li data-type='method'><a href="module-Util.html#.conformsTo">conformsTo</a></li><li data-type='method'><a href="module-Util.html#.constant">constant</a></li><li data-type='method'><a href="module-Util.html#.defaultTo">defaultTo</a></li><li data-type='method'><a href="module-Util.html#.eq">eq</a></li><li data-type='method'><a href="module-Util.html#.gt">gt</a></li><li data-type='method'><a href="module-Util.html#.gte">gte</a></li><li data-type='method'><a href="module-Util.html#.guard">guard</a></li><li data-type='method'><a href="module-Util.html#.identity">identity</a></li><li data-type='method'><a href="module-Util.html#.list">list</a></li><li data-type='method'><a href="module-Util.html#.lt">lt</a></li><li data-type='method'><a href="module-Util.html#.lte">lte</a></li><li data-type='method'><a href="module-Util.html#.noop">noop</a></li><li data-type='method'><a href="module-Util.html#.nthArg">nthArg</a></li><li data-type='method'><a href="module-Util.html#.range">range</a></li><li data-type='method'><a href="module-Util.html#.retry">retry</a></li><li data-type='method'><a href="module-Util.html#.sleep">sleep</a></li><li data-type='method'><a href="module-Util.html#.toFinite">toFinite</a></li><li data-type='method'><a href="module-Util.html#.toInteger">toInteger</a></li><li data-type='method'><a href="module-Util.html#.toLength">toLength</a></li><li data-type='method'><a href="module-Util.html#.toNumber">toNumber</a></li><li data-type='method'><a href="module-Util.html#.toSafeInteger">toSafeInteger</a></li><li data-type='method'><a href="module-Util.html#.toString">toString</a></li><li data-type='method'><a href="module-Util.html#.tryit">tryit</a></li><li data-type='method'><a href="module-Util.html#.uniqueId">uniqueId</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#MAX_ARRAY_LENGTH">MAX_ARRAY_LENGTH</a></li><li><a href="global.html#MAX_SAFE_INTEGER">MAX_SAFE_INTEGER</a></li><li><a href="global.html#MIN_SAFE_INTEGER">MIN_SAFE_INTEGER</a></li><li><a href="global.html#VERSION">VERSION</a></li><li><a href="global.html#isBrowser">isBrowser</a></li><li><a href="global.html#root">root</a></li></ul>
58+
59+
</nav>
60+
61+
<div id="main">
62+
63+
<h1 class="page-title">mergeObject.js</h1>
64+
65+
66+
67+
68+
69+
70+
71+
<section>
72+
<article>
73+
<pre class="prettyprint source linenums"><code>import merge from './merge';
74+
/**
75+
* 递归合并 `source` 来源对象自身的可枚举属性(包含 `Symbol` 属性)到 `object` 目标对象。
76+
*
77+
* 与 `merge` 方法的区别:
78+
*
79+
* 1. 不合并数组,如果只传入 `2` 个参数,同 `merge(obj, src, merge.NOT_MERGE_ARRAYS)`
80+
* 2. 不支持自定义赋值函数和获取对象键,但支持多个来源对象参数
81+
*
82+
* @alias module:Object.mergeObject
83+
* @since 1.15.0
84+
* @param {Object | Array} object 目标对象。
85+
* @param {...object} args 展开的来源对象。
86+
* @returns 目标对象。
87+
* @example
88+
*
89+
* mergeObject({c: 3}, {e: 5}); // { c: 3, e: 5 }
90+
* mergeObject({ a: 1 }, { a: undefined, b: undefined }); // { a: 1, b: undefined }
91+
* mergeObject({ a: 1 }, { a: undefined, b: undefined }, {c:'x'}); // { a: 1, b: undefined, c: 'x' }
92+
*
93+
* const source = {
94+
* a: [{b: 2}, {d: 4}]
95+
* }
96+
* const otherSource = {
97+
* a: [{c: 3},{e: 5}]
98+
* }
99+
* mergeObject({}, source, otherSource); // { a: [{c: 3}, {e: 5}] }
100+
*/
101+
const mergeObject = (object, source, ...args) => {
102+
if (args.length > 0) {
103+
const [arg1, ...restArgs] = args;
104+
const obj = merge(object, source, merge.NOT_MERGE_ARRAYS);
105+
return mergeObject(obj, arg1, ...restArgs);
106+
}
107+
return merge(object, source, merge.NOT_MERGE_ARRAYS);
108+
};
109+
export default mergeObject;
110+
</code></pre>
111+
</article>
112+
</section>
113+
114+
115+
116+
117+
118+
119+
</div>
120+
121+
<br class="clear">
122+
123+
<footer>
124+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Thu Dec 05 2024 02:20:35 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
125+
</footer>
126+
127+
<script>prettyPrint();</script>
128+
<script src="scripts/polyfill.js"></script>
129+
<script src="scripts/linenumber.js"></script>
130+
131+
<script src="scripts/search.js" defer></script>
132+
133+
134+
135+
</body>
136+
</html>

0 commit comments

Comments
 (0)