mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Updated option normalizers for stringArrayCallsTransform option
This commit is contained in:
@@ -18,7 +18,7 @@ import { SourceMapBaseUrlRule } from './normalizer-rules/SourceMapBaseUrlRule';
|
||||
import { SourceMapFileNameRule } from './normalizer-rules/SourceMapFileNameRule';
|
||||
import { SplitStringsChunkLengthRule } from './normalizer-rules/SplitStringsChunkLengthRule';
|
||||
import { StringArrayRule } from './normalizer-rules/StringArrayRule';
|
||||
import { StringArrayCallsTransformRule } from './normalizer-rules/StringArrayCallsTransform';
|
||||
import { StringArrayCallsTransformThresholdRule } from './normalizer-rules/StringArrayCallsTransformThresholdRule';
|
||||
import { StringArrayEncodingRule } from './normalizer-rules/StringArrayEncodingRule';
|
||||
import { StringArrayWrappersChainedCallsRule } from './normalizer-rules/StringArrayWappersChainedCalls';
|
||||
|
||||
@@ -41,7 +41,7 @@ export class OptionsNormalizer implements IOptionsNormalizer {
|
||||
SourceMapFileNameRule,
|
||||
SplitStringsChunkLengthRule,
|
||||
StringArrayRule,
|
||||
StringArrayCallsTransformRule,
|
||||
StringArrayCallsTransformThresholdRule,
|
||||
StringArrayEncodingRule,
|
||||
StringArrayWrappersChainedCallsRule,
|
||||
];
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ import { IOptions } from '../../interfaces/options/IOptions';
|
||||
* @param {IOptions} options
|
||||
* @returns {IOptions}
|
||||
*/
|
||||
export const StringArrayCallsTransformRule: TOptionsNormalizerRule = (options: IOptions): IOptions => {
|
||||
if (!options.stringArrayCallsTransform) {
|
||||
export const StringArrayCallsTransformThresholdRule: TOptionsNormalizerRule = (options: IOptions): IOptions => {
|
||||
if (options.stringArrayCallsTransformThreshold === 0) {
|
||||
options = {
|
||||
...options,
|
||||
stringArrayCallsTransform: false,
|
||||
@@ -771,12 +771,12 @@ describe('OptionsNormalizer', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('stringArrayCallsTransformRule', () => {
|
||||
describe('stringArrayCallsTransformThresholdRule', () => {
|
||||
before(() => {
|
||||
optionsPreset = getNormalizedOptions({
|
||||
...getDefaultOptions(),
|
||||
stringArrayCallsTransform: false,
|
||||
stringArrayCallsTransformThreshold: 1
|
||||
stringArrayCallsTransform: true,
|
||||
stringArrayCallsTransformThreshold: 0
|
||||
});
|
||||
|
||||
expectedOptionsPreset = {
|
||||
|
||||
Reference in New Issue
Block a user