Skip to content

Commit

Permalink
feat: Make (Big_map, Map) argument optional
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Mar 10, 2022
1 parent 9dfe3a3 commit b15eaa1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions documentation/docs/values.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ console.log(Unit().toJSON()); // { prim: 'Unit' }
```ts
import { Left, Nat } from '@tezwell/michelson-sdk';

const or_value = Left(Nat(1);
const or_value = Left(Nat(1));

// Micheline
console.log(or_value.toMicheline()); // Left 1
Expand All @@ -288,7 +288,7 @@ console.log(or_value.toJSON()); // { prim: 'Left', args: [{ int: '1' }
```ts
import { Right, Nat } from '@tezwell/michelson-sdk';

const or_value = Right(Nat(1);
const or_value = Right(Nat(1));

// Micheline
console.log(or_value.toMicheline()); // Right 1
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": "@tezwell/michelson-sdk",
"version": "0.4.1",
"version": "0.4.2",
"description": "Michelson SDK is a framework for generating Michelson values and types from Javascript.",
"keywords": [
"Tezos",
Expand Down
6 changes: 5 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ function generateBundle(entryPoints) {
* Clean UP build files
*/
function cleanUP() {
fs.rmSync(DIST_FOLDER, { recursive: true, force: true });
try {
fs.rmdirSync(DIST_FOLDER, { recursive: true, force: true });
} catch {
// Ignore error
}
}
2 changes: 1 addition & 1 deletion src/literal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export const Set = List;
export const None = () => new Michelson_Literal(Prim.None);
export const Some = (element: IValue) => new Michelson_Literal_C1(Prim.Some, [element]);
export const Pair = (left: IValue, right: IValue) => new Michelson_Literal_C1(Prim.Pair, [left, right]);
export const Map = (elements: IValue[][]) => new Michelson_Map(elements);
export const Map = (elements: IValue[][] = []) => new Michelson_Map(elements);
export const Big_map = Map;
export const Lambda = (code: MichelsonMicheline | MichelsonJSON) => buildLambda(code);
export const Left = (value: IValue) => new Michelson_Literal_C1(Prim.Left, [value]);
Expand Down

0 comments on commit b15eaa1

Please sign in to comment.