#Transpiler error

10 messages · Page 1 of 1 (latest)

rustic rune
#

While trying to transpile my app I'm getting this error:

Types of parameters 'word' and 'value' are incompatible.
Type 'unknown' is not assignable to type 'string'.

return Array.from(badWordList).some((word: string) => message.toLowerCase().includes(word));```
`(word: string) => message.toLowerCase().includes(word)` is underlined.

While I was able to solve other type issues, such as
```const adminAuthList = new Set(fs.readFileSync("adminlist.txt", "utf8").split("\n").map(line => line.trim()));```
`line` is missing a type, so I did

```const adminAuthList = new Set(fs.readFileSync("adminlist.txt", "utf8").split("\n").map((line: string) => line.trim()));```
and it worked...

This one I'm a bit confused. Thanks in advance.
abstract ferry
#

very odd

#

what's the type of badWordList?

rustic rune
#

badwordList is a Set<string>

abstract ferry
#

yeah that should definitely turn into a string array...

#

something very weird is going on here

rustic rune
#

woops

#

badwordList didn't have a type

#

I didn't check properly!