@project-serum/borsh
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -27,5 +27,5 @@ /// <reference types="node" /> | ||
} | ||
export declare function rustEnum<T>(variants: Layout<any>[], property?: string): EnumLayout<T>; | ||
export declare function rustEnum<T>(variants: Layout<any>[], property?: string, discriminant?: Layout<any>): EnumLayout<T>; | ||
export declare function array<T>(elementLayout: Layout<T>, length: number, property?: string): Layout<T[]>; | ||
export declare function map<K, V>(keyLayout: Layout<K>, valueLayout: Layout<V>, property?: string): Layout<Map<K, V>>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -168,4 +168,4 @@ "use strict"; | ||
exports.str = str; | ||
function rustEnum(variants, property) { | ||
const unionLayout = buffer_layout_1.union(buffer_layout_1.u8(), property); | ||
function rustEnum(variants, property, discriminant) { | ||
const unionLayout = buffer_layout_1.union(discriminant !== null && discriminant !== void 0 ? discriminant : buffer_layout_1.u8(), property); | ||
variants.forEach((variant, index) => unionLayout.addVariant(index, variant, variant.property)); | ||
@@ -172,0 +172,0 @@ return unionLayout; |
{ | ||
"name": "@project-serum/borsh", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Serum Borsh", | ||
@@ -22,3 +22,3 @@ "main": "dist/lib/index.js", | ||
"clean": "rm -rf dist", | ||
"prepare": "run-s clean build" | ||
"prepare": "yarn clean && yarn build" | ||
}, | ||
@@ -25,0 +25,0 @@ "dependencies": { |
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
118078