@xyo-network/serialization
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -47,2 +47,3 @@ /// <reference types="node" /> | ||
hydrate<T extends IXyoSerializableObject>(deserializable: IParseResult): T; | ||
parse(src: Buffer): IParseResult; | ||
arrayOf<T extends IXyoSerializableObject>(tCollection: T[]): IXyoSerializableObject; | ||
@@ -49,0 +50,0 @@ typedArrayOf<T extends IXyoSerializableObject>(tCollection: T[]): IXyoSerializableObject; |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Monday, 10th December 2018 5:04:28 pm | ||
* @Last modified time: Wednesday, 12th December 2018 12:17:05 pm | ||
* @License: All Rights Reserved | ||
@@ -11,0 +11,0 @@ * @Copyright: Copyright XY | The Findables Company |
/// <reference types="node" /> | ||
import { XyoBaseSerializable } from './base-serializable'; | ||
import { IXyoSerializableObject, IParseResult, IXyoSerializationService, IXyoObjectSchema } from '../@types'; | ||
import { IXyoSerializableObject, IParseResult, IXyoSerializationService } from '../@types'; | ||
import { ParseQuery } from './parse-query'; | ||
export declare class XyoTreeIterator extends XyoBaseSerializable implements IXyoSerializableObject { | ||
private readonly serializationService; | ||
private readonly parseResult; | ||
constructor(schema: IXyoObjectSchema, parseResult: IParseResult); | ||
constructor(serializationService: IXyoSerializationService, parseResult: IParseResult); | ||
readonly schemaObjectId: number; | ||
getData(): Buffer; | ||
query(): ParseQuery; | ||
hydrate<T extends IXyoSerializableObject>(serializationService: IXyoSerializationService): T; | ||
hydrate<T extends IXyoSerializableObject>(): T; | ||
} | ||
//# sourceMappingURL=tree-iterator.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Wednesday, 12th December 2018 11:01:51 am | ||
* @Last modified time: Wednesday, 12th December 2018 12:11:30 pm | ||
* @License: All Rights Reserved | ||
@@ -17,4 +17,5 @@ * @Copyright: Copyright XY | The Findables Company | ||
class XyoTreeIterator extends base_serializable_1.XyoBaseSerializable { | ||
constructor(schema, parseResult) { | ||
super(schema); | ||
constructor(serializationService, parseResult) { | ||
super(serializationService.schema); | ||
this.serializationService = serializationService; | ||
this.parseResult = parseResult; | ||
@@ -31,4 +32,4 @@ } | ||
} | ||
hydrate(serializationService) { | ||
return serializationService.hydrate(this.parseResult); | ||
hydrate() { | ||
return this.serializationService.hydrate(this.parseResult); | ||
} | ||
@@ -35,0 +36,0 @@ } |
export { IXyoSerializationService, IXyoSerializableObject, IXyoDeserializer, IXyoObjectSchema, IParseResult } from './@types'; | ||
export { XyoSerializationService } from './xyo-serialization-service'; | ||
export { parse } from './helpers/parse'; | ||
export { ParseQuery } from './helpers/parse-query'; | ||
export { XyoBaseSerializable } from './helpers/base-serializable'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Tuesday, 11th December 2018 9:53:24 am | ||
* @Last modified time: Wednesday, 12th December 2018 12:17:37 pm | ||
* @License: All Rights Reserved | ||
@@ -16,4 +16,2 @@ * @Copyright: Copyright XY | The Findables Company | ||
exports.XyoSerializationService = xyo_serialization_service_1.XyoSerializationService; | ||
var parse_1 = require("./helpers/parse"); | ||
exports.parse = parse_1.parse; | ||
var parse_query_1 = require("./helpers/parse-query"); | ||
@@ -20,0 +18,0 @@ exports.ParseQuery = parse_query_1.ParseQuery; |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { BufferOrString, IXyoSerializationService, IXyoSerializableObject, IXyoDeserializer, IXyoObjectSchema, IParseResult } from "./@types"; | ||
@@ -11,2 +12,3 @@ import { XyoBase } from '@xyo-network/base'; | ||
deserialize(deserializable: BufferOrString): XyoTreeIterator; | ||
parse(src: Buffer): IParseResult; | ||
hydrate<T extends IXyoSerializableObject>(deserializable: IParseResult): T; | ||
@@ -13,0 +15,0 @@ arrayOf<T extends IXyoSerializableObject>(tCollection: T[]): IXyoSerializableObject; |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Wednesday, 12th December 2018 11:03:10 am | ||
* @Last modified time: Wednesday, 12th December 2018 12:16:41 pm | ||
* @License: All Rights Reserved | ||
@@ -48,5 +48,8 @@ * @Copyright: Copyright XY | The Findables Company | ||
const src = deserializable instanceof Buffer ? deserializable : Buffer.from(deserializable, 'hex'); | ||
const parseResult = parse_1.parse(src, this.schema); | ||
return new tree_iterator_1.XyoTreeIterator(this.schema, parseResult); | ||
const parseResult = this.parse(src); | ||
return new tree_iterator_1.XyoTreeIterator(this, parseResult); | ||
} | ||
parse(src) { | ||
return parse_1.parse(src, this.schema); | ||
} | ||
hydrate(deserializable) { | ||
@@ -53,0 +56,0 @@ const src = Buffer.concat([ |
{ | ||
"name": "@xyo-network/serialization", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Serialization services in the xyo network", | ||
@@ -10,4 +10,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@xyo-network/base": "^0.6.0", | ||
"@xyo-network/errors": "^0.6.0", | ||
"@xyo-network/base": "^0.7.0", | ||
"@xyo-network/errors": "^0.7.0", | ||
"bn.js": "^4.11.8" | ||
@@ -25,3 +25,3 @@ }, | ||
}, | ||
"gitHead": "cbb5c5c20b4f081ebbd619dbdbd2ddace174db34" | ||
"gitHead": "95077b5c60fd3a2fe5252422f38346c47739271a" | ||
} |
@@ -7,3 +7,3 @@ /* | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Monday, 10th December 2018 5:04:28 pm | ||
* @Last modified time: Wednesday, 12th December 2018 12:17:05 pm | ||
* @License: All Rights Reserved | ||
@@ -73,2 +73,3 @@ * @Copyright: Copyright XY | The Findables Company | ||
hydrate<T extends IXyoSerializableObject>(deserializable: IParseResult): T | ||
parse(src: Buffer): IParseResult | ||
@@ -75,0 +76,0 @@ arrayOf<T extends IXyoSerializableObject>(tCollection: T[]): IXyoSerializableObject |
@@ -7,3 +7,3 @@ /* | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Wednesday, 12th December 2018 11:01:51 am | ||
* @Last modified time: Wednesday, 12th December 2018 12:11:30 pm | ||
* @License: All Rights Reserved | ||
@@ -19,4 +19,7 @@ * @Copyright: Copyright XY | The Findables Company | ||
constructor (schema: IXyoObjectSchema, private readonly parseResult: IParseResult) { | ||
super(schema) | ||
constructor ( | ||
private readonly serializationService: IXyoSerializationService, | ||
private readonly parseResult: IParseResult | ||
) { | ||
super(serializationService.schema) | ||
} | ||
@@ -36,5 +39,5 @@ | ||
public hydrate<T extends IXyoSerializableObject>(serializationService: IXyoSerializationService): T { | ||
return serializationService.hydrate<T>(this.parseResult) as T | ||
public hydrate<T extends IXyoSerializableObject>(): T { | ||
return this.serializationService.hydrate<T>(this.parseResult) as T | ||
} | ||
} |
@@ -7,3 +7,3 @@ /* | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Tuesday, 11th December 2018 9:53:24 am | ||
* @Last modified time: Wednesday, 12th December 2018 12:17:37 pm | ||
* @License: All Rights Reserved | ||
@@ -22,4 +22,3 @@ * @Copyright: Copyright XY | The Findables Company | ||
export { XyoSerializationService } from './xyo-serialization-service' | ||
export { parse } from './helpers/parse' | ||
export { ParseQuery } from './helpers/parse-query' | ||
export { XyoBaseSerializable } from './helpers/base-serializable' |
@@ -7,3 +7,3 @@ /* | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Wednesday, 12th December 2018 11:03:10 am | ||
* @Last modified time: Wednesday, 12th December 2018 12:16:41 pm | ||
* @License: All Rights Reserved | ||
@@ -61,6 +61,10 @@ * @Copyright: Copyright XY | The Findables Company | ||
const src = deserializable instanceof Buffer ? deserializable : Buffer.from(deserializable, 'hex') | ||
const parseResult = parse(src, this.schema) | ||
return new XyoTreeIterator(this.schema, parseResult) | ||
const parseResult = this.parse(src) | ||
return new XyoTreeIterator(this, parseResult) | ||
} | ||
public parse(src: Buffer): IParseResult { | ||
return parse(src, this.schema) | ||
} | ||
public hydrate<T extends IXyoSerializableObject>(deserializable: IParseResult): T { | ||
@@ -67,0 +71,0 @@ const src = Buffer.concat([ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137412
2695
+ Added@xyo-network/base@0.7.0(transitive)
+ Added@xyo-network/errors@0.7.0(transitive)
- Removed@xyo-network/base@0.6.0(transitive)
- Removed@xyo-network/errors@0.6.0(transitive)
Updated@xyo-network/base@^0.7.0
Updated@xyo-network/errors@^0.7.0