Skip to content

Commit

Permalink
@field({type: String}) -> @field({type: 'string'})
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-pousette committed Aug 30, 2022
1 parent 1d27889 commit 7078644
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SomeClass
@field({type: 'u64'})
y: bigint

@field({type: 'String'})
@field({type: 'string'})
z: string

@field({type: vec('u32')})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-xyz/borsh",
"version": "3.0.0",
"version": "3.1.0",
"readme": "README.md",
"homepage": "https://github.com/dao-xyz/borsh-ts#README",
"description": "Binary Object Representation Serializer for Hashing simplified with decorators",
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ describe("enum", () => {

test("enum string variant", () => {
class Ape {
@field({ type: "String" })
@field({ type: "string" })
name: string;

constructor(name?: string) {
Expand Down Expand Up @@ -1214,12 +1214,12 @@ describe("Validation", () => {
}

class A extends Super {
@field({ type: "String" })
@field({ type: "string" })
string: string;
}

class B extends Super {
@field({ type: "String" })
@field({ type: "string" })
string: string;
}
expect(() => validate(Super)).toThrowError(BorshError);
Expand Down Expand Up @@ -1301,12 +1301,12 @@ describe("Validation", () => {
}

class A extends TestStruct {
@field({ type: "String" })
@field({ type: "string" })
string: string = "A";
}

class B extends TestStruct {
@field({ type: "String" })
@field({ type: "string" })
string: string = "B";
}
expect(() =>
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type FieldType =
| "u512"
| "f32"
| "f64"
| "String"
| "string"
| Constructor<any>
| CustomField<any>
| WrappedType;
Expand Down

0 comments on commit 7078644

Please sign in to comment.