|
@@ -3,6 +3,7 @@ class OptionsNormalizer {
|
|
|
static normalize(options) {
|
|
|
let normalizedOptions = Object.assign({}, options);
|
|
|
normalizedOptions = OptionsNormalizer.unicodeArrayRule(normalizedOptions);
|
|
|
+ normalizedOptions = OptionsNormalizer.unicodeArrayThresholdRule(normalizedOptions);
|
|
|
normalizedOptions = OptionsNormalizer.selfDefendingRule(normalizedOptions);
|
|
|
return normalizedOptions;
|
|
|
}
|
|
@@ -18,6 +19,11 @@ class OptionsNormalizer {
|
|
|
}
|
|
|
return options;
|
|
|
}
|
|
|
+ static unicodeArrayThresholdRule(options) {
|
|
|
+ const minValue = 0, maxValue = 1;
|
|
|
+ options['unicodeArrayThreshold'] = Math.min(Math.max(options['unicodeArrayThreshold'], minValue), maxValue);
|
|
|
+ return options;
|
|
|
+ }
|
|
|
}
|
|
|
OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
|
|
|
encodeUnicodeLiterals: false,
|