@sequencemedia/crypto 1.2.290 → 1.3.0

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.
package/index.d.mts ADDED
@@ -0,0 +1,5 @@
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 ADDED
@@ -0,0 +1,5 @@
1
+ export {
2
+ hashKey,
3
+ encrypt,
4
+ decrypt
5
+ } from './src/index.mjs'
package/jsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": "."
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/crypto",
3
- "version": "1.2.290",
3
+ "version": "1.3.0",
4
4
  "keywords": [
5
5
  "crypto",
6
6
  "node",
@@ -11,9 +11,9 @@
11
11
  "decode",
12
12
  "shell"
13
13
  ],
14
- "main": "./src/index.mjs",
14
+ "main": "./index.mjs",
15
15
  "type": "module",
16
- "types": "./crypto.d.mts",
16
+ "types": "./index.d.mts",
17
17
  "author": {
18
18
  "name": "Jonathan Perry for Sequence Media Limited",
19
19
  "email": "sequencemedia@sequencemedia.net",
@@ -31,8 +31,7 @@
31
31
  "lint:js:fix": "npm run lint:js -- --fix",
32
32
  "lint:ts": "eslint . --ext .mts,.cts",
33
33
  "lint:ts:fix": "npm run lint:ts -- --fix",
34
- "prepare": "husky",
35
- "types": "tsc src/**/*.mjs --declaration --allowJs --emitDeclarationOnly"
34
+ "prepare": "husky"
36
35
  },
37
36
  "devDependencies": {
38
37
  "@babel/core": "^7.26.9",
@@ -45,10 +44,6 @@
45
44
  "eslint": "8.57.1",
46
45
  "eslint-config-love": "47.0.0",
47
46
  "eslint-config-standard": "^17.1.0",
48
- "husky": "^9.1.7",
49
- "typescript": "^5.7.3"
50
- },
51
- "exports": {
52
- ".": "./src/index.mjs"
47
+ "husky": "^9.1.7"
53
48
  }
54
49
  }
package/src/index.d.mts CHANGED
@@ -1,21 +1,5 @@
1
- /**
2
- * @param {string} secret
3
- * @returns {string}
4
- */
5
1
  export function hashKey (secret: string): string
6
- /**
7
- * @param {Buffer} buffer
8
- * @param {string} secret
9
- * @param {number} [bytes]
10
- * @param {string} [algorithm]
11
- * @returns {Buffer}
12
- */
2
+
13
3
  export function encrypt (buffer: Buffer, secret: string, bytes?: number, algorithm?: string): Buffer
14
- /**
15
- * @param {Buffer} buffer
16
- * @param {string} secret
17
- * @param {number} [bytes]
18
- * @param {string} [algorithm]
19
- * @returns {Buffer}
20
- */
4
+
21
5
  export function decrypt (buffer: Buffer, secret: string, bytes?: number, algorithm?: string): Buffer
package/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import crypto from 'crypto'
1
+ import crypto from 'node:crypto'
2
2
 
3
3
  /**
4
4
  * @param {string} secret
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
+
2
3
  export {}
@@ -9,12 +9,12 @@ const {
9
9
  CRYPTO_KEY
10
10
  } = {},
11
11
  stdout,
12
- openStdin
12
+ stdin
13
13
  } = process
14
14
 
15
15
  let collector = Buffer.from('')
16
16
 
17
- openStdin()
17
+ stdin
18
18
  .on('data', (buffer) => {
19
19
  collector = Buffer.concat([collector, buffer])
20
20
  })
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
+
2
3
  export {}
@@ -9,12 +9,12 @@ const {
9
9
  CRYPTO_KEY
10
10
  } = {},
11
11
  stdout,
12
- openStdin
12
+ stdin
13
13
  } = process
14
14
 
15
15
  let collector = Buffer.from('')
16
16
 
17
- openStdin()
17
+ stdin
18
18
  .on('data', (buffer) => {
19
19
  collector = Buffer.concat([collector, buffer])
20
20
  })
package/tsconfig.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "nodenext",
3
+ "module": "NodeNext",
4
+ "target": "ESNext",
4
5
  "allowJs": true,
5
- "declaration": true,
6
- "emitDeclarationOnly": true,
7
- "declarationMap": true,
8
- "strictNullChecks": true
6
+ "checkJs": true,
7
+ "noEmit": true,
8
+ "strict": true,
9
+ "isolatedModules": true,
10
+ "baseUrl": "."
9
11
  }
10
12
  }
package/crypto.d.mts DELETED
@@ -1,5 +0,0 @@
1
- declare module '@sequencemedia/crypto' {
2
- export function hashKey (secret: string): string
3
- export function encrypt (buffer: Buffer, secret: string, bytes?: number, algorithm?: string): Buffer
4
- export function decrypt (buffer: Buffer, secret: string, bytes?: number, algorithm?: string): Buffer
5
- }