-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
Description
remotestorage.js/src/baseclient.ts
Lines 734 to 747 in be39e4e
declareType (alias: string, uriOrSchema: string|tv4.JsonSchema, schema?: tv4.JsonSchema): void { | |
let uri: string; | |
if (schema && typeof uriOrSchema === 'string') { | |
uri = uriOrSchema; | |
} else if (!schema && typeof uriOrSchema !== 'string') { | |
schema = uriOrSchema; | |
uri = this._defaultTypeURI(alias); | |
} else if (!schema && typeof uriOrSchema === 'string') { | |
throw new Error('declareType() requires a JSON Schema object to be passed, in order to validate object types/formats'); | |
} | |
BaseClient.Types.declare(this.moduleName, alias, uri, schema); | |
} |
I'm currently working on bringing remotestorage to Java (to learn the language) and noticed that there might be an error when schema is given but uriOrSchema is null.