Function
validateObject
(object: any, errorMessage = 'failed to validate object.')
Source from the content-addressed store, hash-verified
| 200 | } |
| 201 | |
| 202 | export function validateObject(object: any, errorMessage = 'failed to validate object.'): void { |
| 203 | const errors = validateSync(object, {whitelist: true, forbidNonWhitelisted: true}); |
| 204 | if (errors?.length) { |
| 205 | const errorMsgs = errors.map((e) => e.toString()).join('\n'); |
| 206 | throw new Error(`${errorMessage}\n${errorMsgs}`); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | export function extensionIsTs(ext: string): boolean { |
| 211 | return ext === '.ts'; |
Tested by
no test coverage detected