|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
309 bytes
|
| Line | |
|---|
| 1 | var isObject = require('./isObject.js');
|
|---|
| 2 | var isArray = require('./isArray.js');
|
|---|
| 3 | var extend = require('./extend.js');
|
|---|
| 4 |
|
|---|
| 5 | // Create a (shallow-cloned) duplicate of an object.
|
|---|
| 6 | function clone(obj) {
|
|---|
| 7 | if (!isObject(obj)) return obj;
|
|---|
| 8 | return isArray(obj) ? obj.slice() : extend({}, obj);
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | module.exports = clone;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.