Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const setSync = (path, attrs) =>
{
const success = fswin.setAttributesSync( path, convertAttrs.to(attrs) );
if (success === false)
{
// fswin does not return an error -- problem could be ENOENT,EPERM,etc
throw new Error("unknown erorr");
}
};
deps.map(dep =>
fswin.setAttributesSync(dep.path, {IS_HIDDEN: hidden}) ?
Promise.resolve(Object.assign(dep, {hidden})) :
Promise.reject(new Error(`Failed to modify dir attr: ${dep.path}`))
)