Comparing version 1.0.1 to 1.1.0
@@ -8,2 +8,3 @@ 'use strict'; | ||
var INFREQUENT_CHARS = /[\\\/kwzq]+/ig; | ||
var DEFAULT_VARIABLE_CHARACTERS = '_eariotnslcu'; | ||
var BOUNDARY = /\b/; | ||
@@ -28,3 +29,4 @@ var USE_STRICT = 'use strict'; | ||
minLength: -1, | ||
type: 'gzip' | ||
type: 'gzip', | ||
variableCharacters: DEFAULT_VARIABLE_CHARACTERS, | ||
}; | ||
@@ -255,3 +257,3 @@ if (typeof options !== 'undefined') { | ||
Dedupe.prototype.translateNumberToVariable = function (num) { | ||
var letters = '_eariotnslcu'; | ||
var letters = this.options.variableCharacters || DEFAULT_VARIABLE_CHARACTERS; | ||
var base = letters.length; | ||
@@ -258,0 +260,0 @@ var rixit; // like 'digit', only in some non-decimal radix |
@@ -25,2 +25,6 @@ export interface DedupeOptions { | ||
minLength?: number; | ||
/** | ||
* Variable naming characters to use | ||
*/ | ||
variableCharacters?: string; | ||
} | ||
@@ -27,0 +31,0 @@ export interface StringReplacement { |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var INFREQUENT_CHARS = /[\\\/kwzq]+/ig; | ||
var DEFAULT_VARIABLE_CHARACTERS = '_eariotnslcu'; | ||
var BOUNDARY = /\b/; | ||
@@ -26,3 +27,4 @@ var USE_STRICT = 'use strict'; | ||
minLength: -1, | ||
type: 'gzip' | ||
type: 'gzip', | ||
variableCharacters: DEFAULT_VARIABLE_CHARACTERS, | ||
}; | ||
@@ -253,3 +255,3 @@ if (typeof options !== 'undefined') { | ||
Dedupe.prototype.translateNumberToVariable = function (num) { | ||
var letters = '_eariotnslcu'; | ||
var letters = this.options.variableCharacters || DEFAULT_VARIABLE_CHARACTERS; | ||
var base = letters.length; | ||
@@ -256,0 +258,0 @@ var rixit; // like 'digit', only in some non-decimal radix |
{ | ||
"name": "de-dupe", | ||
"bin": ".bin/de-dupe", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Deduplicate strings from javascript assets", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -37,2 +37,6 @@ import { | ||
minLength?: number; | ||
/** | ||
* Variable naming characters to use | ||
*/ | ||
variableCharacters?: string; | ||
} | ||
@@ -56,2 +60,3 @@ | ||
const INFREQUENT_CHARS = /[\\\/kwzq]+/ig; | ||
const DEFAULT_VARIABLE_CHARACTERS = '_eariotnslcu'; | ||
const BOUNDARY = /\b/; | ||
@@ -77,3 +82,4 @@ const USE_STRICT = 'use strict'; | ||
minLength: -1, | ||
type: 'gzip' | ||
type: 'gzip', | ||
variableCharacters: DEFAULT_VARIABLE_CHARACTERS, | ||
}; | ||
@@ -333,3 +339,3 @@ | ||
private translateNumberToVariable(num: number): string { | ||
const letters = '_eariotnslcu'; | ||
const letters = this.options.variableCharacters || DEFAULT_VARIABLE_CHARACTERS; | ||
const base = letters.length; | ||
@@ -336,0 +342,0 @@ let rixit; // like 'digit', only in some non-decimal radix |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var INFREQUENT_CHARS = /[\\\/kwzq]+/ig; | ||
var DEFAULT_VARIABLE_CHARACTERS = '_eariotnslcu'; | ||
var BOUNDARY = /\b/; | ||
@@ -28,3 +29,4 @@ var USE_STRICT = 'use strict'; | ||
minLength: -1, | ||
type: 'gzip' | ||
type: 'gzip', | ||
variableCharacters: DEFAULT_VARIABLE_CHARACTERS, | ||
}; | ||
@@ -255,3 +257,3 @@ if (typeof options !== 'undefined') { | ||
Dedupe.prototype.translateNumberToVariable = function (num) { | ||
var letters = '_eariotnslcu'; | ||
var letters = this.options.variableCharacters || DEFAULT_VARIABLE_CHARACTERS; | ||
var base = letters.length; | ||
@@ -258,0 +260,0 @@ var rixit; // like 'digit', only in some non-decimal radix |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95767
1989