chore: formatting
This commit is contained in:
parent
5b1b9442c7
commit
937dca2657
|
@ -90,21 +90,6 @@ let numericUid = 1;
|
|||
|
||||
export class Entity extends decorate(Resource) {
|
||||
|
||||
static jsonWithDefaults(json) {
|
||||
if ('undefined' === typeof json) {
|
||||
return;
|
||||
}
|
||||
const pristine = JSON.parse(JSON.stringify(json));
|
||||
for (const type in json.traits) {
|
||||
if (!hasTrait(type)) {
|
||||
continue;
|
||||
}
|
||||
const Trait = lookupTrait(type);
|
||||
pristine.traits[type] = merge({}, Trait.defaultJSON(), json.traits[type]);
|
||||
}
|
||||
return pristine;
|
||||
}
|
||||
|
||||
constructor(json, jsonext) {
|
||||
super();
|
||||
this._hooks = {};
|
||||
|
@ -254,6 +239,21 @@ export class Entity extends decorate(Resource) {
|
|||
return type in this._traits;
|
||||
}
|
||||
|
||||
static jsonWithDefaults(json) {
|
||||
if ('undefined' === typeof json) {
|
||||
return;
|
||||
}
|
||||
const pristine = JSON.parse(JSON.stringify(json));
|
||||
for (const type in json.traits) {
|
||||
if (!hasTrait(type)) {
|
||||
continue;
|
||||
}
|
||||
const Trait = lookupTrait(type);
|
||||
pristine.traits[type] = merge({}, Trait.defaultJSON(), json.traits[type]);
|
||||
}
|
||||
return pristine;
|
||||
}
|
||||
|
||||
mergeDiff() {
|
||||
if (!this.uri) {
|
||||
return this.toJSON();
|
||||
|
|
Loading…
Reference in New Issue
Block a user