Skip to content

Commit 478a8d7

Browse files
authored
Merge branch 'main' into tsgo
2 parents a572655 + c683d1e commit 478a8d7

File tree

130 files changed

+23193
-1485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+23193
-1485
lines changed

.github/labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ async:
77
bytes:
88
- changed-files:
99
- any-glob-to-any-file: bytes/**
10+
cache:
11+
- changed-files:
12+
- any-glob-to-any-file: cache/**
1013
cbor:
1114
- changed-files:
1215
- any-glob-to-any-file: cbor/**
@@ -115,6 +118,9 @@ uuid:
115118
webgpu:
116119
- changed-files:
117120
- any-glob-to-any-file: webgpu/**
121+
xml:
122+
- changed-files:
123+
- any-glob-to-any-file: xml/**
118124
yaml:
119125
- changed-files:
120126
- any-glob-to-any-file: yaml/**

.github/workflows/title.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ jobs:
7676
ulid(/unstable)?
7777
uuid(/unstable)?
7878
webgpu(/unstable)?
79+
xml(/unstable)?
7980
yaml(/unstable)?

Releases.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
### 2026.02.20
2+
3+
#### @std/assert 1.0.19 (patch)
4+
5+
- fix(assert): preserve Date instances in assertObjectMatch filter (#6988)
6+
- docs(assert): add a note about unreliable equality (#6989)
7+
8+
#### @std/async 1.2.0 (minor)
9+
10+
- feat(async): stabilize abort signal support in retry (#6968)
11+
- feat(async/unstable): add `Lazy` for once-only async init (#7007)
12+
- feat(async/unstable): allow `AbortableOptions` with optional signal in
13+
`abortable` (#6971)
14+
- feat(async/unstable): add poll function (#6973)
15+
- feat(async/unstable): add allKeyed and allSettledKeyed (#6959)
16+
- refactor(async/unstable): apply style guide to circuit breaker (#7008)
17+
- refactor(async/unstable): make circuit breaker resilient to throwing callbacks
18+
(#6996)
19+
20+
#### @std/cli 1.0.28 (patch)
21+
22+
- feat(cli/unstable): introduce StaticLine (#6758)
23+
- fix(cli): handle empty value in parseArgs (#6995)
24+
- fix(cli): prevent prototype pollution in parseArgs (#6980)
25+
26+
#### @std/collections 1.1.6 (patch)
27+
28+
- fix(collections): stricter enforcement on generics (#6961)
29+
30+
#### @std/expect 1.0.18 (patch)
31+
32+
- feat(expect/unstable): implement toMatchSnapshot() (#7003)
33+
34+
#### @std/fs 1.0.23 (patch)
35+
36+
- fix(fs/unstable): use crypto.getRandomValues() for temp file naming (#6983)
37+
38+
#### @std/http 1.0.25 (patch)
39+
40+
- feat(http/unstable): add `Cache-Control` header parser and formatter (#7005)
41+
- feat(http/unstable): implement RFC 9651 Structured Field Values (#6963)
42+
- fix(http): guard top-level Deno global access for browser compatibility
43+
(#6987)
44+
- refactor(http/unstable): improve route() method matching (#6990)
45+
46+
#### @std/json 1.0.3 (patch)
47+
48+
- feat(json/unstable): implement RFC 8785 JSON canonicalization (#6965)
49+
50+
#### @std/xml 0.1.0 (minor)
51+
52+
- feat(xml/unstable): add XML parsing and serialization module (#6981)
53+
- docs(xml): clean up JSDoc and error message style (#7009)
54+
- refactor(xml): improve tokenizer edge cases and performance (#6997)
55+
56+
#### @std/yaml 1.0.12 (patch)
57+
58+
- refactor(yaml): add `Scanner` class (#6958)
59+
160
### 2026.01.30
261

362
#### @std/assert 1.0.18 (patch)

_tools/check_docs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ type DocNodeWithJsDoc<T = DocNodeBase> = T & {
3030
jsDoc: JsDoc;
3131
};
3232

33-
const TS_SNIPPET = /```ts[\s\S]*?```/g;
34-
const ASSERTION_IMPORT =
33+
const TS_SNIPPET_REGEXP = /```ts[\s\S]*?```/g;
34+
const ASSERTION_IMPORT_REGEXP =
3535
/from "@std\/(assert(\/[a-z-]+)?|expect(\/[a-z-]+)?|testing\/(mock|snapshot|types))"/g;
3636
const NEWLINE = "\n";
3737
const diagnostics: DocumentError[] = [];
@@ -142,7 +142,7 @@ function assertHasSnippets(
142142
doc: string,
143143
document: { jsDoc: JsDoc; location: Location },
144144
) {
145-
const snippets = doc.match(TS_SNIPPET);
145+
const snippets = doc.match(TS_SNIPPET_REGEXP);
146146
assert(
147147
snippets !== null,
148148
"@example tag must have a TypeScript code snippet",
@@ -155,7 +155,7 @@ function assertHasSnippets(
155155
snippet = snippet.split(NEWLINE).slice(1, -1).join(NEWLINE);
156156
if (!(delim?.includes("no-assert") || delim?.includes("ignore"))) {
157157
assert(
158-
snippet.match(ASSERTION_IMPORT) !== null,
158+
snippet.match(ASSERTION_IMPORT_REGEXP) !== null,
159159
"Snippet must contain assertion from `@std/assert`, `@std/expect` or `@std/testing`",
160160
document,
161161
);

_tools/lint_plugin.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import { toFileUrl } from "@std/path/to-file-url";
1111
import { resolve } from "@std/path/resolve";
1212

1313
const PASCAL_CASE_REGEXP = /^_?(?:[A-Z][a-z0-9]*)*_?$/;
14-
const UPPER_CASE_ONLY = /^_?[A-Z]{2,}$/;
14+
const UPPER_CASE_ONLY_REGEXP = /^_?[A-Z]{2,}$/;
1515
function isPascalCase(string: string): boolean {
16-
return PASCAL_CASE_REGEXP.test(string) && !UPPER_CASE_ONLY.test(string);
16+
return PASCAL_CASE_REGEXP.test(string) &&
17+
!UPPER_CASE_ONLY_REGEXP.test(string);
1718
}
1819

1920
const CAMEL_CASE_REGEXP = /^[_a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*_?$/;
@@ -233,6 +234,38 @@ export default {
233234
if (id.type !== "Identifier") return;
234235
const name = id.name;
235236
if (!name) return;
237+
if (isConstantCase(name)) {
238+
if (
239+
declaration.init?.type === "NewExpression" &&
240+
declaration.init.callee.type === "Identifier"
241+
) {
242+
switch (declaration.init.callee.name) {
243+
case "RegExp": {
244+
if (name !== "REGEXP" && !name.endsWith("_REGEXP")) {
245+
context.report({
246+
node: id,
247+
message:
248+
`RegExp variable name '${name}' must end with _REGEXP.`,
249+
fix: (fixer) =>
250+
fixer.replaceText(id, `${name}_REGEXP`),
251+
});
252+
}
253+
break;
254+
}
255+
}
256+
} else if (
257+
declaration.init?.type === "Literal" &&
258+
declaration.init.value instanceof RegExp &&
259+
name !== "REGEXP" && !name.endsWith("_REGEXP")
260+
) {
261+
context.report({
262+
node: id,
263+
message:
264+
`RegExp variable name '${name}' must end with _REGEXP.`,
265+
fix: (fixer) => fixer.replaceText(id, `${name}_REGEXP`),
266+
});
267+
}
268+
}
236269
if (
237270
!isConstantCase(name) && !isCamelCase(name) &&
238271
!isPascalCase(name)

_tools/node_test_runner/tsconfig_for_bun.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"@std/internal/os": ["./internal/os.ts"],
1111
"@std/internal/styles": ["./internal/styles.ts"],
1212
"@std/path": ["./path/mod.ts"],
13-
"@std/semver": ["./semver/mod.ts"]
13+
"@std/semver": ["./semver/mod.ts"],
14+
"@std/testing/types": ["./testing/types.ts"]
1415
}
1516
}
1617
}

assert/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@std/assert",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"exports": {
55
".": "./mod.ts",
66
"./assert": "./assert.ts",

assert/equal.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,18 @@ function sameValueZero(a: unknown, b: unknown) {
8989
/**
9090
* Deep equality comparison used in assertions.
9191
*
92+
* This function is based on value equality, but for some cases (such as data
93+
* that can only be read asynchronously or function properties) value equality
94+
* is not possible to determine. In such cases, reference equality is used
95+
* instead, which may cause false negatives for objects such as `Blob`s or
96+
* `Request`s.
97+
*
9298
* @param a The actual value
9399
* @param b The expected value
94100
* @returns `true` if the values are deeply equal, `false` otherwise
95101
*
102+
* @throws {TypeError} If either value is a `WeakMap` or `WeakSet`.
103+
*
96104
* @example Usage
97105
* ```ts
98106
* import { equal } from "@std/assert/equal";

assert/equals.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ import { AssertionError } from "./assertion_error.ts";
1515
* Type parameter can be specified to ensure values under comparison have the
1616
* same type.
1717
*
18-
* Note: When comparing `Blob` objects, you should first convert them to
19-
* `Uint8Array` using the `Blob.bytes()` method and then compare their
20-
* contents.
18+
* Note: This function is based on value equality, but for some cases (such as
19+
* data that can only be read asynchronously or function properties) value
20+
* equality is not possible to determine. In such cases, reference equality is
21+
* used instead, which may cause false negatives for objects such as `Blob`s or
22+
* `Request`s.
2123
*
2224
* @example Usage
2325
* ```ts ignore

assert/not_equals.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import { format } from "@std/internal/format";
1111
*
1212
* Type parameter can be specified to ensure values under comparison have the same type.
1313
*
14+
* Note: This function is based on value equality, but for some cases (such as
15+
* data that can only be read asynchronously or function properties) value
16+
* equality is not possible to determine. In such cases, reference equality is
17+
* used instead, which may cause false negatives for objects such as `Blob`s or
18+
* `Request`s.
19+
*
1420
* @example Usage
1521
* ```ts ignore
1622
* import { assertNotEquals } from "@std/assert";

0 commit comments

Comments
 (0)