From 937dca2657e113c0a1dc02c9cdee1892583dc017 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 16 Sep 2019 19:04:35 -0500 Subject: [PATCH] chore: formatting --- packages/entity/index.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/entity/index.js b/packages/entity/index.js index be688bc..e1a4985 100644 --- a/packages/entity/index.js +++ b/packages/entity/index.js @@ -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();