Commit Graph

4706 Commits

Author SHA1 Message Date
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
Tim Reichen
0a71a4d3db
refactor(yaml): inline composeNode() (#5861)
* initial commit

* update
2024-08-29 17:43:20 +10:00
Tim Reichen
745c4a61ae
refactor(yaml): simplify resolve() for pairs (#5852)
initial commit
2024-08-29 10:38:29 +10:00
Emerson Laurentino
8b9a139472
fix(dotenv): handle single-quotes in values in stringify() (#5846)
* refactor(dotenv): add parse function and test

* refactor(dotenv): escape single quotes in stringify function

* refactor(dotenv): fix stringify function to correctly escape single quotes

* refactor(dotenv): fix stringify function to correctly escape single quotes

* tweak

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-29 10:32:39 +10:00
Tim Reichen
2c4287178a
refactor(yaml): simplify null type (#5858)
initial commit
2024-08-29 10:17:00 +10:00
Tim Reichen
11fce1a431
refactor(yaml): simplify boolean type (#5859)
initial commit
2024-08-29 10:15:38 +10:00
Kitson Kelly
b8df2b3494
fix(http): less restrictive arguments for accepts*() functions (#5850)
* fix(http): less restrictive types

* tweaks

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-29 10:09:44 +10:00
Tim Reichen
a7e072881c
refactor(yaml): inline readAlias() (#5856)
initial commit
2024-08-29 09:49:40 +10:00
Ian Bull
3b3a7617ab
refactor(assert,datetime,fmt,io,streams): consistently throw new Error() instead of throw Error() (#5855)
refactor(assert, datetime, fmt, io, streams): use `throw new Error` instead of `throw`

To ensure consistency across the codebase, this commit refactors the
codebase to use `throw new Error` instead of `throw` for throwing
errors.

https://github.com/denoland/std/issues/5854
2024-08-29 08:55:24 +10:00
Tim Reichen
a55ee9c84d
refactor(yaml): inline readAnchorProperty() (#5853) 2024-08-28 17:33:07 +10:00
Tim Reichen
c7835496e4
refactor(yaml): simplify omap resolve() (#5843)
* initial commit

* update
2024-08-28 17:22:55 +10:00
Tim Reichen
8770ff156c
refactor(yaml): simplify pair construct() function (#5844)
* initial commit

* Update yaml/_type/pairs.ts

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>

* update

* update

* update

* fix

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-28 17:20:19 +10:00
Tim Reichen
937da3966e
refactor(yaml): inline readTagProperty() (#5849)
initial commit
2024-08-28 17:11:23 +10:00
lionel-rowe
2e209c0ff6
docs(async): add note about deadline() DOMException name of TimeoutError (#5833)
* docs(async): add note about deadline DOMException name of TimeoutError

* Document all cases for thrown error
2024-08-28 15:46:19 +10:00
Tim Reichen
29fdb0d536
refactor(yaml): replace getObjectTypeString() with isPlainObject() (#5842)
* initial commit

* fmt
2024-08-28 15:37:14 +10:00
Tim Reichen
f7fe38a182
refactor(yaml): inline readBlockMapping() (#5847)
initial commit
2024-08-28 10:34:06 +10:00
Tim Reichen
cde346da13
refactor(yaml): inline readBlockScalar() (#5841) 2024-08-28 06:35:05 +10:00
familyboat
baa5086dff
chore(yaml): fix typo in inline comment (#5845) 2024-08-27 23:51:27 +09:00
Tim Reichen
ab2c1cd7ca
refactor(yaml): inline readFlowCollection() (#5840) 2024-08-27 18:40:56 +10:00
Tim Reichen
3dbccc5a84
refactor(yaml): change error message in stringifyNode() (#5839) 2024-08-27 18:40:03 +10:00
Tim Reichen
eeaada9c18
test(yaml): add duplicate binary references test (#5837) 2024-08-27 18:26:08 +10:00
Tim Reichen
2b66301364
refactor(yaml): inline readDoubleQuotedScalar() (#5838) 2024-08-27 18:24:42 +10:00
Ian Bull
7539060ceb
refactor(expect): align error messages in the matchers (#5835) 2024-08-27 14:18:01 +09:00
lionel-rowe
15fc72c273
fix(msgpack): accept readonly input data in encode() (#5832)
feat(msgpack): accept readonly input data (#5831)
2024-08-27 15:16:03 +10:00
Ian Bull
64d80042b1
refactor(yaml): align additional error messages (#5806)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-08-27 14:03:26 +09:00