diff --git a/package.json b/package.json index 8476d6a..4efdf8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frigid", - "version": "1.3.6", + "version": "1.3.7", "main": "out/index.js", "types": "out/index.d.ts", "license": "MIT", diff --git a/src/Frigid.ts b/src/Frigid.ts index b849a9d..0efd482 100644 --- a/src/Frigid.ts +++ b/src/Frigid.ts @@ -57,7 +57,6 @@ function finalze(instance, filename) { instance[PERSIST_LOCATION] = filename; walk(instance, (obj) => { - // console.log(obj instanceof Serializable) obj[INVOKE_CTOR](); }); diff --git a/src/Serializable.ts b/src/Serializable.ts index b5d9d2d..69f6dd1 100644 --- a/src/Serializable.ts +++ b/src/Serializable.ts @@ -39,11 +39,11 @@ export default class Serializable { } toJson() { - if(this[DEBUG]) { + // if(this[DEBUG]) { return JSON.stringify(this.toSerializableObject(), null, 2); - } else { - return JSON.stringify(this.toSerializableObject()); - } + // } else { + // return JSON.stringify(this.toSerializableObject()); + // } } static fromJson(str: string, instances: Map = new Map()) { @@ -86,8 +86,6 @@ export default class Serializable { } if(obj instanceof Serializable) clone[Serializable.CLASS_REFERENCE] = obj.constructor.name; - - // console.log('recorded instance', newId, obj, instances); return clone; } @@ -104,7 +102,6 @@ export default class Serializable { } static fromSerializableObject(obj: any, instances: Map = new Map()) { - // console.log('deserializing', obj); if(obj[Serializable.CLASS_REFERENCE] !== this.name) return null; const transformValue = (val: any): any => { @@ -144,7 +141,6 @@ export default class Serializable { constructedObject = clone; if(Serializable.INSTANCE_DECLARATION in obj) { - // console.log('recording instance', obj[Serializable.INSTANCE_DECLARATION], constructedObject); instances.set(obj[Serializable.INSTANCE_DECLARATION], constructedObject); } @@ -165,7 +161,6 @@ export default class Serializable { const secondPassObjectsCompleted = new Map(); const secondPass = (obj) => { - console.log('second passing', obj); for(const key of Object.keys(obj)) { if(key === Serializable.INSTANCE_DECLARATION) delete obj[key]; if(key === Serializable.CLASS_REFERENCE) delete obj[key]; diff --git a/src/index.ts b/src/index.ts index 656a6e1..bd7e168 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ -export {default as Serializable} from './Serializable.js'; +export {default as Serializable, DEBUG} from './Serializable.js'; export {default as Frigid} from './Frigid.js' \ No newline at end of file diff --git a/src/reverseLookup.ts b/src/reverseLookup.ts index 6176b61..7ac23bd 100644 --- a/src/reverseLookup.ts +++ b/src/reverseLookup.ts @@ -1,11 +1,8 @@ export function reverseLookup(map: Map, value: V): K { - // console.log('searching for', value, 'in', map); for (const [k, v] of map) { if (v === value) { - // console.log('found in key', k); return k; } } - // console.log(value, 'not found') return null; }