diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-03 19:48:00 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-03 19:48:00 +0900 |
| commit | f11bdf36b9c75a3e10850e46ef045cf9675ab7f7 (patch) | |
| tree | a72f760e3f1f218f8830326c9ea8bea0289bc23d /src/api/models | |
| parent | wip (diff) | |
| download | sharkey-f11bdf36b9c75a3e10850e46ef045cf9675ab7f7.tar.gz sharkey-f11bdf36b9c75a3e10850e46ef045cf9675ab7f7.tar.bz2 sharkey-f11bdf36b9c75a3e10850e46ef045cf9675ab7f7.zip | |
wip
Diffstat (limited to 'src/api/models')
| -rw-r--r-- | src/api/models/app.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/models/app.ts b/src/api/models/app.ts index a947d88e4c..bf5dc80c2c 100644 --- a/src/api/models/app.ts +++ b/src/api/models/app.ts @@ -7,3 +7,7 @@ const collection = db.get('apps'); (collection as any).index('secret'); // fuck type definition export default collection as any; // fuck type definition + +export function isValidNameId(nameId: string): boolean { + return typeof nameId == 'string' && /^[a-zA-Z0-9\-]{3,30}$/.test(nameId); +} |