code review - static controller - test app id with regex

This commit is contained in:
Michael Shanks 2020-06-14 20:36:51 +01:00
parent ea3a8fd81a
commit f0ee729376
1 changed files with 1 additions and 6 deletions

View File

@ -66,9 +66,4 @@ exports.serveComponentLibrary = async function(ctx) {
await send(ctx, "/index.js", { root: componentLibraryPath })
}
const looksLikeAppId = appId => {
const allowedChars = "0123456789abcdef".split("")
return (
appId.length === 32 && !appId.split("").some(c => allowedChars.includes(c))
)
}
const looksLikeAppId = appId => /^[0-9a-f]{32}$/.test(appId)