@vercel/stega
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -1,3 +0,53 @@ | ||
export * from './encode'; | ||
export * from './decode'; | ||
export * from './util'; | ||
/** | ||
* Encodes JSON as a hidden string | ||
* @param json - The JSON data to encode | ||
* @returns The hidden string | ||
*/ | ||
declare function vercelStegaEncode<T>(json: T): string; | ||
/** | ||
* Encodes JSON as a hidden string using the original logic | ||
* @param json - The JSON data to encode | ||
* @returns The hidden string | ||
* @deprecated | ||
*/ | ||
declare function legacyStegaEncode<T>(json: T): string; | ||
type SkipValue = 'auto' | boolean; | ||
/** | ||
* Adds an encoded JSON object to a string as hidden characters | ||
* @param string - The string the JSON will be added to | ||
* @param json - The JSON to add to the string | ||
* @param skip - Whether to skip encoding (default: "auto") | ||
*/ | ||
declare function vercelStegaCombine<T>(string: string, json: T, skip?: SkipValue): string; | ||
declare const VERCEL_STEGA_REGEX: RegExp; | ||
/** | ||
* Decodes the first hidden string that's found in the source string back into its original value | ||
* @param source - The source string with encoded data | ||
* @returns The decoded JSON value | ||
*/ | ||
declare function vercelStegaDecode<T>(source: string): T | undefined; | ||
/** | ||
* Decodes every hidden string that's found in the source string back into their original values | ||
* @param source - The source string with encoded data | ||
* @returns The decoded JSON values | ||
*/ | ||
declare function vercelStegaDecodeAll<T>(source: string): T[]; | ||
/** | ||
* Separated clean string and encoded string | ||
*/ | ||
interface SplitResult { | ||
/** The original string with encoded substring removed */ | ||
cleaned: string; | ||
/** The encoded substring from the original string */ | ||
encoded: string; | ||
} | ||
/** | ||
* Splits out encoded data from a string, if any is found | ||
* @param original - The original string | ||
* @returns The cleaned string and encoded data, separately | ||
*/ | ||
declare function vercelStegaSplit(original: string): SplitResult; | ||
export { VERCEL_STEGA_REGEX, legacyStegaEncode, vercelStegaCombine, vercelStegaDecode, vercelStegaDecodeAll, vercelStegaEncode, vercelStegaSplit }; |
{ | ||
"name": "@vercel/stega", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "Utilities for steganography", | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
@@ -14,5 +14,6 @@ "source": "./src/index.ts", | ||
"devDependencies": { | ||
"@jest/globals": "^28.1.3", | ||
"jest": "^28.1.3", | ||
"ts-jest": "^28.0.3", | ||
"@jest/globals": "^29.6.1", | ||
"jest": "^29.6.1", | ||
"ts-jest": "^29.1.1", | ||
"tsup": "^6.7.0", | ||
"typescript": "^4.6.3" | ||
@@ -25,9 +26,6 @@ }, | ||
"scripts": { | ||
"dev": "pnpm build", | ||
"build": "pnpm build:types && pnpm build:esm && pnpm build:cjs", | ||
"build:esm": "tsc --module es2020 --outDir dist/esm", | ||
"build:cjs": "tsc --module commonjs --outDir dist/cjs", | ||
"build:types": "tsc --declaration --emitDeclarationOnly", | ||
"dev": "tsup --watch", | ||
"build": "tsup", | ||
"test": "jest" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
25350
5
6
71
1