diff --git a/src/benchmark/benchmark.ts b/src/benchmark/benchmark.ts index b5acc54..b77008d 100644 --- a/src/benchmark/benchmark.ts +++ b/src/benchmark/benchmark.ts @@ -1,8 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; -import { Transforms, RunTestcaseOptions, InlineLists, BrowserOptions, Browser } from '../types'; +import { Transforms, RunTestcaseOptions, InlineLists, BrowserOptions, Browser, emptyOpts } from '../types'; import * as Visit from './visit'; -import chalk from 'chalk'; import * as Transform from '../transform'; import { compileToStringSync } from 'node-elm-compiler'; import * as Post from '../postprocess'; @@ -251,26 +250,6 @@ export const run = async function ( - -const emptyOpts: Transforms = { - replaceVDomNode: false, - variantShapes: false, - inlineNumberToString: false, - inlineFunctions: false, - inlineEquality: false, - listLiterals: false, - passUnwrappedFunctions: false, - arrowFns: false, - shorthandObjectLiterals: false, - objectUpdate: false, - unusedValues: false, - replaceListFunctions: false, - replaceStringFunctions: false, - recordUpdates: false, - v8Analysis: false, - replacements: null -}; - const breakdown = function ( options: Transforms ): { name: string; options: Transforms }[] { diff --git a/src/types.ts b/src/types.ts index 6730328..879b928 100644 --- a/src/types.ts +++ b/src/types.ts @@ -75,6 +75,28 @@ export enum Browser { export const unallowedChars = /[^A-Za-z0-9]/g; + +export const emptyOpts: Transforms = { + replaceVDomNode: false, + variantShapes: false, + inlineNumberToString: false, + inlineFunctions: false, + inlineEquality: false, + listLiterals: false, + passUnwrappedFunctions: false, + arrowFns: false, + shorthandObjectLiterals: false, + objectUpdate: false, + unusedValues: false, + replaceListFunctions: false, + replaceStringFunctions: false, + recordUpdates: false, + v8Analysis: false, + fastCurriedFns: false, + replacements: null +}; + + export function toolDefaults(o3Enabled: boolean, replacements: { string: string } | null): Transforms { return { replaceVDomNode: false, @@ -112,7 +134,7 @@ export function benchmarkDefaults(o3Enabled: boolean, replacements: { string: st objectUpdate: false, unusedValues: false, replaceListFunctions: true, - replaceStringFunctions: true, + replaceStringFunctions: false, recordUpdates: o3Enabled, v8Analysis: false, fastCurriedFns: true,