@ellipticltd/aml-utils 0.8.0-EN-2570.3 → 0.8.0

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.
Files changed (71) hide show
  1. package/.circleci/config.yml +4 -37
  2. package/.eslintrc +6 -30
  3. package/.idea/aml-utils.iml +8 -0
  4. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  5. package/.idea/misc.xml +6 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/.idea/workspace.xml +52 -0
  9. package/README.md +0 -39
  10. package/index.d.ts +1 -0
  11. package/index.js +8 -0
  12. package/lib/{middleware/middleware.js → middleware.js} +1 -1
  13. package/lib/{types/types.js → types.js} +2 -2
  14. package/lib/{validations/validations.ts → validations.js} +55 -75
  15. package/package.json +13 -28
  16. package/.huskyrc +0 -5
  17. package/.mocharc.json +0 -3
  18. package/.releaserc.json +0 -18
  19. package/commitlint.config.js +0 -1
  20. package/dist/errors/errors.d.ts +0 -9
  21. package/dist/errors/errors.js +0 -42
  22. package/dist/errors/errors.spec.d.ts +0 -1
  23. package/dist/errors/errors.spec.js +0 -23
  24. package/dist/file-parser/__tests/file-parser.spec.d.ts +0 -1
  25. package/dist/file-parser/__tests/file-parser.spec.js +0 -113
  26. package/dist/file-parser/__tests/parse-row.spec.d.ts +0 -1
  27. package/dist/file-parser/__tests/parse-row.spec.js +0 -29
  28. package/dist/file-parser/__tests/sanitize-rows.spec.d.ts +0 -1
  29. package/dist/file-parser/__tests/sanitize-rows.spec.js +0 -78
  30. package/dist/file-parser/errors.d.ts +0 -3
  31. package/dist/file-parser/errors.js +0 -11
  32. package/dist/file-parser/file-parser.d.ts +0 -8
  33. package/dist/file-parser/file-parser.js +0 -68
  34. package/dist/file-parser/parse-row.d.ts +0 -2
  35. package/dist/file-parser/parse-row.js +0 -39
  36. package/dist/file-parser/sanitzeRows.d.ts +0 -3
  37. package/dist/file-parser/sanitzeRows.js +0 -18
  38. package/dist/formatting/formatting.d.ts +0 -2
  39. package/dist/formatting/formatting.js +0 -17
  40. package/dist/formatting/formatting.spec.d.ts +0 -1
  41. package/dist/formatting/formatting.spec.js +0 -37
  42. package/dist/index.d.ts +0 -8
  43. package/dist/index.js +0 -20
  44. package/dist/middleware/middleware.d.ts +0 -4
  45. package/dist/middleware/middleware.js +0 -22
  46. package/dist/orm-helpers/ormHelpers.d.ts +0 -1
  47. package/dist/orm-helpers/ormHelpers.js +0 -17
  48. package/dist/orm-helpers/ormHelpers.spec.d.ts +0 -1
  49. package/dist/orm-helpers/ormHelpers.spec.js +0 -38
  50. package/dist/types/types.d.ts +0 -17
  51. package/dist/types/types.js +0 -203
  52. package/dist/validations/validations.d.ts +0 -5
  53. package/dist/validations/validations.js +0 -303
  54. package/dist/validations/validations.spec.d.ts +0 -1
  55. package/dist/validations/validations.spec.js +0 -276
  56. package/lib/errors/errors.spec.js +0 -37
  57. package/lib/file-parser/__tests/file-parser.spec.js +0 -101
  58. package/lib/file-parser/__tests/parse-row.spec.js +0 -35
  59. package/lib/file-parser/__tests/sanitize-rows.spec.js +0 -88
  60. package/lib/file-parser/errors.ts +0 -7
  61. package/lib/file-parser/file-parser.ts +0 -84
  62. package/lib/file-parser/parse-row.ts +0 -52
  63. package/lib/file-parser/sanitzeRows.ts +0 -32
  64. package/lib/formatting/formatting.spec.js +0 -45
  65. package/lib/index.ts +0 -17
  66. package/lib/orm-helpers/ormHelpers.spec.js +0 -41
  67. package/lib/validations/validations.spec.js +0 -355
  68. package/tsconfig.json +0 -26
  69. /package/lib/{errors/errors.js → errors.js} +0 -0
  70. /package/lib/{formatting/formatting.js → formatting.js} +0 -0
  71. /package/lib/{orm-helpers/ormHelpers.js → ormHelpers.js} +0 -0
