For my current typescript project that heavily relies on Lodash with lodash.d.ts, I've encountered an issue with the _.split
function not being implemented yet. It's listed under the 'Later' section in the .ts file.
I need to find a workaround to prevent this from halting the build process, whether I'm building from Visual Studio or running it as a Grunt task.
This is the error message:
TS2339 Property 'split' does not exist on type 'LoDashStatic'
To give some context, here's the relevant code snippet:
private parseString(text: string) {
const arr = _.map(_.split(text, ","),
(x: string) => {
let index = x.indexOf(":");
return [
x.substring(0, index),
_.trim(x.substring(index + 1), "()")
];
});
console.log(_.fromPairs(arr));
return _.fromPairs(arr);
}
The functionality of the code is not affected, but it's frustrating that the build process gets interrupted due to this specific issue.