Taku Amano
0560f27bde
fix(utils/url): Fix behavior when parameters with no value specified are mixed. ( #1023 )
...
* refactor(utils/url): Reduce a few characters.
* fix(utils/url): Fix behavior when parameters with no value specified are mixed.
* chore: denoify
2023-03-31 17:57:24 +09:00
Taku Amano
91c04ac073
refactor(utils/url): Decode parameters more accurately without performance degradation. ( #1015 )
...
* refactor(utils/url): Decode parameters more accurately without performance degradation.
* Add tests about getQueryParam and getQueryParams.
* chore(bench): add query param bench
* chore: denoify
2023-03-29 23:03:00 +09:00
Yusuke Wada
813984edca
denoify
2023-03-26 22:14:33 +09:00
Yusuke Wada
282e18596b
fix(app): don't remove slash form /
if strict is false ( #1004 )
...
* fix(app): don't remove slash form `/` if strict is `false`
* fixed test
* denoify
2023-03-20 23:30:41 +09:00
Kei Kamikawa
95602a18d7
feat: support issued_at
validation for JWT ( #1001 )
...
* added issued at validation
* yarn denoify
2023-03-20 23:29:32 +09:00
Yusuke Wada
309c38a69a
denoify
2023-03-19 18:19:01 +09:00
Yusuke Wada
0238dc6b91
feat(req): introduce c.req.path
( #988 )
...
* feat(req): introduce `c.req.path`
* denoify
* we don't have to handle fragments
* fixed the test
* denoify
2023-03-17 16:32:19 +09:00
Yusuke Wada
418941d01b
Merge branch 'main' into next
2023-03-13 22:00:00 +09:00
Yusuke Wada
948ca6a3b5
fix(route): support a root-level optional parameter ( #975 )
...
* fix(route): support a root level optional parameter
* denoify
2023-03-13 21:55:01 +09:00
Yusuke Wada
c996f2d542
denoify
2023-03-05 23:40:14 +09:00
Yusuke Wada
46c233e463
fix(client): show type error if $get()
needs args ( #937 )
...
* fix(client): show type error if `$get()` needs args
* denoify
2023-03-02 21:40:53 +09:00
Yusuke Wada
b1c5059708
feat(jsonT
): check JSON type ( #939 )
...
* feat(`jsonT`): check JSON type
* denoify
* use `JSONValue`
* create `TrueAndFalseToBoolean` and add a comment
2023-03-02 08:56:13 +09:00
Yusuke Wada
b9227b890c
refactor(util): remove using Buffer
from encode.ts
( #925 )
2023-02-25 01:53:18 +09:00
Yusuke Wada
60c0903a1c
fix(req): query return type as string | undefined
( #888 )
...
* fix(req): return type as `string | undefined`
* denoify
2023-02-13 21:40:51 +09:00
Yusuke Wada
39e855f0a4
feat: move http-exception out of utils ( #883 )
2023-02-11 18:05:50 +09:00
Yusuke Wada
9391278911
feat(router) [breaking]: StaticRouter obsolete ( #873 )
...
Co-authored-by: Taku Amano <taku@taaas.jp>
2023-02-09 16:58:28 +09:00
Yusuke Wada
dd4122a5e0
refactor: obsolute CustomHandler
( #861 )
2023-02-03 05:56:59 +09:00
Yusuke Wada
fbf8959b74
fix(breaking): obsolete no args c.req.valid()
( #856 )
...
* v3.0.0-rc.9
* fix(breaking): obsolete no args `c.req.valid()`
* more strict
2023-02-01 22:02:09 +09:00
Jayden
53de4a4021
Rename runtime keys ( #850 )
...
* Rename runtime keys
* denoify
* Fix test
2023-01-29 14:47:35 +09:00
Yusuke Wada
2ee0f739f5
fix(bun): fixed throwing the error in HTTPException
( #830 )
2023-01-22 15:06:55 +09:00
Yusuke Wada
698a783573
Merge branch 'main' into next
2023-01-22 14:28:13 +09:00
Yusuke Wada
e404319824
perf: use substring
and //.test
... ( #829 )
...
* v3.0.0-rc.8
* perf: use `substring` and `//.test` ...
2023-01-22 13:59:31 +09:00
Yusuke Wada
a60e46ae53
fix(request): make optional param type correct ( #826 )
...
* fix(request): make optional param type correct
* `ts-ignore`
* `denoify`
2023-01-22 13:32:33 +09:00
Yusuke Wada
49ffd51153
refactor(utils): remove minor mime types ( #816 )
2023-01-19 22:45:25 +09:00
Yusuke Wada
9958019d13
refactor: remove the json util not needed ( #815 )
2023-01-19 22:45:25 +09:00
Yusuke Wada
eb6f1fdb0d
perf: optimize parsing queries and headers / 19% faster than 2.7.2 ( #811 )
2023-01-19 22:45:25 +09:00
Yusuke Wada
d00a47ef70
feat: introduce HTTPException
( #796 )
...
* feat: introduce `HTTPException`
* denoify and fixed tests for Lagon
2023-01-19 22:45:25 +09:00
Yusuke Wada
e989a93d01
refactor: tweak types ( #795 )
2023-01-19 22:45:25 +09:00
Yusuke Wada
d2dd42b35e
fix: fixed bugs handling TypeResponse
( #791 )
2023-01-19 22:45:25 +09:00
Yusuke Wada
548487aa53
chore: denoify
2023-01-19 22:45:25 +09:00
Yusuke Wada
b567a574d6
refactor: form body should be Record<string, string | File>
( #771 )
...
* refactor: form body should be `Record<string, string | File>`
* refactored
2023-01-19 22:44:38 +09:00
Yusuke Wada
4422a0929c
fix(validator): return message when Malformed JSON request body ( #770 )
2023-01-19 22:44:37 +09:00
Yusuke Wada
34514bc560
refactor(types): fix exporting and refactor ( #767 )
2023-01-19 22:44:37 +09:00
Yusuke Wada
85e3c6a275
feat: new validator middleware using 3rd-party & current middleware obsolete ( #745 )
...
* feat: introduce HonoRequest with "wrapper pattern" (#733 )
* feat: HonoRequest
* avoid `awaits`
* use `raw` instead of `original`
* feat: types for "RPC" support & build-in validator obsolete
* feat: introduce HonoRequest with "wrapper pattern" (#733 )
* feat: HonoRequest
* avoid `awaits`
* use `raw` instead of `original`
* create generic middleare for 3rd-party validator
* indent
* support multiple validators and refactor
* remove unsed lines
* denoify
2023-01-19 22:40:13 +09:00
Yusuke Wada
da0a7ce55c
fix(context): enable destruction such json
( #813 )
...
This will fix #812
2023-01-18 08:23:58 +09:00
Yusuke Wada
4298f8266a
fix(cors): fix bugs handling pre-flight ( #792 )
2023-01-09 00:30:53 +09:00
Yusuke Wada
4f772ddb44
docs(readme): fixed shields.io badage image url
2022-12-21 06:42:27 +09:00
Jayden
760ae30251
Fix detecting node runtime ( #696 )
...
* Fix
* Denoify
* Avoid error in other runtime
* chore: remove unnecessary config testPathIgnorePatterns (#697 )
* Fix vercel
Co-authored-by: Horie Issei <issei.horie@is2ei.com>
2022-12-02 11:28:49 +09:00
Yusuke Wada
8fcc9e6e3b
chore: donoify
2022-11-26 15:59:50 +09:00
Yusuke Wada
1eb49b8d96
refactor: support new @cloudflare/worker-types
( #673 )
...
* refactor: support new `@cloudflare/worker-types`
* do not attach crypto to global
* denoify ignore serve-static for cloudlfare
* ignore the utility for cloudflare
* import types
2022-11-23 07:27:42 +09:00
Yusuke Wada
1674bbba32
chore(denoify): update Buffer
2022-11-17 15:11:36 +09:00
Jayden
06cecbd1e2
fix(param): Decode context.param ( #662 )
...
* Decode url param
* Denoify
2022-11-14 09:10:03 +09:00
Yusuke Wada
d3a6f80d7c
fix(type): change the type definition of req
in Context ( #658 )
2022-11-11 15:23:05 +09:00
Yusuke Wada
edfb31ee94
fix(error): make notFound()
enables to catch errors correctly ( #652 )
2022-11-05 19:02:19 +09:00
Yusuke Wada
ca52dd898e
fix(build): fix ESM support in Node.js / use esbuild
( #631 )
...
* fix(build): fix ESM support in Node.js / use `esbuild`
* add tsx
* denoify ignore
2022-10-28 08:46:02 +09:00
Yusuke Wada
8627010094
refactor(types): refactor and add tests for checking Types ( #615 )
...
* refactor(types): refactor and add tests for checking Types
* remove unused
* uncomment
* use `Handler` in validator middleware
* remove unused
* create `src/validator` dir and move some files into it
* add the case that the context is in `validator`
* rename `D` to `S`
2022-10-23 08:10:00 +09:00
Yusuke Wada
33f1cbd604
chore: denoify
2022-10-19 20:01:43 +09:00
Yusuke Wada
0da78351e9
feat(validator): has the error message per rule ( #603 )
...
* feat(validator): has the error message per rule
* add test for checking result objects
* test(validator): add array results test (#609 )
* remove `console.log`
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
2022-10-19 19:17:04 +09:00
Yusuke Wada
2776957bba
feat(validator): introduce nested validation ( #592 )
...
* feat(validator): introduce `v.array()` and `v.object` for nested validation
* copy objects
* remove unnecessary tests
* fix(object): make merge immutable to fix issues with missing fields (#598 )
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
2022-10-13 06:48:59 +09:00
Yusuke Wada
f5fc9103f1
chore: denoify
2022-10-09 23:33:00 +09:00
Derrick Farris
9a0389e723
feat(validator): add support for JSON array path validation ( #563 )
...
* refactor(JSONPath): improve typing of JSONPath
* chore(vscode-settings): add deno.enable=false
* fix(validator): add null to type Type def
* feat(JSON-Path): add support for array JSONPath-Plus syntax
* fix(validator): update isRequired to pass valid bool types
* test: update tests for isRequired validator
* feat(validator): add support for JSON array path validation
* chore(deno): denoify array support changes
* fix(validator): type check all vals in array
* chore(deno): denoify changes
* test(validator): add tests for array type checking
* fix(validator): change JSONPrimative to JSONPrimitive
* refactor(json): More compatible with https://jsonpath.com/ .
* implementation of `asArray`
* fix(validator): update JSONPath implementation and add isArray check in validation
* fix(validator): fix typing errors on SchemaToProp
* Revert "fix(validator): fix typing errors on SchemaToProp"
This reverts commit b8ddef85d0
.
* fix(validator): fix SchemaToProp error for VTypeArrays
* chore(deno): denoify
Co-authored-by: Taku Amano <taku@taaas.jp>
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2022-09-30 21:56:39 +09:00
Yusuke Wada
e5b0ea8d33
chore: denoify
2022-09-30 19:50:59 +09:00
Yusuke Wada
e4c8a6f467
perf: remove async
from dispatch; will be 16% faster ( #550 )
2022-09-26 21:12:53 +09:00
Yusuke Wada
976b2c310e
feat: c.req.body
and c.req.json
accept generics ( #529 )
2022-09-20 22:01:03 +09:00
Yusuke Wada
5133a93925
feat: support appending values with c.header
( #539 )
2022-09-20 21:41:45 +09:00
Yusuke Wada
24c17e340a
feat(trie-router): support optional parameter ( #540 )
2022-09-20 21:26:27 +09:00
Yusuke Wada
730453aeb0
fix(redirect): don't have to make relative url to absolute one ( #541 )
...
* fix(redirect): don't have to make relative url to absolute one
* remove `isAbsoluteURL`
2022-09-20 18:56:31 +09:00
Yusuke Wada
a2cc1a01c2
feat: another idea of Validator Middleware ( #535 )
...
* feat: Another idea of validator middleware
* denoify
* set property value in constructor
* rename `option` to `options`
* add test for handling type error
* use `test` instead of `match`
2022-09-20 10:11:34 +09:00
Taku Amano
bbb95585d4
Check in Origin header instead of Referer ( #532 )
...
* refactor(cors): Check in Origin header instead of Referer.
* refactor(utils/url): Remove unused function getDomainFromURL.
* chore: denoify
2022-09-16 07:23:31 +09:00
Yusuke Wada
df64870f54
feat(cors): allow multiple origins ( #531 )
...
* feat(validator): add `isBoolean` and `isNumber`
* feat(cors): allow multiple origins
Close #503
2022-09-16 00:19:02 +09:00
Yusuke Wada
b546fd6984
refactor: update buffer version on Deno
2022-09-14 08:44:42 +09:00
Yusuke Wada
46c6a8de5e
feat(middleware): introduce "built-in" Validator Middleware ( #505 )
...
* feat(middleware): introduce built-in Validator Middleware
* fixed type of `req.json()`
* Feat/builtin validator middleware another idea (#508 )
* Enable overwriting of query/header data.
* Returns only verified data.
* rename `index.test.ts` to `middleware.test.ts`
* add `removeAdditional` option
* handling error that the JSON body is null
* tidy
* check is it string or not
* implement `isIn`
* enable validation the valies are duplicate
Co-authored-by: Taku Amano <taku@taaas.jp>
2022-09-13 07:54:06 +09:00
Yusuke Wada
b6954815cb
perf(req): improve c.req.query
performance ( #498 )
...
* perf(req): improve `c.req.query` performance
* allow fragments as query strings
2022-09-05 19:08:10 +09:00
Yusuke Wada
128a59aec2
fix: make that c.req.parseBody
parses only FormData
( #487 )
2022-08-27 11:38:48 +09:00
Yusuke Wada
c7ee2e7603
fix: enable passing Generics to c.req.parseBody, default is any ( #481 )
2022-08-25 09:25:11 +09:00
Yusuke Wada
8879f241e8
refactor(mime): made .ico
file's extension to image/x-icon
( #462 )
...
* refactor(mime): made `.ico` file's extension to `image/x-icon`
* fixed deno and bun tests
2022-08-09 10:51:08 +09:00
Yusuke Wada
7345b8105d
fix(ETag): fixed an error when the file size is too large. ( #461 )
...
Made `utils/crypto` supports `ReadbleStream`.
Fix #458
2022-08-09 10:35:30 +09:00
Yusuke Wada
8a9ebc1470
fix(utils/crypto): make Binary and JSON object crypto correct ( #454 )
2022-08-06 00:31:11 +09:00
Yusuke Wada
5838f9dccc
Revert "refactor: add Json
type for JSON object ( #453 )"
...
It's difficult to handle `Json`. So, it's ok to go with `object`.
This reverts commit bc736da6a5
.
2022-08-05 08:10:41 +09:00
Yusuke Wada
bbe079134e
Revert "fix(utils/crypto
): stringify the parameter which is object in createHash
( #452 )"
...
It was necessary to support not only json but also other.
This reverts commit db17530b36
.
2022-08-05 08:09:17 +09:00
Yusuke Wada
bc736da6a5
refactor: add Json
type for JSON object ( #453 )
2022-08-05 06:41:28 +09:00
Yusuke Wada
db17530b36
fix(utils/crypto
): stringify the parameter which is object in createHash
( #452 )
...
Fix #451
2022-08-04 08:51:09 +09:00
Yusuke Wada
a7ad89ccef
refactor(utils/html
): remove escape
function ( #450 )
...
Close #445
2022-08-03 11:39:36 +09:00
Yusuke Wada
9f2a270c28
refactor(utils/html
): rename Buffer
to StringBuffer
( #449 )
2022-08-03 11:24:51 +09:00
Yusuke Wada
3c371d0d07
chore: denoify
2022-07-31 22:19:28 +09:00
Roman Hotsiy
c63d7ed77f
chore: fix typo in error class name ( #393 )
...
* chore: fix type in error class name
* chore: update usages in other places
2022-07-17 08:54:43 +09:00
Yusuke Wada
230d265429
chore(deno): denoify
2022-07-16 10:26:14 +09:00
Yusuke Wada
9a41cde632
chore: denoify
2022-07-15 08:40:15 +09:00
Yusuke Wada
dbb3ec213b
chore: update deno_dist files
2022-07-02 23:22:51 +09:00
Yusuke Wada
1cdd71f676
feat: add serve-static
middlware for deno ( #339 )
...
* feat: add `serve-static` middlware for deno
* make `getFilePath` into utils
* ignore deno ts files
2022-07-02 23:20:09 +09:00
Yusuke Wada
6030c051db
chore: rm *.ts.test
from deno_dist ( #338 )
2022-07-02 22:31:10 +09:00
Yusuke Wada
d9e9e62e47
feat: support Deno! ( #336 )
2022-07-02 15:09:45 +09:00