package/dist/index.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ormHelpers = exports.middleware = exports.fileParser = exports.formatting = exports.errors = exports.validations = exports.types = void 0;
7
- const types_1 = __importDefault(require("./types/types"));
8
- exports.types = types_1.default;
9
- const validations_1 = __importDefault(require("./validations/validations"));
10
- exports.validations = validations_1.default;
11
- const errors_1 = __importDefault(require("./errors/errors"));
12
- exports.errors = errors_1.default;
13
- const formatting_1 = __importDefault(require("./formatting/formatting"));
14
- exports.formatting = formatting_1.default;
15
- const middleware_1 = __importDefault(require("./middleware/middleware"));
16
- exports.middleware = middleware_1.default;
17
- const ormHelpers_1 = __importDefault(require("./orm-helpers/ormHelpers"));
18
- exports.ormHelpers = ormHelpers_1.default;
19
- const file_parser_1 = __importDefault(require("./file-parser/file-parser"));
20
- exports.fileParser = file_parser_1.default;
@@ -1,4 +0,0 @@
1
- export function ensureType(type: any): (req: any, res: any, next: any, id: any, name: any) => any;
2
- export function ensureUUID(req: any, res: any, next: any, id: any, name: any): any;
3
- export function ensureHex32(req: any, res: any, next: any, id: any, name: any): any;
4
- export function ensureInteger(req: any, res: any, next: any, id: any, name: any): any;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- const T = require('../types/types');
3
- const ensureType = (type) => (req, res, next, id, name) => {
4
- let error;
5
- try {
6
- T.ensureType(type, id, `Invalid ${name}`);
7
- return next();
8
- }
9
- catch (error1) {
10
- error = error1;
11
- return next(error);
12
- }
13
- };
14
- const ensureUUID = ensureType('UUID');
15
- const ensureHex32 = ensureType('Hex32');
16
- const ensureInteger = ensureType('IntString');
17
- module.exports = {
18
- ensureType,
19
- ensureUUID,
20
- ensureHex32,
21
- ensureInteger,
22
- };
@@ -1 +0,0 @@
1
- export function includeNested(orm: any, models: any): any;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- const _ = require('lodash');
3
- const includeNested = (orm, models) => _.map(_.toPairs(models), (arg) => {
4
- const [modelName, inclusion] = arg;
5
- const include = includeNested(orm, inclusion);
6
- const model = orm[modelName];
7
- if (_.isEmpty(include)) {
8
- return model;
9
- }
10
- return {
11
- model,
12
- include,
13
- };
14
- });
15
- module.exports = {
16
- includeNested,
17
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,38 +0,0 @@
1
- "use strict";
2
- const { includeNested } = require('./ormHelpers');
3
- describe('ormIncludeNested', () => {
4
- const orm = {
5
- a: 'a',
6
- b: 'b',
7
- c: 'c',
8
- d: 'd',
9
- };
10
- describe('when passed an empty object', () => {
11
- it('returns an empty array', () => includeNested(orm, {}).should.deep.equal([]));
12
- });
13
- describe('when passed an object with no inclusions', () => {
14
- it('returns an array of just the key', () => includeNested(orm, {
15
- a: {},
16
- }).should.deep.equal(['a']));
17
- });
18
- describe('when passed a hierarchy of inclusions', () => {
19
- it('should nest them in sequelize style', () => includeNested(orm, {
20
- a: {
21
- b: {
22
- c: {},
23
- d: {},
24
- },
25
- },
26
- }).should.deep.equal([
27
- {
28
- model: 'a',
29
- include: [
30
- {
31
- model: 'b',
32
- include: ['c', 'd'],
33
- },
34
- ],
35
- },
36
- ]));
37
- });
38
- });
@@ -1,17 +0,0 @@
1
- declare const withNullable: {};
2
- export function parseType(str: any): any;
3
- export function parseType(str: any): any;
4
- export function parsedTypeCheck(type: any, obj: any): any;
5
- export function parsedTypeCheck(type: any, obj: any): any;
6
- export function typeCheck(type: any, obj: any): any;
7
- export function typeCheck(type: any, obj: any): any;
8
- export namespace opts {
9
- export { withNullable as customTypes };
10
- }
11
- export function ensureType(type: any, obj: any, msg: any): any;
12
- export function ensureType(type: any, obj: any, msg: any): any;
13
- export function checkArg(obj: any, prop: any, type: any, msg: any): any;
14
- export function checkArg(obj: any, prop: any, type: any, msg: any): any;
15
- export function checkArgs(input: any, types: any): void;
16
- export function checkArgs(input: any, types: any): void;
17
- export {};
@@ -1,203 +0,0 @@
1
- "use strict";
2
- const TC = require('type-check');
3
- const _ = require('lodash');
4
- const E = require('../errors/errors');
5
- const V = require('../validations/validations');
6
- const customTypes = {
7
- Integer: {
8
- typeOf: 'Number',
9
- validate(x) {
10
- return x % 1 === 0;
11
- },
12
- },
13
- IntString: {
14
- typeOf: 'String',
15
- validate: V.isInt,
16
- },
17
- BoolString: {
18
- typeOf: 'String',
19
- validate: V.isBoolean,
20
- },
21
- Hex32: {
22
- typeOf: 'String',
23
- validate(x) {
24
- return V.isHexadecimal(x) && x.length === 32;
25
- },
26
- },
27
- Email: {
28
- typeOf: 'String',
29
- validate: V.isEmail,
30
- },
31
- UUID: {
32
- typeOf: 'String',
33
- validate: V.isUUID,
34
- },
35
- UUIDv4: {
36
- typeOf: 'String',
37
- validate(x) {
38
- return V.isUUID(x, 4);
39
- },
40
- },
41
- JSON: {
42
- typeOf: 'String',
43
- validate: V.isJSON,
44
- },
45
- Url: {
46
- typeOf: 'String',
47
- validate: V.isURL,
48
- },
49
- DateString: {
50
- typeOf: 'String',
51
- validate: V.isDate,
52
- },
53
- NonEmptyArray: {
54
- typeOf: 'Array',
55
- validate: V.nonEmpty,
56
- },
57
- NonNullString: {
58
- typeOf: 'String',
59
- validate: V.nonEmpty,
60
- },
61
- CustomerReference: {
62
- typeOf: 'String',
63
- validate: V.isCustomerReference,
64
- },
65
- CustomerLabelName: {
66
- typeOf: 'String',
67
- validate: V.isCustomerLabelName,
68
- },
69
- BitcoinAddress: {
70
- typeOf: 'String',
71
- validate: V.bitcoin.isAddress,
72
- },
73
- EthereumAddress: {
74
- typeOf: 'String',
75
- validate: V.ethereum.isAddress,
76
- },
77
- EthereumTx: {
78
- typeOf: 'String',
79
- validate: V.ethereum.isTxHash,
80
- },
81
- EthereumBlockHash: {
82
- typeOf: 'String',
83
- validate: V.ethereum.isBlockHash,
84
- },
85
- EthereumWeiAmount: {
86
- typeOf: 'String',
87
- validate: V.ethereum.isValidWeiAmount,
88
- },
89
- EthereumAddressCode: {
90
- typeOf: 'String',
91
- validate: V.ethereum.isAddressCode,
92
- },
93
- MineId: {
94
- typeOf: 'String',
95
- validate(x) {
96
- return x === 'mine';
97
- },
98
- },
99
- BitcoinTxHash: {
100
- typeOf: 'String',
101
- validate: V.bitcoin.isTxHash,
102
- },
103
- BitcoinAddressArray: {
104
- typeOf: 'Array',
105
- validate(as) {
106
- return _.every(as, V.bitcoin.isAddress);
107
- },
108
- },
109
- BitcoinTxHashArray: {
110
- typeOf: 'Array',
111
- validate(as) {
112
- return _.every(as, V.bitcoin.isTxHash);
113
- },
114
- },
115
- BitcoinTxHex: {
116
- typeOf: 'String',
117
- validate: V.bitcoin.isTxHex,
118
- },
119
- BitcoinScriptHex: {
120
- typeOf: 'String',
121
- validate: V.bitcoin.isScriptHex,
122
- },
123
- BitcoinHDPath: {
124
- typeOf: 'String',
125
- validate: V.bitcoin.isHDPath,
126
- },
127
- BitcoinPublicKey: {
128
- typeOf: 'String',
129
- validate: V.bitcoin.isPublicKey,
130
- },
131
- BitcoinXpub: {
132
- typeOf: 'String',
133
- validate: V.bitcoin.isHDPublicKey,
134
- },
135
- BitcoinTxSignature: {
136
- typeOf: 'String',
137
- validate: V.bitcoin.isTxSignature,
138
- },
139
- BitcoinBlockHeight: {
140
- typeOf: 'Number',
141
- validate: V.bitcoin.isBlockHeight,
142
- },
143
- };
144
- // add support for nullable properties
145
- const withNullable = Object.keys(customTypes).reduce((acc, _type) => {
146
- acc[_type] = customTypes[_type];
147
- const { typeOf, validate } = customTypes[_type];
148
- // for every type, add Nullable+type. A nullable string can also be empty
149
- acc[`Nullable${_type}`] = Object.assign({}, customTypes[_type], {
150
- validate: (x) => x == null || (typeOf === 'String' && x === '') || validate(x),
151
- });
152
- return acc;
153
- }, {});
154
- module.exports = {
155
- parseType(str) {
156
- return TC.parseType(str);
157
- },
158
- parsedTypeCheck(type, obj) {
159
- return TC.parsedTypeCheck(type, obj, this.opts);
160
- },
161
- typeCheck(type, obj) {
162
- return TC.typeCheck(type, obj, this.opts);
163
- },
164
- opts: {
165
- customTypes: withNullable,
166
- },
167
- ensureType(type, obj, msg) {
168
- return V.ensure(this.typeCheck(type, obj), msg);
169
- },
170
- checkArg(obj, prop, type, msg) {
171
- let message;
172
- if (msg == null) {
173
- message = `Invalid ${prop}`;
174
- }
175
- else {
176
- message = msg;
177
- }
178
- this.ensureType(type, obj[prop], message);
179
- return obj[prop];
180
- },
181
- checkArgs(input, types) {
182
- const inputKeys = {};
183
- const [typ] = types;
184
- const fields = typ.of;
185
- let numInputKeys = 0;
186
- let numKeys;
187
- Object.keys(input).forEach((k) => {
188
- inputKeys[k] = true;
189
- numInputKeys += 1;
190
- });
191
- numKeys = 0;
192
- Object.keys(fields).forEach((key) => {
193
- const objTypes = fields[key];
194
- V.ensure(this.parsedTypeCheck(objTypes, input[key]), `Invalid ${key}`);
195
- if (inputKeys[key]) {
196
- numKeys += 1;
197
- }
198
- });
199
- if (!(typ.subset || numInputKeys === numKeys)) {
200
- throw new E.BadRequest('invalid extra arguments are present');
201
- }
202
- },
203
- };
@@ -1,5 +0,0 @@
1
- declare type Validations = {
2
- [key: string]: any;
3
- };
4
- declare const validations: Validations;
5
- export default validations;
@@ -1,303 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const V = require('validator');
4
- // @ts-ignore
5
- const _ = require('lodash');
6
- const { crypto: { Signature }, HDPrivateKey, HDPublicKey, PublicKey, Script, Transaction, } = require('bitcore-lib');
7
- const addressValidator = require('wallet-address-validator');
8
- const zilUtils = require('@zilliqa-js/util');
9
- const web3 = require('web3-utils');
10
- const stellarSDK = require('stellar-sdk');
11
- const E = require('../errors/errors');
12
- const validations = {
13
- _validate(Err, pred, x, msg) {
14
- if (pred(x)) {
15
- return x;
16
- }
17
- throw new Err(msg);
18
- },
19
- _validateArg(pred, x, msg) {
20
- return this._validate(E.InvalidArguments, pred, x, msg);
21
- },
22
- _tryCheck(fn, arg) {
23
- try {
24
- fn(arg);
25
- return true;
26
- }
27
- catch (error) {
28
- return false;
29
- }
30
- },
31
- exists(x) {
32
- return x != null;
33
- },
34
- nonEmpty(x) {
35
- return (x != null ? x.length : undefined) > 0;
36
- },
37
- isNonEmptyString(x) {
38
- // @ts-ignore
39
- return _.isString(x) && (x != null ? x.length : undefined) > 0;
40
- },
41
- ensureShortEnough(limit, x) {
42
- const l = x != null ? x.length : undefined;
43
- if (l <= limit) {
44
- return true;
45
- }
46
- throw new E.BadRequest(`Max query size exceeded: ${l} / ${limit}`);
47
- },
48
- ensure(crit, msg) {
49
- if (crit) {
50
- return true;
51
- }
52
- throw new E.BadRequest(msg);
53
- },
54
- argExists(x, msg) {
55
- return this._validateArg(this.exists, x, msg);
56
- },
57
- check: {
58
- matches(required, given, msg) {
59
- const newGiven = _.uniq(given);
60
- const crit = _.intersection(newGiven, required).length === given.length;
61
- if (crit) {
62
- return true;
63
- }
64
- throw new E.BadRequest(msg);
65
- },
66
- wasFound(type) {
67
- return (item) => {
68
- if (item == null) {
69
- throw new E.NotFound(`Unknown ${type}`);
70
- }
71
- else {
72
- return item;
73
- }
74
- };
75
- },
76
- wasCreated(msg) {
77
- return (arr) => {
78
- if (!arr[1]) {
79
- throw new E.BadRequest(msg);
80
- }
81
- else {
82
- return arr;
83
- }
84
- };
85
- },
86
- isTrue(crit, msg) {
87
- if (crit) {
88
- return true;
89
- }
90
- throw new E.BadRequest(msg);
91
- },
92
- isFalse(crit, msg) {
93
- if (!crit) {
94
- return true;
95
- }
96
- throw new E.BadRequest(msg);
97
- },
98
- },
99
- isCustomerReference(x) {
100
- return (_.isString(x)
101
- // @ts-ignore
102
- && (x != null ? x.length : undefined) > 0
103
- // @ts-ignore
104
- && (x != null ? x.length : undefined) <= 100);
105
- },
106
- isCustomerLabelName(x) {
107
- return (_.isString(x)
108
- // @ts-ignore
109
- && (x != null ? x.length : undefined) > 0
110
- // @ts-ignore
111
- && (x != null ? x.length : undefined) <= 50);
112
- },
113
- binanceCoin: {
114
- isAddress(str) {
115
- return /^(bnb)([a-z0-9]{39})$/.test(str);
116
- },
117
- isTxHash(str) {
118
- if (!V.isHexadecimal(str)) {
119
- return false;
120
- }
121
- return str.length === 64;
122
- },
123
- },
124
- bitcoin: {
125
- isAddress(str) {
126
- const network = process.env.BITCOIN_NETWORK === 'testnet' ? 'testnet' : 'prod';
127
- return typeof str === 'string' && addressValidator.validate(str.trim(), 'BTC', network);
128
- },
129
- isBech32Address(str) {
130
- return /^bc1[ac-hj-np-z02-9]{6,86}|^BC1[AC-HJ-NP-Z02-9]{6,86}/.test(str);
131
- },
132
- isHDPublicKey(str) {
133
- try {
134
- HDPublicKey(str);
135
- return true;
136
- }
137
- catch (error) {
138
- return false;
139
- }
140
- },
141
- isPublicKey(str) {
142
- try {
143
- PublicKey(str);
144
- return true;
145
- }
146
- catch (error) {
147
- return false;
148
- }
149
- },
150
- isTxHash(str) {
151
- if (!V.isHexadecimal(str)) {
152
- return false;
153
- }
154
- return str.length === 64;
155
- },
156
- isTxHex(str) {
157
- if (!V.isHexadecimal(str)) {
158
- return false;
159
- }
160
- try {
161
- Transaction(str);
162
- return true;
163
- }
164
- catch (error) {
165
- return false;
166
- }
167
- },
168
- isHDPath(str) {
169
- return HDPrivateKey.isValidPath(str);
170
- },
171
- isScriptHex(str) {
172
- if (!V.isHexadecimal(str)) {
173
- return false;
174
- }
175
- try {
176
- Script(str);
177
- return true;
178
- }
179
- catch (error) {
180
- return false;
181
- }
182
- },
183
- isTxSignature(str) {
184
- if (!V.isHexadecimal(str)) {
185
- return false;
186
- }
187
- try {
188
- const b = Buffer.from(str, 'hex');
189
- Signature.fromTxFormat(b);
190
- return true;
191
- }
192
- catch (error) {
193
- return false;
194
- }
195
- },
196
- isBlockHeight(obj) {
197
- return _.isInteger(+obj) && parseInt(obj, 10) >= 0;
198
- },
199
- },
200
- bitcoinCash: {
201
- isAddress(str) {
202
- return /^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bitcoincash:)?[q|p][a-z0-9]{41}$|^(BITCOINCASH:)?[Q|P][A-Z0-9]{41}$/.test(str);
203
- },
204
- isTxHash(str) {
205
- if (!V.isHexadecimal(str)) {
206
- return false;
207
- }
208
- return str.length === 64;
209
- },
210
- },
211
- ethereum: {
212
- isAddress(str) {
213
- return web3.isAddress(str);
214
- },
215
- isBlockHash(str) {
216
- return str.length === 66 && web3.isHexStrict(str);
217
- },
218
- isTxHash(str) {
219
- return str.length === 66 && web3.isHexStrict(str);
220
- },
221
- isAddressCode(str) {
222
- return web3.isHexStrict(str);
223
- },
224
- isValidWeiAmount(str) {
225
- try {
226
- web3.fromWei(str);
227
- return true;
228
- }
229
- catch (e) {
230
- return false;
231
- }
232
- },
233
- },
234
- horizen: {
235
- isAddress(str) {
236
- return addressValidator.validate(str, 'ZEN');
237
- },
238
- isTxHash(str) {
239
- if (!V.isHexadecimal(str)) {
240
- return false;
241
- }
242
- return str.length === 64;
243
- },
244
- },
245
- litecoin: {
246
- isAddress(str) {
247
- return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}$|^ltc1[ac-hj-np-z02-9]{6,86}$|^LTC1[AC-HJ-NP-Z02-9]{6,86}$/.test(str);
248
- },
249
- isTxHash(str) {
250
- if (!V.isHexadecimal(str)) {
251
- return false;
252
- }
253
- return str.length === 64;
254
- },
255
- },
256
- ripple: {
257
- isAddress(str) {
258
- return addressValidator.validate(str, 'XRP');
259
- },
260
- isTxHash(str) {
261
- if (!V.isHexadecimal(str)) {
262
- return false;
263
- }
264
- return str.length === 64;
265
- },
266
- },
267
- stellar: {
268
- isAddress(str) {
269
- return stellarSDK.StrKey.isValidEd25519PublicKey(str);
270
- },
271
- isTxHash(str) {
272
- if (!V.isHexadecimal(str)) {
273
- return false;
274
- }
275
- return str.length === 64;
276
- },
277
- },
278
- zcash: {
279
- isAddress(str) {
280
- return addressValidator.validate(str, 'ZEC');
281
- },
282
- isTxHash(str) {
283
- if (!V.isHexadecimal(str)) {
284
- return false;
285
- }
286
- return str.length === 64;
287
- },
288
- },
289
- zilliqa: {
290
- isAddress(str) {
291
- return zilUtils.validation.isBech32(str);
292
- },
293
- isTxHash(str) {
294
- return str.length === 66 && web3.isHexStrict(str);
295
- },
296
- },
297
- };
298
- Object.keys(V).forEach((k) => {
299
- const v = V[k];
300
- // don't trigger validation with null values (prevents swagger 500 error)
301
- validations[k] = (x) => (x === null ? false : v(x));
302
- });
303
- exports.default = validations;
@@ -1 +0,0 @@
1
- export {};