chore: remove `crypto-js` from dev dependencies (#3447)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Yusuke Wada · committed by GitHub · parent 200c4f9 · Browse files · 6 files·+11 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+11 added−19 removed
- tests:+10 added−6 removed
- other:+1 added−13 removed
Provenance
- Commit
f87c221- Tree
acf31e6- Author
Yusuke Wada <yusuke@kamawada.com>- Committer
GitHub <noreply@github.com>- Parent
200c4f9
6 files changed+11 added−19 removed
modified:runtime-tests/fastly/index.test.ts+2 added-2 removed
11234555 unmodified lines6162636465656667686931 unmodified linesimport { SHA256 } from 'crypto-js'import { createHash } from 'crypto'import { getRuntimeKey } from '../../src/helper/adapter'import { Hono } from '../../src/index'import { basicAuth } from '../../src/middleware/basic-auth'import { jwt } from '../../src/middleware/jwt'55 unmodified lines '/auth/*', basicAuth({ username, password, hashFunction: (m: string) => SHA256(m).toString(), hashFunction: (m: string) => createHash('sha256').update(m).digest('hex'), }) )
app.get('/auth/*', () => new Response('auth'))31 unmodified linesmodified:src/middleware/basic-auth/index.test.ts+2 added-2 removed
1-import { SHA256 } from 'crypto-js'1+import { createHash } from 'crypto'2 import { Hono } from '../../hono'3 import { basicAuth } from '.'4 5 describe('Basic Auth by Middleware', () => {54 unmodified lines60 '/auth-override-func/*',61 basicAuth({62 username: username,63 password: password,64- hashFunction: (data: string) => SHA256(data).toString(),64+ hashFunction: (data: string) => createHash('sha256').update(data).digest('hex'),65 })66 )67 68 app.use('/nested/*', async (c, next) => {253 unmodified linesmodified:src/utils/buffer.test.ts+6 added-2 removed
1-import { SHA256 as sha256CryptoJS } from 'crypto-js'1+import { createHash } from 'crypto'2 import { bufferToFormData, bufferToString, equal, timingSafeEqual } from './buffer'3 4 describe('equal', () => {5 it('should return true for identical ArrayBuffers', () => {35 unmodified lines41 // @ts-ignore42 expect(await timingSafeEqual(undefined, undefined)).toBe(true)43 expect(await timingSafeEqual(true, true)).toBe(true)44 expect(await timingSafeEqual(false, false)).toBe(true)45- expect(await timingSafeEqual(true, true, (d: string) => sha256CryptoJS(d).toString()))45+ expect(46+ await timingSafeEqual(true, true, (d: boolean) =>47+ createHash('sha256').update(d.toString()).digest('hex')48+ )49+ )50 })51 52 it('negative', async () => {53 expect(await timingSafeEqual('a', 'b')).toBe(false)67 unmodified linesmodified:bun.lockbbinary
A binary file, modified.
modified:package.json-2 removed
618 unmodified lines619 ],620 "devDependencies": {621 "@hono/eslint-config": "^1.0.2",622 "@hono/node-server": "^1.8.2",623- "@types/crypto-js": "^4.1.1",623 "@types/glob": "^8.0.0",624 "@types/jsdom": "^21.1.4",625 "@types/node": "20.11.4",626 "@types/supertest": "^2.0.12",627 "@vitest/coverage-v8": "^2.0.5",628 "arg": "^5.0.2",630- "crypto-js": "^4.1.1",629 "esbuild": "^0.15.12",630 "eslint": "^9.10.0",631 "glob": "7.2.3",632 "jsdom": "^22.1.0",16 unmodified linesmodified:yarn.lock+1 added-11 removed
1 # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.2 # yarn lockfile v13-# bun ./bun.lockb --hash: DA11529C7F97C3FF-b3237be4d6b40612-FCFA012DAF0DCABC-52f32378b87f3da53+# bun ./bun.lockb --hash: 229521234768470F-a4cd9955ab6a6ada-9D052F6AF60C5C4D-0bfb97a3d93af7424 5 6 "@ampproject/remapping@^2.3.0":7 version "2.3.0"1128 unmodified lines1136 version "2.1.5"1137 resolved "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.5.tgz"1138 integrity sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==1139 1140-"@types/crypto-js@^4.1.1":1141- version "4.2.2"1142- resolved "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz"1143- integrity sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==1144-1140 "@types/estree@1.0.5":1141 version "1.0.5"1142 resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz"1143 integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==917 unmodified lines2061 path-key "^3.1.0"2062 shebang-command "^2.0.0"2063 which "^2.0.1"2064 2070-crypto-js@^4.1.1:2071- version "4.2.0"2072- resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz"2073- integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==2074-2065 crypto-random-string@^2.0.0:2066 version "2.0.0"2067 resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz"2068 integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==4166 unmodified lines