It seem typescript doesn't currently have the new object types in ECMAScript 2015 (6th Edition, ECMA-262). Here is my code:
const SkipAny: string = requestBody.SkipAny;
CurTester.SkipAny = SkipAny.map((value)=>{return new RegExp(value)});
The error I get is:
TS2339:Property 'map' does not exist on type 'string'
I would like to find a work around for this but I do want to use map. Is there anyway to ignore this rule in tslint?
Turns out the error is correct, I should had used array:
const SkipAny: string [] = requestBody.SkipAny;
CurTester.SkipAny = SkipAny.map((value)=>{return new RegExp(value)});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With