mirror of
https://github.com/stCarolas/setup-maven.git
synced 2024-12-19 19:49:04 +00:00
12 lines
309 B
JavaScript
12 lines
309 B
JavaScript
var isObject = require('./isObject.js');
|
|
var isArray = require('./isArray.js');
|
|
var extend = require('./extend.js');
|
|
|
|
// Create a (shallow-cloned) duplicate of an object.
|
|
function clone(obj) {
|
|
if (!isObject(obj)) return obj;
|
|
return isArray(obj) ? obj.slice() : extend({}, obj);
|
|
}
|
|
|
|
module.exports = clone;
|