Skip to content

Commit

Permalink
remove compatibilityGuartd helper
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Jan 13, 2023
1 parent 7dccc55 commit e56f305
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
15 changes: 1 addition & 14 deletions scripts/build-funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ import path from 'path';
import { minify } from 'terser';
import { addCall, attachDependencies } from '../src/helpers/injector';
import { writeFile } from './helpers';
import { checkCompatibility } from '../src/helpers';

/**
* Creates compatibility guard string
* to be injected into scriptlets
*
* @returns {string}
*/
function prepareCompatibilityGuard() {
const compatibilityGuard = checkCompatibility;
const compatibilityGuardString = attachDependencies(compatibilityGuard);
return `${compatibilityGuardString}\n${compatibilityGuard.name}()`;
}

/**
* Method creates string for file with scriptlets functions,
Expand All @@ -41,7 +28,7 @@ function prepareCompatibilityGuard() {
*/
const getScriptletFunctionsString = () => {
function wrapInFunc(name, code) {
return `function ${name}(source, args){\n${prepareCompatibilityGuard()}\n${code}\n}`;
return `function ${name}(source, args){\n${code}\n}`;
}
// we require scriptlets list dynamically, because scriptletsList file can be not built in the
// moment of this script execution
Expand Down
37 changes: 0 additions & 37 deletions src/helpers/check-compatibility.js

This file was deleted.

1 change: 0 additions & 1 deletion src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ export * from './parse-flags';
export * from './parse-keyword-value';
export * from './random-id';
export * from './throttle';
export * from './check-compatibility';

0 comments on commit e56f305

Please sign in to comment.