mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
move doop() function to doop.js
This commit is contained in:
parent
aad1a85ffd
commit
08da5ce4f6
@ -1,3 +1,4 @@
|
||||
var doop = require("jsdoc/util/doop").doop;
|
||||
|
||||
(function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
@ -74,20 +75,6 @@
|
||||
return members;
|
||||
}
|
||||
|
||||
function doop(o) {
|
||||
if (o instanceof Object && o.constructor != Function) {
|
||||
var clone = o instanceof Array ? [] : {}, prop;
|
||||
|
||||
for (prop in o){
|
||||
if ( hasOwnProperty.call(o, prop) ) {
|
||||
clone[prop] = (o[prop] instanceof Object)? doop(o[prop]) : o[prop];
|
||||
}
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
var Sorter = function(dependencies) {
|
||||
this.dependencies = dependencies;
|
||||
this.visited = {};
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
|
||||
*/
|
||||
|
||||
var doop = require("jsdoc/util/doop").doop;
|
||||
|
||||
// requires docs to have been indexed: docs.index must be defined here
|
||||
/**
|
||||
Take a copy of the docs for borrowed symbols and attach them to the
|
||||
@ -47,22 +49,3 @@ exports.resolveBorrows = function(docs) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
/**
|
||||
Deep clone a simple object.
|
||||
@private
|
||||
*/
|
||||
function doop(o) {
|
||||
if (o instanceof Object && o.constructor != Function) {
|
||||
var clone = o instanceof Array ? [] : {}, prop;
|
||||
|
||||
for (prop in o){
|
||||
if ( hasOwnProperty.call(o, prop) ) {
|
||||
clone[prop] = (o[prop] instanceof Object)? doop(o[prop]) : o[prop];
|
||||
}
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
20
rhino_modules/jsdoc/util/doop.js
Normal file
20
rhino_modules/jsdoc/util/doop.js
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
Deep clone a simple object.
|
||||
@private
|
||||
*/
|
||||
var doop = exports.doop = function(o) {
|
||||
var clone,
|
||||
hasOwnProp = Object.prototype.hasOwnProperty,
|
||||
prop;
|
||||
if (o instanceof Object && o.constructor != Function) {
|
||||
clone = o instanceof Array ? [] : {};
|
||||
|
||||
for (prop in o){
|
||||
if ( hasOwnProp.call(o, prop) ) {
|
||||
clone[prop] = (o[prop] instanceof Object)? doop(o[prop]) : o[prop];
|
||||
}
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
return o;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user