@cityofzion/neo-js
Version:
Running NEO blockchain full node with Node.js and MongoDB.
13 lines (12 loc) • 343 B
text/typescript
export class EndpointValidator {
static validateArray(endpoints: object[]) {
if (endpoints.length <= 0) {
throw new Error(`'endpoints' must be an non empty array.`)
}
endpoints.forEach((ep: any) => {
if (!ep.endpoint) {
throw new Error(`item of 'endpoints' contain 'endpoint' property.`)
}
})
}
}