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;
|
||||
}
|
||||
|
||||
exports.propertyKeys = (obj) => Object.keys(obj).filter((key) => {
|
||||
return (key.charAt(0) !== '_' && key.charAt(0) !== '$');
|
||||
});
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief print
|
||||
|
|
|
@ -38,26 +38,12 @@
|
|||
|
||||
Object.defineProperty(Object.prototype, '_shallowCopy', {
|
||||
get() {
|
||||
var self = this;
|
||||
return this.propertyKeys.reduce(function (previous, key) {
|
||||
previous[key] = self[key];
|
||||
return require('internal').propertyKeys(this).reduce((previous, key) => {
|
||||
previous[key] = this[key];
|
||||
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"),
|
||||
internal = require("internal"),
|
||||
Edge,
|
||||
Graph,
|
||||
Vertex,
|
||||
|
@ -244,7 +245,7 @@ Edge.prototype.getProperty = function (name) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
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 () {
|
||||
return this._properties.propertyKeys;
|
||||
return internal.propertyKeys(this._properties);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue