shrink-string
Advanced tools
Comparing version 3.1.7 to 3.1.9
{ | ||
"name": "shrink-string", | ||
"description": "Tiny string compression module for Node.", | ||
"version": "3.1.7", | ||
"version": "3.1.9", | ||
"author": { | ||
@@ -14,3 +14,3 @@ "email": "zac@zacanger.com", | ||
"build": "tsc", | ||
"prebuild": "sortpack prettier --write src/*.ts && npm t", | ||
"prebuild": "sortpack && ts-standard --fix src/*.ts && npm t", | ||
"preversion": "npm run build", | ||
@@ -23,3 +23,3 @@ "test": "npm run test:tape", | ||
"type": "git", | ||
"url": "https://github.com/zacanger/shrink-string.git" | ||
"url": "git+https://github.com/zacanger/shrink-string.git" | ||
}, | ||
@@ -35,7 +35,7 @@ "bugs": "https://github.com/zacanger/shrink-string/issues", | ||
"devDependencies": { | ||
"@types/node": "20.3.3", | ||
"prettier": "2.8.8", | ||
"@types/node": "20.6.4", | ||
"sortpack": "2.3.4", | ||
"tape-async": "2.3.0", | ||
"typescript": "5.1.6" | ||
"ts-standard": "12.0.2", | ||
"typescript": "5.2.2" | ||
}, | ||
@@ -42,0 +42,0 @@ "engines": { |
@@ -1,21 +0,21 @@ | ||
import { gzip, gunzip } from 'zlib'; | ||
import { promisify } from 'util'; | ||
import { Buffer } from 'buffer'; | ||
import { gzip, gunzip } from 'zlib' | ||
import { promisify } from 'util' | ||
import { Buffer } from 'buffer' | ||
const gz = promisify(gzip); | ||
const ugz = promisify(gunzip); | ||
const gz = promisify(gzip) | ||
const ugz = promisify(gunzip) | ||
const compress = async (s: string = ''): Promise<string> => { | ||
const compressed = await gz(s); | ||
return Buffer.from(compressed).toString('base64'); | ||
}; | ||
const compressed = await gz(s) | ||
return Buffer.from(compressed).toString('base64') | ||
} | ||
const decompress = async (s: string = ''): Promise<string> => { | ||
const decompressed = await ugz(Buffer.from(Buffer.from(s, 'base64'))); | ||
return decompressed.toString(); | ||
}; | ||
const decompressed = await ugz(Buffer.from(Buffer.from(s, 'base64'))) | ||
return decompressed.toString() | ||
} | ||
export = { | ||
compress, | ||
decompress, | ||
}; | ||
decompress | ||
} |
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
11171
15
116