Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function cssModulesFlowTypesLoader(content) {
const tokens = getTokens(content);
// NOTE: We cannot use .emitFile as people might use this with devServer
// (e.g. in memory storage).
const outputPath = this.resourcePath + '.flow';
fs.writeFile(
outputPath,
printFlowDefinition(tokens, getLineSeparator(content)),
{},
function() {}
);
return content;
};
.then(res => {
if (res) {
const tokens = Object.keys(res);
const content = printFlowDefinition(
tokens,
this.eol || getLineSeparator(tokens[0])
);
resolve(content);
} else {
reject(res);
}
})
.catch(err => reject(err));
.then(res => {
if (res) {
const tokens = Object.keys(res);
const content = printFlowDefinition(
tokens,
this.eol || getLineSeparator(tokens[0])
);
resolve(content);
} else {
reject(res);
}
})
.catch(err => reject(err));