Skip to content

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
esarbanis committed Dec 13, 2017
1 parent 069189f commit c82d140
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 155 deletions.
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const { statSync, utimesSync, writeFileSync } = require('fs');
const { fileSync } = require('tmp');

function sanitize(input) {
return basename(input)
.replace(extname(input), '')
.replace(/[^a-zA-Z_$0-9]+/g, '_')
.replace(/^_/, '')
.replace(/_$/, '')
.replace(/^(\d)/, '_$1');
return basename(input).
replace(extname(input), '').
replace(/[^a-zA-Z_$0-9]+/g, '_').
replace(/^_/, '').
replace(/_$/, '').
replace(/^(\d)/, '_$1');
}

function capitalize(str) {
Expand All @@ -26,7 +26,7 @@ module.exports = function(source, map) {
options.filename = this.resourcePath;
options.format = this.version === 1 ? options.format || 'cjs' : 'es';
options.shared =
options.format === 'es' && require.resolve('svelte/shared.js');
options.format === 'es' && require.resolve('svelte/shared.js');

if (options.emitCss) options.css = false;

Expand All @@ -47,8 +47,8 @@ module.exports = function(source, map) {

callback(null, code, map);
}, err => callback(err)).catch(err => {
// wrap error to provide correct
// context when logging to console
// wrap error to provide correct
// context when logging to console
callback(new Error(`${err.name}: ${err.toString()}`));
});
};
Loading

0 comments on commit c82d140

Please sign in to comment.