arbundles
Advanced tools
Comparing version 0.6.8 to 0.6.9
{ | ||
"name": "arbundles", | ||
"version": "0.6.8", | ||
"version": "0.6.9", | ||
"description": "Arweave bundling library", | ||
@@ -65,3 +65,3 @@ "author": "Josh Benaron <joshbenaron@gmail.com>", | ||
"arweave-stream-tx": "^1.1.0", | ||
"avsc": "^5.7.1", | ||
"avro-js": "^1.11.0", | ||
"axios": "^0.21.3", | ||
@@ -68,0 +68,0 @@ "base64url": "^3.0.1", |
@@ -1,4 +0,3 @@ | ||
import * as avro from "avsc"; | ||
export declare const tagParser: avro.Type; | ||
export declare const tagsParser: avro.Type; | ||
export declare const tagParser: any; | ||
export declare const tagsParser: any; | ||
export declare function serializeTags(tags: { | ||
@@ -5,0 +4,0 @@ name: string; |
@@ -23,4 +23,4 @@ "use strict"; | ||
exports.serializeTags = exports.tagsParser = exports.tagParser = void 0; | ||
const avro = __importStar(require("avsc")); | ||
exports.tagParser = avro.Type.forSchema({ | ||
const avro = __importStar(require("avro-js")); | ||
exports.tagParser = avro.parse({ | ||
type: "record", | ||
@@ -33,3 +33,3 @@ name: "Tag", | ||
}); | ||
exports.tagsParser = avro.Type.forSchema({ | ||
exports.tagsParser = avro.parse({ | ||
type: "array", | ||
@@ -42,12 +42,8 @@ items: exports.tagParser, | ||
} | ||
let tagsBuffer; | ||
try { | ||
tagsBuffer = exports.tagsParser.toBuffer(tags); | ||
} | ||
catch (e) { | ||
if (!exports.tagsParser.isValid(tags)) { | ||
throw new Error("Incorrect tag format used. Make sure your tags are { name: string!, name: string! }[]"); | ||
} | ||
return Uint8Array.from(tagsBuffer); | ||
return Uint8Array.from(exports.tagsParser.toBuffer(tags)); | ||
} | ||
exports.serializeTags = serializeTags; | ||
//# sourceMappingURL=parser.js.map |
Sorry, the diff of this file is not supported yet
195863
2782
+ Addedavro-js@^1.11.0
+ Addedavro-js@1.11.3(transitive)
+ Addedunderscore@1.13.7(transitive)
- Removedavsc@^5.7.1
- Removedavsc@5.7.7(transitive)