I am trying to use jsymal.safeDump(somedata). I have run
npm install --save-dev @types/js-yaml
Also have my tsconfig
{
"compilerOptions": {
"types": [
"cypress",
"js-yaml"
]
},
}
But whenever I use jsyaml.safeDump it shows
Property 'safeDump' does not exist on type 'typeof import("/myPath/node_modules/@types/js-yaml/index")
It can be solved using @ts-ignore
But is there any other way I can use safeDump without ignoring typescript?
I think
safeDump()is deprecated from thejs-yamlversion 4.x. To usesafeDump()with type seftey use thejs-yamlversion 3.x with supported type module.https://www.npmjs.com/package/js-yaml/v/3.14.1