MCPcopy Create free account
hub / github.com/subquery/subql / validateObject

Function validateObject

packages/common/src/project/utils.ts:202–208  ·  view source on GitHub ↗
(object: any, errorMessage = 'failed to validate object.')

Source from the content-addressed store, hash-verified

200}
201
202export 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
210export function extensionIsTs(ext: string): boolean {
211 return ext === '.ts';

Callers 2

validateMethod · 0.90
validateMethod · 0.90

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected