mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-25 21:43:47 -04:00
Add regexp event checking
This commit is contained in:
parent
485bc4d6cf
commit
bfe2ab0f1e
1 changed files with 2 additions and 0 deletions
|
@ -12,5 +12,7 @@ module.exports.scriptMatchesEventPrereqs = scriptMatchesEventPrereqs = (script,
|
|||
return false if ap.lessThanOrEqualTo? and not (v <= ap.lessThanOrEqualTo)
|
||||
return false if ap.containingString? and v?.search(ap.containingString) == -1
|
||||
return false if ap.notContainingString? and v?.search(ap.containingString) != -1
|
||||
return false if ap.containingRegexp? and v?.search(new RegExp(ap.containingRegexp)) == -1
|
||||
return false if ap.notContainingRegexp? and v?.search(new RegExp(ap.notContainingRegexp)) != -1
|
||||
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue