mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-09-11 12:15:24 +03:00
Remove unnecessary async-edness from Transform.transform
This commit is contained in:
parent
8e61bed99f
commit
54e36bbbe2
@ -186,7 +186,7 @@ export const run = async function (
|
||||
// },
|
||||
});
|
||||
|
||||
const transformed = await Transform.transform(
|
||||
const transformed = Transform.transform(
|
||||
instance.dir,
|
||||
source,
|
||||
path.join(instance.dir, instance.elmFile),
|
||||
@ -358,7 +358,7 @@ export const runWithBreakdown = async function (
|
||||
, gzip: options.gzip
|
||||
}
|
||||
)
|
||||
const transformed = await Transform.transform(
|
||||
const transformed = Transform.transform(
|
||||
instance.dir,
|
||||
source,
|
||||
path.join(instance.dir, instance.elmFile),
|
||||
@ -402,7 +402,7 @@ export const runWithBreakdown = async function (
|
||||
|
||||
let steps = breakdown(options.transforms);
|
||||
for (let i in steps) {
|
||||
const intermediate = await Transform.transform(
|
||||
const intermediate = Transform.transform(
|
||||
instance.dir,
|
||||
source,
|
||||
path.join(instance.dir, instance.elmFile),
|
||||
@ -469,7 +469,7 @@ export const runWithKnockout = async function (
|
||||
|
||||
fs.writeFileSync(path.join(instance.dir, 'output', 'elm.opt.js'), source);
|
||||
|
||||
const transformed = await Transform.transform(
|
||||
const transformed = Transform.transform(
|
||||
instance.dir,
|
||||
source,
|
||||
path.join(instance.dir, instance.elmFile),
|
||||
@ -518,7 +518,7 @@ export const runWithKnockout = async function (
|
||||
|
||||
let steps = knockout(options.transforms);
|
||||
for (let i in steps) {
|
||||
const intermediate = await Transform.transform(
|
||||
const intermediate = Transform.transform(
|
||||
instance.dir,
|
||||
source,
|
||||
path.join(instance.dir, instance.elmFile),
|
||||
|
@ -91,7 +91,7 @@ export async function run(
|
||||
throw new Error('Target JS file is empty.');
|
||||
}
|
||||
|
||||
const transformed = await Transform.transform(
|
||||
const transformed = Transform.transform(
|
||||
dirname,
|
||||
jsSource,
|
||||
elmFilePath,
|
||||
|
@ -33,13 +33,13 @@ export type Options = {
|
||||
verbose: boolean;
|
||||
};
|
||||
|
||||
export const transform = async (
|
||||
export const transform = (
|
||||
_dir: string,
|
||||
jsSource: string,
|
||||
elmfile: string | undefined,
|
||||
verbose: boolean,
|
||||
transforms: Transforms
|
||||
): Promise<string> => {
|
||||
): string => {
|
||||
let source = ts.createSourceFile('elm.js', jsSource, ts.ScriptTarget.ES2018);
|
||||
|
||||
let parsedVariants = primitives;
|
||||
|
Loading…
Reference in New Issue
Block a user