You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|*fromto*| object | array | An object mapping properties between *src* and *dst*. (Optional) |
162
-
|*converter*|function| A function to convert terminal values in *src*. (Optional) |
163
-
|*reverse*|boolean | True, if copying reversively from dst to src and returns src object. `fromto` is also reversively used from value to key. This default value is `false`. (Optional) |
|_fromto_| object | array | An object mapping properties between _src_ and _dst_. (Optional)|
167
+
|_converter_|function| A function to convert terminal values in _src_. (Optional)|
168
+
|_reverse_|boolean| True, if copying reversively from dst to src and returns src object. `fromto` is also reversively used from value to key. This default value is `false`. (Optional) |
164
169
165
170
#### Returns:
166
171
167
-
*dst* object after copying.
172
+
_dst_ object after copying.
168
173
169
174
**Type:** object
170
175
171
-
***Format of <i>fromto</i>**
176
+
-**Format of <i>fromto</i>**
177
+
178
+
_fromto_ is a non-nested key-value object. And the *key*s are property key chains of _src_ and the *value*s are property key chains of _dst_.
179
+
The key chain is a string which is concatenated property keys on each level with dots, like `'aaa.bbb.ccc'`.
180
+
181
+
The following example copys the value of `src.aaa.bbb.ccc` to `dst.xxx.yyy`.
172
182
173
-
*fromto* is a non-nested key-value object. And the *key*s are property key chains of *src* and the *value*s are property key chains of *dst*.
174
-
The key chain is a string which is concatenated property keys on each level with dots, like `'aaa.bbb.ccc'`.
183
+
```js
184
+
copyProps(src, dst, {
185
+
'aaa.bbb.ccc':'xxx.yyy',
186
+
});
187
+
```
175
188
176
-
The following example copys the value of `src.aaa.bbb.ccc` to `dst.xxx.yyy`.
189
+
_fromto_ can be an array. In that case, the array works as a map which has pairs of same key and value.
177
190
178
-
```js
179
-
copyProps(src, dst, {
180
-
'aaa.bbb.ccc':'xxx.yyy'
181
-
})
182
-
```
191
+
-**API of <i>converter</i>**
183
192
184
-
*fromto* can be an array. In that case, the array works as a map which has pairs of same key and value.
185
-
186
-
***APIof<i>converter</i>**
193
+
**<u>converter(srcInfo, dstInfo) : Any</u>**
187
194
188
-
**<u>converter(srcInfo, dstInfo) : Any</u>**
195
+
_converter_ is a function to convert terminal values of propeerties of _src_.
189
196
190
-
*converter* is a function to convert terminal values of propeerties of *src*.
| *srcInfo* | object | An object which has informations about the current node of *src*. |
197
-
| *dstInfo* | object | An object which has informations about the current node of *dst*. |
198
-
199
-
**Return:**
200
-
201
-
The converted value to be set as a destination property value. If this value is undefined, the destination property is not set to the destination node object.
202
-
203
-
**Type:** *Any*
204
-
205
-
* **Properties of <i>srcInfo</i> and <i>dstInfo</i>**
204
+
**Return:**
206
205
207
-
*srcInfo* and *dstInfo* has same properties, as follows:
| *value* | *Any* | The value of the current node. |
212
-
| *key* | string | The key name of the current node. |
213
-
| *keyChain* | string | The full key of the current node concatenated with dot. |
214
-
| *depth* | number | The depth of the current node. |
215
-
| *parent* | object | The parent node of the current node. |
206
+
The converted value to be set as a destination property value. If this value is undefined, the destination property is not set to the destination node object.
216
207
208
+
**Type:**_Any_
209
+
210
+
-**Properties of <i>srcInfo</i> and <i>dstInfo</i>**
211
+
212
+
_srcInfo_ and _dstInfo_ has same properties, as follows:
0 commit comments