mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Merge pull request #307 from esben-semmle/js/unused-import
JS: make js/unused-local-variable flag import statements
This commit is contained in:
@@ -11,3 +11,16 @@ bindingset[s]
|
||||
string capitalize(string s) {
|
||||
result = s.charAt(0).toUpperCase() + s.suffix(1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pluralization for `n` occurrences of `noun`.
|
||||
*
|
||||
* For example, the pluralization of `"function"` for `n = 2` is `"functions"`.
|
||||
*/
|
||||
bindingset[noun, n]
|
||||
string pluralize(string noun, int n) {
|
||||
if n = 1 then
|
||||
result = noun
|
||||
else
|
||||
result = noun + "s"
|
||||
}
|
||||
Reference in New Issue
Block a user