Skip to content

Commit

Permalink
Update constants lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Duberstein committed Dec 6, 2019
1 parent e79954b commit 918b821
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/json/src/json-converter.js
Expand Up @@ -10,7 +10,7 @@

import assert from './utils/assert';
import JSONConfiguration from './json-configuration';
import { instantiateClass } from './helpers/instantiate-class';
import {instantiateClass} from './helpers/instantiate-class';
import parseJSON from './helpers/parse-json';

const isObject = value => value && typeof value === 'object';
Expand All @@ -21,13 +21,13 @@ export default class JSONConverter {
constructor(props) {
this.log = console; // eslint-disable-line
this.configuration = {};
this.onJSONChange = () => { };
this.onJSONChange = () => {};
this.json = null;
this.convertedJson = null;
this.setProps(props);
}

finalize() { }
finalize() {}

setProps(props) {
// HANDLE CONFIGURATION PROPS
Expand Down Expand Up @@ -102,17 +102,17 @@ function convertJSONRecursively(json, key, configuration) {

// Returns true if an object has a `type` field
function isClassInstance(json, configuration) {
const { typeKey } = configuration;
const {typeKey} = configuration;
return isObject(json) && Boolean(json[typeKey]);
}

function convertClassInstance(json, configuration) {
// Extract the class type field
const { typeKey } = configuration;
const {typeKey} = configuration;
const type = json[typeKey];

// Prepare a props object and ensure all values have been converted
let props = { ...json };
let props = {...json};
delete props[typeKey];

props = convertPlainObject(props, configuration);
Expand Down

0 comments on commit 918b821

Please sign in to comment.