remove some extraneous logging

master
Valerie 2021-06-16 01:52:01 -04:00
parent 57172ce9a9
commit 79e550c915
5 changed files with 6 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "frigid", "name": "frigid",
"version": "1.3.6", "version": "1.3.7",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",
"license": "MIT", "license": "MIT",

View File

@ -57,7 +57,6 @@ function finalze(instance, filename) {
instance[PERSIST_LOCATION] = filename; instance[PERSIST_LOCATION] = filename;
walk(instance, (obj) => { walk(instance, (obj) => {
// console.log(obj instanceof Serializable)
obj[INVOKE_CTOR](); obj[INVOKE_CTOR]();
}); });

View File

@ -39,11 +39,11 @@ export default class Serializable {
} }
toJson() { toJson() {
if(this[DEBUG]) { // if(this[DEBUG]) {
return JSON.stringify(this.toSerializableObject(), null, 2); return JSON.stringify(this.toSerializableObject(), null, 2);
} else { // } else {
return JSON.stringify(this.toSerializableObject()); // return JSON.stringify(this.toSerializableObject());
} // }
} }
static fromJson(str: string, instances: Map<number, object> = new Map()) { static fromJson(str: string, instances: Map<number, object> = new Map()) {
@ -87,8 +87,6 @@ export default class Serializable {
if(obj instanceof Serializable) clone[Serializable.CLASS_REFERENCE] = obj.constructor.name; if(obj instanceof Serializable) clone[Serializable.CLASS_REFERENCE] = obj.constructor.name;
// console.log('recorded instance', newId, obj, instances);
return clone; return clone;
} }
@ -104,7 +102,6 @@ export default class Serializable {
} }
static fromSerializableObject(obj: any, instances: Map<number, object> = new Map()) { static fromSerializableObject(obj: any, instances: Map<number, object> = new Map()) {
// console.log('deserializing', obj);
if(obj[Serializable.CLASS_REFERENCE] !== this.name) return null; if(obj[Serializable.CLASS_REFERENCE] !== this.name) return null;
const transformValue = (val: any): any => { const transformValue = (val: any): any => {
@ -144,7 +141,6 @@ export default class Serializable {
constructedObject = clone; constructedObject = clone;
if(Serializable.INSTANCE_DECLARATION in obj) { if(Serializable.INSTANCE_DECLARATION in obj) {
// console.log('recording instance', obj[Serializable.INSTANCE_DECLARATION], constructedObject);
instances.set(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 secondPassObjectsCompleted = new Map();
const secondPass = (obj) => { const secondPass = (obj) => {
console.log('second passing', obj);
for(const key of Object.keys(obj)) { for(const key of Object.keys(obj)) {
if(key === Serializable.INSTANCE_DECLARATION) delete obj[key]; if(key === Serializable.INSTANCE_DECLARATION) delete obj[key];
if(key === Serializable.CLASS_REFERENCE) delete obj[key]; if(key === Serializable.CLASS_REFERENCE) delete obj[key];

View File

@ -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' export {default as Frigid} from './Frigid.js'

View File

@ -1,11 +1,8 @@
export function reverseLookup<K, V>(map: Map<K, V>, value: V): K { export function reverseLookup<K, V>(map: Map<K, V>, value: V): K {
// console.log('searching for', value, 'in', map);
for (const [k, v] of map) { for (const [k, v] of map) {
if (v === value) { if (v === value) {
// console.log('found in key', k);
return k; return k;
} }
} }
// console.log(value, 'not found')
return null; return null;
} }