LoginSignup
0
0

More than 3 years have passed since last update.

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

Posted at

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

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

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0