@sequencemedia/crypto 1.2.291 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ import globals from 'globals'
2
+ import jsdoc from 'eslint-plugin-jsdoc'
3
+ import standard from '@sequencemedia/eslint-config-standard/merge'
4
+ import typescript from '@sequencemedia/eslint-config-typescript/merge'
5
+
6
+ export default [
7
+ jsdoc.configs['flat/recommended'],
8
+ ...standard({
9
+ files: [
10
+ '**/*.{mjs,cjs,mts,cts}'
11
+ ],
12
+ languageOptions: {
13
+ globals: {
14
+ ...globals.node
15
+ }
16
+ }
17
+ }),
18
+ ...typescript({
19
+ files: [
20
+ '**/*.{mts,cts}'
21
+ ],
22
+ languageOptions: {
23
+ globals: {
24
+ ...globals.node
25
+ }
26
+ }
27
+ })
28
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/crypto",
3
- "version": "1.2.291",
3
+ "version": "1.3.2",
4
4
  "keywords": [
5
5
  "crypto",
6
6
  "node",
@@ -11,9 +11,9 @@
11
11
  "decode",
12
12
  "shell"
13
13
  ],
14
- "main": "./index.mjs",
14
+ "main": "./src/index.mjs",
15
15
  "type": "module",
16
- "types": "./index.d.mts",
16
+ "types": "./src/index.d.mts",
17
17
  "author": {
18
18
  "name": "Jonathan Perry for Sequence Media Limited",
19
19
  "email": "sequencemedia@sequencemedia.net",
@@ -25,25 +25,17 @@
25
25
  "url": "git@github.com:sequencemedia/crypto.git"
26
26
  },
27
27
  "scripts": {
28
- "lint": "npm run lint:js && npm run lint:ts",
29
- "lint:fix": "npm run lint:js:fix && npm run lint:ts:fix",
30
- "lint:js": "eslint . --ext .mjs,.cjs",
31
- "lint:js:fix": "npm run lint:js -- --fix",
32
- "lint:ts": "eslint . --ext .mts,.cts",
33
- "lint:ts:fix": "npm run lint:ts -- --fix",
28
+ "lint": "eslint .",
29
+ "lint:fix": "npm run lint -- --fix",
34
30
  "prepare": "husky"
35
31
  },
36
32
  "devDependencies": {
37
- "@babel/core": "^7.26.9",
38
- "@babel/eslint-parser": "^7.26.8",
39
- "@babel/preset-env": "^7.26.9",
33
+ "@sequencemedia/eslint-config-standard": "^0.2.35",
34
+ "@sequencemedia/eslint-config-typescript": "^0.1.50",
40
35
  "@types/node": "^22.13.5",
41
- "@typescript-eslint/eslint-plugin": "7.18.0",
42
- "@typescript-eslint/parser": "7.18.0",
43
- "core-js": "^3.40.0",
44
- "eslint": "8.57.1",
45
- "eslint-config-love": "47.0.0",
46
- "eslint-config-standard": "^17.1.0",
36
+ "eslint": "^9.21.0",
37
+ "eslint-plugin-jsdoc": "^50.6.3",
38
+ "globals": "^16.0.0",
47
39
  "husky": "^9.1.7"
48
40
  }
49
41
  }
package/src/index.mjs CHANGED
@@ -4,7 +4,7 @@ import crypto from 'node:crypto'
4
4
  * @param {string} secret
5
5
  * @returns {string}
6
6
  */
7
- export function hashKey (secret) {
7
+ function hashKey (secret) {
8
8
  if (!secret) throw new Error('A secret is required')
9
9
 
10
10
  return crypto.createHash('sha256').update(secret).digest('base64').substring(0, 32)
package/babel.config.cjs DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- presets: [
3
- [
4
- '@babel/env',
5
- {
6
- targets: {
7
- node: 'current'
8
- },
9
- useBuiltIns: 'usage',
10
- corejs: 3
11
- }
12
- ]
13
- ]
14
- }
package/index.d.mts DELETED
@@ -1,5 +0,0 @@
1
- export function hashKey (secret: string): string
2
-
3
- export function encrypt (buffer: Buffer, secret: string, bytes?: number, algorithm?: string): Buffer
4
-
5
- export function decrypt (buffer: Buffer, secret: string, bytes?: number, algorithm?: string): Buffer
package/index.mjs DELETED
@@ -1,5 +0,0 @@
1
- export {
2
- hashKey,
3
- encrypt,
4
- decrypt
5
- } from './src/index.mjs'