X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fplugins.ts;h=d2fc0393623012de00ecf12b612586c580a0bd9a;hb=b763f88dd0f455ce0ccae9cb81182c985a47c101;hp=3af72547b349630eaa7ecc72aba836344dcc61bc;hpb=7cde3b9c2e84ea20bb0aae4544598483cde9e22c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/plugins.ts b/server/helpers/custom-validators/plugins.ts index 3af72547b..d2fc03936 100644 --- a/server/helpers/custom-validators/plugins.ts +++ b/server/helpers/custom-validators/plugins.ts @@ -14,7 +14,7 @@ function isPluginTypeValid (value: any) { function isPluginNameValid (value: string) { return exists(value) && validator.isLength(value, PLUGINS_CONSTRAINTS_FIELDS.NAME) && - validator.matches(value, /^[a-z\-]+$/) + validator.matches(value, /^[a-z-0-9]+$/) } function isNpmPluginNameValid (value: string) { @@ -146,8 +146,8 @@ function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginT } function isLibraryCodeValid (library: any) { - return typeof library.register === 'function' - && typeof library.unregister === 'function' + return typeof library.register === 'function' && + typeof library.unregister === 'function' } export {