Comparing version
@@ -19,3 +19,7 @@ import { CipherCCMTypes, CipherOCBTypes, CipherGCMTypes } from 'node:crypto'; | ||
declare const randomSecret: () => `${string}-${string}-${string}-${string}-${string}`; | ||
/** | ||
* Create a random encrypt secret | ||
*/ | ||
declare const randomEncryptSecret: () => string; | ||
export { EncryptAlgorithm, EncryptSecret, create, defaultEncryptAlgorithm, importEncryptSecret, randomSecret, verify }; | ||
export { type EncryptAlgorithm, type EncryptSecret, create, defaultEncryptAlgorithm, importEncryptSecret, randomEncryptSecret, randomSecret, verify }; |
type EncryptAlgorithm = "AES-CBC"; | ||
type EncryptSecret = JsonWebKey; | ||
type EncryptSecret = CryptoKey; | ||
declare const defaultEncryptAlgorithm: EncryptAlgorithm; | ||
@@ -17,3 +17,7 @@ declare const importEncryptSecret: (secret?: string, encryptAlgorithm?: EncryptAlgorithm | "") => Promise<EncryptSecret>; | ||
declare const randomSecret: () => `${string}-${string}-${string}-${string}-${string}`; | ||
/** | ||
* Create a random encrypt secret | ||
*/ | ||
declare const randomEncryptSecret: () => string; | ||
export { EncryptAlgorithm, EncryptSecret, create, defaultEncryptAlgorithm, importEncryptSecret, randomSecret, verify }; | ||
export { type EncryptAlgorithm, type EncryptSecret, create, defaultEncryptAlgorithm, importEncryptSecret, randomEncryptSecret, randomSecret, verify }; |
{ | ||
"name": "uncsrf", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Single API for CSRF functions, working in Node.js, Browsers and other runtimes", | ||
@@ -45,19 +45,20 @@ "keywords": [ | ||
"dev": "vitest dev", | ||
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test", | ||
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w", | ||
"prepack": "pnpm run build", | ||
"test": "pnpm lint && vitest run --coverage" | ||
"lint": "eslint . && prettier -c .", | ||
"lint:fix": "eslint . --fix && prettier -w .", | ||
"prepack": "pnpm build", | ||
"test": "pnpm lint && pnpm test:types && vitest run --coverage", | ||
"test:types": "tsc --noEmit --skipLibCheck" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.2.5", | ||
"@vitest/coverage-v8": "^0.32.2", | ||
"changelogen": "^0.5.3", | ||
"eslint": "^8.43.0", | ||
"eslint-config-unjs": "^0.2.1", | ||
"prettier": "^2.8.8", | ||
"typescript": "^5.1.3", | ||
"unbuild": "^1.2.1", | ||
"vitest": "^0.32.2" | ||
"@types/node": "^22.8.2", | ||
"@vitest/coverage-v8": "^2.1.4", | ||
"changelogen": "^0.5.7", | ||
"eslint": "^9.13.0", | ||
"eslint-config-unjs": "^0.4.1", | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.6.3", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^2.1.4" | ||
}, | ||
"packageManager": "pnpm@8.6.3", | ||
"packageManager": "pnpm@9.12.3", | ||
"repository": { | ||
@@ -64,0 +65,0 @@ "type": "git", |
@@ -35,6 +35,6 @@ # uncsrf | ||
// ESM | ||
import { importEncryptSecret, create, verify } from 'uncsrf' | ||
import { importEncryptSecret, create, verify } from "uncsrf"; | ||
// CommonJS | ||
const { importEncryptSecret, create, verify } = require('uncsrf') | ||
const { importEncryptSecret, create, verify } = require("uncsrf"); | ||
``` | ||
@@ -65,2 +65,2 @@ | ||
[license-src]: https://img.shields.io/npm/l/uncsrf.svg?style=flat-square | ||
[license-href]: https://npmjs.com/package/uncsrf | ||
[license-href]: https://npmjs.com/package/uncsrf |
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
18167
30.63%13
44.44%65
1.56%227
-6.58%