1
0
Fork 0
mirror of synced 2024-06-27 18:40:42 +12:00

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 f3ba6552f0
commit 30f054090f

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)