@zxcvbn-ts/dictionary-compression
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,3 +0,3 @@ | ||
declare function compress(data: string[]): string; | ||
declare function compress(data: string[]): string | string[]; | ||
export { compress as default }; |
{ | ||
"name": "@zxcvbn-ts/dictionary-compression", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -1,4 +0,1 @@ | ||
import { compressSync, strToU8 } from 'fflate' | ||
import { encodeBase85 } from '@alttiri/base85' | ||
const isCompactDoubleQuotedString = (string: string) => { | ||
@@ -38,16 +35,7 @@ // eslint-disable-next-line no-control-regex | ||
return deltas | ||
return deltas.join('') | ||
} | ||
export default function compress(data: string[]) { | ||
const compressedWithPrefix = compressWithPrefix(data) | ||
const compressedWithGzip = compressSync( | ||
strToU8(compressedWithPrefix.join('')), | ||
{ | ||
level: 9, | ||
mem: 12, | ||
}, | ||
) | ||
return encodeBase85(compressedWithGzip) | ||
return compressWithPrefix(data) | ||
} |
@@ -1,8 +0,3 @@ | ||
import { decompressSync, strFromU8 } from 'fflate' | ||
import { decodeBase85 } from '@alttiri/base85' | ||
export default function decompress(encodedString: string) { | ||
const decoded = decodeBase85(encodedString) | ||
const decompressedBuffer = decompressSync(decoded) | ||
const decompressedArray = strFromU8(decompressedBuffer).split(/([A-Z])/g) | ||
const decompressedArray = encodedString.split(/([A-Z])/g) | ||
const decompressedData = [] | ||
@@ -9,0 +4,0 @@ let last = '' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
15549
14
183