mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix routing priority, add tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
d66e600e7a
commit
0ac54492d3
17 files changed
+68
-29
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user