@sequencemedia/crypto 1.3.0 → 1.3.1
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/eslint.config.mjs +26 -0
- package/package.json +9 -18
- package/src/index.mjs +1 -1
- package/babel.config.cjs +0 -14
- package/index.d.mts +0 -5
- package/index.mjs +0 -5
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
import standard from '@sequencemedia/eslint-config-standard/merge'
|
|
3
|
+
import typescript from '@sequencemedia/eslint-config-typescript/merge'
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
...standard({
|
|
7
|
+
files: [
|
|
8
|
+
'**/*.{mjs,cjs}'
|
|
9
|
+
],
|
|
10
|
+
languageOptions: {
|
|
11
|
+
globals: {
|
|
12
|
+
...globals.node
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}),
|
|
16
|
+
...typescript({
|
|
17
|
+
files: [
|
|
18
|
+
'**/*.{mts,cts}'
|
|
19
|
+
],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
globals: {
|
|
22
|
+
...globals.node
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/crypto",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
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,16 @@
|
|
|
25
25
|
"url": "git@github.com:sequencemedia/crypto.git"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"lint": "
|
|
29
|
-
"lint:fix": "npm run lint
|
|
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
|
-
"@
|
|
38
|
-
"@
|
|
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
|
-
"
|
|
42
|
-
"
|
|
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
|
+
"globals": "^16.0.0",
|
|
47
38
|
"husky": "^9.1.7"
|
|
48
39
|
}
|
|
49
40
|
}
|
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
|
-
|
|
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
package/index.d.mts
DELETED