fix routing priority, add tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2020-12-10 15:20:00 -05:00
1 parent d66e600e7a
commit 0ac54492d3
17 files changed
+68 -29

No files matched your search

+6
View File
@@ -16,6 +16,8 @@ export interface LensExtensionManifest {
lens?: object; // fixme: add more required fields for validation
}
const ExtensionNameSchema = /^@[a-z0-9][_-a-z0-9]*\/[a-z0-9][_-a-z0-9]*$/i;
export class LensExtension {
readonly id: LensExtensionId;
readonly manifest: LensExtensionManifest;
@@ -25,6 +27,10 @@ export class LensExtension {
@observable isEnabled = false;
constructor({ id, manifest, manifestPath, isBundled }: InstalledExtension) {
if (!manifest.name.match(ExtensionNameSchema)) {
throw new TypeError("extension name must be '@<org>/<name>'");
}
this.id = id;
this.manifest = manifest;
this.manifestPath = manifestPath;