Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8697

正規表現を使って文字列判定をする。

$
0
0

変数を含んだpathでも特定のpathが含まれているかを確認する場合。

const noCheckPaths = /api/v1/user/${userId}などの場合

noCheckPaths.map(o => (`^${o}$`)).some(o => RegExp(o).test(ctx.path))) 


Viewing all articles
Browse latest Browse all 8697

Trending Articles