I have a simple RegEx pattern test that I'd like to run on a string; you can see this in the example below as the variable part.
When I do this, however, the red-squiggly line is indicating the error of:
Property 'test' does not exist on type 'string'.ts(2339)
I am using TS 3.2.2 and my tsconfig.json is rather unexciting:
{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es2017",
"noImplicitAny": true,
"outDir": "./lib",
"preserveConstEnums": true,
"removeComments": true,
"typeRoots": ["./node_modules/@types"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "**/*-spec.ts"]
}
Can anyone help me understand this? Clearly test IS a property on string!

