@aztec/foundation 0.29.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ /** Utility function to throw an error if a required value is missing. */
2
+ export declare function required<T>(value: T | undefined, errMsg?: string): T;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAKpE"}
@@ -0,0 +1,8 @@
1
+ /** Utility function to throw an error if a required value is missing. */
2
+ export function required(value, errMsg) {
3
+ if (value === undefined) {
4
+ throw new Error(errMsg || 'Value is required');
5
+ }
6
+ return value;
7
+ }
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdmFsaWRhdGlvbi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx5RUFBeUU7QUFDekUsTUFBTSxVQUFVLFFBQVEsQ0FBSSxLQUFvQixFQUFFLE1BQWU7SUFDL0QsSUFBSSxLQUFLLEtBQUssU0FBUyxFQUFFLENBQUM7UUFDeEIsTUFBTSxJQUFJLEtBQUssQ0FBQyxNQUFNLElBQUksbUJBQW1CLENBQUMsQ0FBQztJQUNqRCxDQUFDO0lBQ0QsT0FBTyxLQUFLLENBQUM7QUFDZixDQUFDIn0=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/foundation",
3
- "version": "0.29.0",
3
+ "version": "0.30.1",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "type": "module",
6
6
  "main": "./dest/index.js",
@@ -38,7 +38,8 @@
38
38
  "./committable": "./dest/committable/index.js",
39
39
  "./noir": "./dest/noir/index.js",
40
40
  "./testing": "./dest/testing/index.js",
41
- "./array": "./dest/array/index.js"
41
+ "./array": "./dest/array/index.js",
42
+ "./validation": "./dest/validation/index.js"
42
43
  },
43
44
  "scripts": {
44
45
  "build": "yarn clean && tsc -b",
@@ -61,7 +62,7 @@
61
62
  "rootDir": "./src"
62
63
  },
63
64
  "dependencies": {
64
- "@aztec/bb.js": "0.29.0",
65
+ "@aztec/bb.js": "0.30.1",
65
66
  "@koa/cors": "^4.0.0",
66
67
  "@noble/curves": "^1.2.0",
67
68
  "bn.js": "^5.2.1",
@@ -0,0 +1,7 @@
1
+ /** Utility function to throw an error if a required value is missing. */
2
+ export function required<T>(value: T | undefined, errMsg?: string): T {
3
+ if (value === undefined) {
4
+ throw new Error(errMsg || 'Value is required');
5
+ }
6
+ return value;
7
+ }