Commit Graph

4530 Commits

Author SHA1 Message Date
Yoshiya Hinosawa
780deafff7
refactor(assert): move unstable assertNever under @std/assert/unstable-never (#5928) 2024-09-11 19:38:13 +09:00
lionel-rowe
38455481a2
perf(expect): add fast path for primitive keyed collections in equal() (#5934)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-11 10:21:31 +00:00
Asher Gomez
43102325b7
test: use Deno.errors.NotCapable where appropriate (#5935)
* test: use `Deno.errors.NotCapable` where appropriate

* copyright headers

* fixes

* fixes

* fixes
2024-09-11 19:17:27 +09:00
Asher Gomez
1d22380fdf
chore: general package cleanups (#5932) 2024-09-10 23:00:37 +09:00
Asher Gomez
fc0f55c00c
BREAKING(url): remove @std/url (#5931) 2024-09-10 18:22:37 +09:00
Asher Gomez
9c36e5e246
feat(io): add Seeker[Sync] interfaces (#5930) 2024-09-10 17:12:18 +10:00
Marvin Hagemeister
9f19c9afa1
fix(http): invalid ipv6 hostname printed to console (#5924) 2024-09-10 08:38:03 +02:00
Yoshiya Hinosawa
b3e1ebb75f
refactor(assert,expect): import internal APIs from more specific paths (#5923) 2024-09-09 14:47:32 +09:00
lionel-rowe
766d9c410c
fix(assert): value-equal complex keys (#5914) 2024-09-09 15:01:36 +10:00
lionel-rowe
23b4d2a034
refactor(assert): remove unnecessary getValFromKeyedCollection() (#5921)
* refactor(assert): remove unnecessary getValFromKeyedCollection function

* Use type assertion instead of narrowing w unreachable path
2024-09-09 14:11:27 +10:00
lionel-rowe
2fe19de48f
perf(assert): add fast path for primitive keyed collections in equal() (#5913)
* feat(assert): add fast path for primitive keyed collections

* remove fix for #5912 (to be redone as separate pr)

* add extra-fast-path with Set#symmetricDifference

* Changes from code review
2024-09-07 10:11:42 +10:00
Yoshiya Hinosawa
70f981e605
refactor(http): inline serveFallback() util (#5917)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-05 20:50:25 +09:00
Yoshiya Hinosawa
fb79076121
fix(http): show hostname as 'localhost' for 0.0.0.0 on windows (#5918) 2024-09-05 20:39:02 +09:00
lionel-rowe
149839b60c
feat(random/unstable): basic randomization functions (#5626)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-05 14:17:10 +09:00
Yoshiya Hinosawa
4ac8373230
chore: add settings for new @std/cbor package (#5915) 2024-09-05 14:15:28 +09:00
Liam Tait
7c0e917b93
feat(data-structures/unstable): @std/data-structures/bidirectional-map (#5910)
* feat(data-structures/unstable): `@std/data-structures/BidirectionalMap`

* add type params

* fmt

* sort mod exports

* add header

* add missing comments

* fmt

* close example code block

* add missing comments

* fmt

* close code block

* tweaks

* tweak

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-05 00:56:40 +00:00
denobot
67e9cfa0ff
chore: release 2024.09.04 (#5908)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-09-04 19:37:53 +09:00
Asher Gomez
b05acd6570
feat(tar/unstable): @std/tar (#5905)
* feat(tar/unstable): `@std/tar`

* fix

* edit
2024-09-04 18:28:07 +10:00
Yoshiya Hinosawa
b41c503401
docs(url): update deprecation docs (#5907) 2024-09-04 17:17:36 +09:00
Asher Gomez
5aa54eff2b
chore: prepare for @std/tar package (#5906) 2024-09-04 06:49:47 +00:00
Yoshiya Hinosawa
1432018f00
fix(path/unstable): support string | URL in the 2nd overload of basename, dirname, and extname (#5904) 2024-09-04 14:16:49 +09:00
Kenta Moriuchi
4d4bd0eb92
refactor(archive,async,cli,csv,dotenv,encoding,expect,fmt,front-matter,fs,http,internal,log,net,path,semver,testing,text,webgpu,yaml): enable "exactOptionalPropertyTypes" option (#5892) 2024-09-04 14:15:01 +09:00
Yoshiya Hinosawa
6aaf191081
feat(path/unstable): support file URL arg in normalize() (#5902) 2024-09-04 13:28:33 +09:00
Yoshiya Hinosawa
7e2616031a
feat(path/unstable): support URL as 1st arg of basename() (#5900)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-04 12:39:39 +09:00
Liam Tait
b808ee6de6
feat(uuid/unstable): @std/uuid/v7 (#5887)
* feat(uuid): add uuid v7 generation and validation

* remove as string

* fmt

* update mod-exports check

* mark more items experimental

* fix test name

* call getRandomValues once

* add checks for user provided timestamp

* fmt

* consolidate checks

* fix missing options.timestamp

* consolidate error check

* use pre-shifted variant and version

* add extractTimestamp function for UUIDv7

* remove random option from uuid v7 generate

* fix import statements for extractTimestamp function in uuid/v7.ts

* remove bad comment

* tweaks

* add uuid v7 module doc

* fmt

* align extractTimestamp invalid uuid error message with style guide

* fmt

* add experimental tags

* use timestamp argument instead of options generate v7 uuid

* fmt

* tweak

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-04 02:57:49 +00:00
Tim Reichen
6c684b8bc8
fix(yaml): handle string instances (#5897)
initial commit
2024-09-04 09:28:55 +10:00
Tim Reichen
df562b1d28
refactor(yaml): switch array test (#5898)
initial commit
2024-09-04 08:42:24 +10:00
Tim Reichen
890958ca48
fix(yaml): handle Boolean instances correctly (#5894) 2024-09-03 20:15:31 +09:00
Kenta Moriuchi
5bed4c81b5
fix(async,csv,fmt): assign default value when undefined is passed (#5893)
* fix(fmt): stop using `Object.assign` for options

* fix(csv): move evaluation of option default values to later

* fix(async): change spread syntax to destructuring assignment

* lint
2024-09-03 18:57:27 +10:00
Tim Reichen
538be90fe0
fix(yaml): handle integer number instances (#5895)
* initial commit

* update
2024-09-03 18:54:48 +10:00
Tim Reichen
25de700ed5
fix(yaml): handle float number instances (#5896)
initial commit
2024-09-03 18:50:34 +10:00
Tim Reichen
2d6c45e325
refactor(yaml): simplify stringifyBlockMapping() (#5885)
* initial commit

* update
2024-09-03 14:54:10 +10:00
Tim Reichen
d01e301921
fix(yaml): fix sortKey error message (#5873)
initial commit
2024-09-03 14:52:38 +10:00
Tim Reichen
8abff456f8
refactor(yaml): cleanup utility functions (#5886)
initial commit
2024-09-03 08:08:15 +10:00
Tim Reichen
f80d8d1519
refactor(yaml): cleanup str type (#5879)
initial commit
2024-09-03 08:05:03 +10:00
Tim Reichen
e92bc0cced
refactor(yaml): simplify seq type (#5878)
initial commit
2024-09-03 07:47:51 +10:00
Tim Reichen
23f47386ea
test(yaml): add invalid represent type test (#5874)
* initial commit

* update
2024-09-02 17:46:17 +10:00
Doctor
9298ea503f
feat(archive): UntarStream and TarStream (#4548)
* refactor(archive): An implementation of Tar as streams

* fmt(archive): Ran `deno fmt`

* fix(archive): fixed JSDoc examples in tar_streams.ts

* fix(archive): fixed JSDoc examples so `deno task test` doesn't complain

* fix(archive): lint license error

* fix(archive): lint error files not exported

* set(archive): Set current time as mtime for default

* resolve(archive): resolves comments made

* add(archive): `{ mode: 'byob' }` support for TarStream

* add(archive): `{ mode: 'byob' }` support for UnTarStream

* adjust(archive): The logical flow of a few if statements

* tests(archive): Updated Tests for Un/TarStream

* fix(archive): TarStream mtime wasn't an octal

* fix(archive): TarStream tests

* add(archive): Added parsePathname function

Added parsePathname function abstracting the logic out of TarStream allowing the developer to validate pathnames before providing them to TarStream hoping it doesn't throw an error and require the archive creation to start all over again.

* fix(archive): extra bytes incorrectly appending at the end of files

When the appending file was exactly divisible by 512 bytes, an extra 512 bytes was being appending instead of zero to fill in the gap, causing the next header to be read at the wrong place.

* adjust(archive): to always return the amount of bytes requested

Instead of using enqueue, the leftover bytes are saved for later for the next buffer provided.

* tweaks

* fix

* docs(archive): Link to the spec that they're following

* docs(archive): fix spelling

* add(archive): function validTarSteamOptions

- To make sure, if TarStreamOptions are being provided, that they are in the correct format so as to not create bad tarballs.

* add(archive): more tests

* fix(archive): validTarStreamOptions

* add(archive): tests for validTarStreamOptions

* refactor(archive): code to copy the changes made in the @doctor/tar-stream version

* test(archive): added from @doctor/tar-stream

* chore: nit on anonymous function

* refactor(archive): UnTarStream that fixes unexplainable memory leak

- The second newest test introduced here '... with invalid ending' seems to detect a memory leak due to an invalid tarball. I couldn't figure out why the memory leak was happening but I know this restructure of the code doesn't have that same memory leak.

* chore: fmt

* tests(archive): added remaining tests to cover many lines as possible

* adjust(archive): remove simplify pathname code

* adjust(archive): remove checking for duplicate pathnames in taring process

* adjust(archive): A readable will exist on TarEntry unless string values 1-6

* tests(archive): added more tests for higher coverage

* adjust(archives): TarStream and UnTarStream to implement TransformStream

* docs(archive): moved TarStreamOptions docs into properties.

* adjust(archive): TarStreamFile to take a ReadableSteam instead of an Iterable | AsyncIterable

* adjust(archive): to use FixedChunkStream instead of rolling it's own implementation

* fix(archive): lint error

* adjust(archive): Error types and messages

* adjust(archive): more Error messages / improve tests

* refactor(archive): UnTarStream to return TarStreamChunk instead of TarStreamEntry

* fix(archive): JSDoc example

* adjust(archive): mode, uid, gid options to be provided as numbers instead of strings.

* adjust(archive): TarStream's pathname to be only of type string

* fix(archive): prefix/name to ignore everything past the first NULL

* adjust(archive): `checksum` and `pad` to not be exposed from UnTarStream

* adjust(archive): checksum calculation

* change(archive): `.slice` to `.subarray`

* doc(archive): "octal number" to "octal literal"

* adjust(archive): TarStreamOptions to be optional with defaults

* doc(archive): added more docs for the interfaces

* docs(archive): denoting defaults

* docs(archive): updated for new lint rules

* adjust(archive): Tests to use assertRejects where appropriate & add `validPathname` function

- The `validPathname` is meant to be a nicer exposed function for users of this lib to validate that their pathnames are valid before pipping it through the TarStream, over exposing parsePathname where the user may be confused about what to do with the result.

* adjust(archive): to use `Date.now()` instead of `new Date().getTime()`

Co-authored-by: ud2 <sjx233@qq.com>

* adjust(archive): mode, uid, and gid to be numbers instead of strings when Untaring

* tests(archive): adjust two tests to also validate the contents of the files are valid

* adjust(archive): linkname, uname, and gname to follow the same decoding rules as name and prefix

* rename(archive): UnTarStream to UntarStream

* fix(archive): type that was missed getting updated

* tests(archive): adjust check headers test to validate all header properties instead of just pathnames

* rename(archive): `pathname` properties to `path`

* docs(archive): updated to be more descriptive

* docs(archive): Updated error types

* adjust(archive): `validPath` to `assertValidPath`

* adjust(archive): `validTarStreamOptions` to `assertValidTarStreamOptions`

* revert(archive): UntarStream to produce TarStreamEntry instead of TarStreamChunk

* refactor: remove redundant `void` return types

* docs: cleanup assertion function docs

* docs: correct `TarStream` example

* docs: minor docs cleanups

* refactor: improve error class specificity

* docs: add `@experimental` JSDoc tags

* docs(archive): Updated examples for `assertValidPath` and `assertValidTarStreamOptions```

* fix(archive): problem with tests

- I suspect the problem is that a file that was read by `Deno.readDir` changed size between being read at `Deno.stat` and when `Deno.open` finished pulling it all in.

* update error messages

* update error messages

* fix typos

* refactor: tweak error messages

* refactor: tweaks and add type field

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: ud2 <sjx233@qq.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-09-02 17:43:22 +10:00
Tim Reichen
aa757d8803
refactor(yaml): simplify merge type (#5877) 2024-09-02 15:54:30 +09:00
Tim Reichen
f86e91119f
test(yaml): add positive timezone timestamp test (#5881) 2024-09-02 11:22:12 +09:00
Simon Lecoq
9ad71ee178
fix(io): don't use Deno.Buffer in examples (#5889) 2024-09-02 08:47:54 +10:00
Yoshiya Hinosawa
94a7e1b34b
feat(path/unstable): support URL in first arg of join() (#5863)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-30 13:18:12 +09:00
lionel-rowe
8782bdb699
fix(cache/unstable): fix flaky fibonacci test (#5872)
* fix(cache/unstable): Fix flaky fibonacci test

* Attempt 2
2024-08-30 14:03:58 +10:00
Tim Reichen
d279c0a49a
test(yaml): add int type tests (#5868)
initial commit
2024-08-30 10:02:13 +10:00
Tim Reichen
15bf9115dd
refactor(yaml): simplify set type (#5867) 2024-08-30 09:42:56 +10:00
Tim Reichen
a26ce0fb4a
test(yaml): add set type test (#5866)
initial commit
2024-08-30 09:35:49 +10:00
Tim Reichen
b7efc57d4f
refactor(yaml): simplify regexp type (#5860)
initial commit

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-30 08:58:14 +10:00
Tim Reichen
0b59bfd465
test(yaml): add regexp type tests (#5862)
* initial commit

* update

* update
2024-08-30 08:53:08 +10:00
Tim Reichen
fab118b515
refactor(yaml): move duplicate and duplicateIndex (#5836)
* initial commit

* update
2024-08-30 08:52:17 +10:00
Ben McLean
c3b113d7a9
refactor(path): make isWindows check compatible with Node and Bun (#4961)
* Refactored to get rid of unnecessary function.

All that needs to be done here is to check if
the version is windows. Handling each combination
of runtime and operating system will make
the existing osType difficult to test and maintain.

* Changed browser version of isWindows.

It was using a deprecated web API.

* Refactored getIsWindows.

* Added node/bun version of isWindows.

* Got cross platform os module working.

* Handled Deno error.

* Fixed type errors.

* Removed node:os import.

This is how NodeJS checks to see
if the underlying OS is windows.

* tweaks

* fix

* cleanup

* tweak

* fix

* Added support for node.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-30 08:39:59 +10:00