diff --git a/types/clean-css/clean-css-tests.ts b/types/clean-css/clean-css-tests.ts index 6c01ba1158..98049b3ef6 100644 --- a/types/clean-css/clean-css-tests.ts +++ b/types/clean-css/clean-css-tests.ts @@ -1,6 +1,5 @@ // Original by Tanguy Krotoff // Updated by Andrew Potter -// TypeScript Version: 2.4 import * as CleanCSS from 'clean-css'; @@ -97,16 +96,3 @@ CleanCssOptions = { returnPromise: false }; new CleanCSS(CleanCssOptions).minify(source, (error: any, minified: CleanCSS.Output): void => { console.log(minified.styles); }); - -// type conversion -CleanCssOptions = {}; -// in this case, the compiler will think its an OptionsOutput -// so if we want to make it a promise, we will need to cast it specifically its a promise type return -(CleanCssOptions = CleanCssOptions as CleanCSS.OptionsPromise).returnPromise = true; -new CleanCSS(CleanCssOptions).minify(source) - .then((minified: CleanCSS.Output): void => { - console.log(minified.styles); - }).catch((error: any): void => { - console.log(error); - } -);