mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
3cd4a1d186
|
@ -1726,6 +1726,10 @@ if (typeof SYS_OPTIONS !== 'undefined') {
|
||||||
delete global.SYS_OPTIONS;
|
delete global.SYS_OPTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.propertyKeys = (obj) => Object.keys(obj).filter((key) => {
|
||||||
|
return (key.charAt(0) !== '_' && key.charAt(0) !== '$');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief print
|
/// @brief print
|
||||||
|
|
|
@ -38,26 +38,12 @@
|
||||||
|
|
||||||
Object.defineProperty(Object.prototype, '_shallowCopy', {
|
Object.defineProperty(Object.prototype, '_shallowCopy', {
|
||||||
get() {
|
get() {
|
||||||
var self = this;
|
return require('internal').propertyKeys(this).reduce((previous, key) => {
|
||||||
return this.propertyKeys.reduce(function (previous, key) {
|
previous[key] = this[key];
|
||||||
previous[key] = self[key];
|
|
||||||
return previous;
|
return previous;
|
||||||
}, {});
|
}, {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief returns the property keys
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
Object.defineProperty(Object.prototype, 'propertyKeys', {
|
|
||||||
get() {
|
|
||||||
return Object.keys(this).filter(function (key) {
|
|
||||||
return (key.charAt(0) !== '_' && key.charAt(0) !== '$');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
var is = require("@arangodb/is"),
|
var is = require("@arangodb/is"),
|
||||||
|
internal = require("internal"),
|
||||||
Edge,
|
Edge,
|
||||||
Graph,
|
Graph,
|
||||||
Vertex,
|
Vertex,
|
||||||
|
@ -244,7 +245,7 @@ Edge.prototype.getProperty = function (name) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Edge.prototype.getPropertyKeys = function () {
|
Edge.prototype.getPropertyKeys = function () {
|
||||||
return this._properties.propertyKeys;
|
return internal.propertyKeys(this._properties);
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -431,7 +432,7 @@ Vertex.prototype.getProperty = function (name) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Vertex.prototype.getPropertyKeys = function () {
|
Vertex.prototype.getPropertyKeys = function () {
|
||||||
return this._properties.propertyKeys;
|
return internal.propertyKeys(this._properties);
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue