Skip to content

Commit

Permalink
Publish v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hampuskraft committed Jun 8, 2024
1 parent 2da601d commit 16266e9
Show file tree
Hide file tree
Showing 26 changed files with 1,726 additions and 2,669 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ root = true
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ signed to ensure that a token has not been tampered with.
It's possible to customize how data is serialized. Data is compressed as needed. A timestamp can be added and verified
automatically while loading a token.

> Note: This is an unofficial Node.js port of the Python library
> Note: This is an unofficial JavaScript port of the Python library
> [itsdangerous](https://github.com/pallets/itsdangerous).
## Installing
Expand All @@ -23,10 +23,10 @@ npm install itsdangerous.js
import {URLSafeSerializer} from 'itsdangerous.js';

const authSerializer = new URLSafeSerializer({secretKey: 'secret key', salt: 'auth'});
const token = authSerializer.stringify({id: 5, name: 'itsdangerous'});
const token = await authSerializer.stringify({id: 5, name: 'itsdangerous'});

console.log(token.toString()); // eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg
console.log(token); // eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg

const data = authSerializer.parse(token);
const data = await authSerializer.parse(token);
console.log(data.name); // itsdangerous
```
34 changes: 34 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignoreUnknown": true
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"lineWidth": 120
},
"javascript": {
"formatter": {
"bracketSpacing": false,
"quoteStyle": "single"
}
},
"linter": {
"enabled": true,
"rules": {
"correctness": {
"noNodejsModules": "error"
},
"recommended": true
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true
}
}
30 changes: 0 additions & 30 deletions eslint.config.js

This file was deleted.

6 changes: 3 additions & 3 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@hampus/itsdangerous",
"version": "1.1.5",
"exports": "./src/index.ts"
"name": "@hampus/itsdangerous",
"version": "2.0.0",
"exports": "./src/index.ts"
}
85 changes: 36 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
{
"name": "itsdangerous.js",
"version": "1.1.5",
"description": "Safely pass trusted data to untrusted environments and back.",
"keywords": [
"hmac",
"itsdangerous",
"pallets",
"python",
"security",
"serialization"
],
"repository": "hampuskraft/itsdangerous.js",
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"types": "./dist",
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"format": "prettier --write .",
"lint": "eslint --fix .",
"prepublishOnly": "npm run -s build",
"test": "vitest run"
},
"devDependencies": {
"@eslint/js": "9.2.0",
"@types/eslint__js": "8.42.3",
"@types/node": "20.12.8",
"eslint": "9.2.0",
"eslint-plugin-unicorn": "52.0.0",
"prettier": "3.2.5",
"prettier-plugin-organize-imports": "3.2.4",
"tsup": "8.0.2",
"typescript": "5.4.5",
"typescript-eslint": "7.8.0",
"vite": "5.2.11",
"vitest": "1.6.0"
},
"engines": {
"node": ">=18"
}
"name": "itsdangerous.js",
"version": "2.0.0",
"description": "Safely pass trusted data to untrusted environments and back.",
"keywords": ["hmac", "itsdangerous", "pallets", "python", "security", "serialization"],
"repository": {
"type": "git",
"url": "git+https://github.com/hampuskraft/itsdangerous.js.git"
},
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": "./dist/index.js",
"types": "./dist",
"files": ["dist"],
"scripts": {
"build": "tsup",
"format": "npx @biomejs/biome format --write .",
"lint": "npx @biomejs/biome lint --write --unsafe .",
"prepublishOnly": "npm run -s build",
"test": "vitest run"
},
"dependencies": {
"pako": "2.1.0",
"uint8array-extras": "1.1.0"
},
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@types/pako": "2.0.3",
"tsup": "8.1.0",
"typescript": "5.4.5",
"vite": "5.2.13",
"vitest": "1.6.0"
},
"engines": {
"node": ">=20"
}
}
Loading

0 comments on commit 16266e9

Please sign in to comment.