RuiSiang / PoW-Shield

Useless template literal found JS-R1004
Anti-pattern
Minor
8 months ago8 months old
Template string can be replaced with regular string literal
 6  waf = Waf.getInstance()
 7})
 8
 9describe(`WAF`, () => {10  it('should detect malicious string', () => {
11    expect(waf.test('select column from database', [])).toEqual('116')
12  })
Template string can be replaced with regular string literal
 6  ratelimiter = RateLimiter.getInstance()
 7})
 8
 9describe(`Ratelimiter`, () => {10  it('should increase request count by 1 every time', async () => {
11    const result = await ratelimiter.process('test_ip', {
12      requests: 0,
Template string can be replaced with regular string literal
 9  solver = new Solver()
10})
11
12describe(`PoW service`, () => {13  let powData: any // skipcq: JS-0309, JS-0323
14  it('should be able to generate problems', () => {
15    powData = pow.getProblem()
Template string can be replaced with regular string literal
 7  return
 8})
 9
10describe(`NoSql`, () => {11  it('should be settable', async () => {
12    expect(await nosql.setNX('test', '0')).toStrictEqual('OK')
13  })
Template string can be replaced with regular string literal
 6  blacklist = Blacklist.getInstance()
 7})
 8
 9describe(`Blacklist`, () => {10  it('should pass ban list checking normally', async () => {
11    expect(await blacklist.check('test_ip')).toBeTruthy()
12  })