Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(assert,async,bytes,cli,collections,crypto,csv,data-structures,datetime,dotenv,encoding,expect,fmt,front-matter,fs,html,http,ini,internal,io,json,jsonc,log,media-types,msgpack,net,path,semver,streams,testing,text,toml,ulid,url,uuid,webgpu,yaml): import from @std/assert #5199

Merged
merged 3 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion assert/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assert } from "@std/assert/assert";
* import { assert } from "@std/assert";
*
* assert("hello".includes("ello")); // Doesn't throw
* assert("hello".includes("world")); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_array_includes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type ArrayLikeArg<T> = ArrayLike<T> & object;
*
* @example Usage
* ```ts no-eval
* import { assertArrayIncludes } from "@std/assert/assert-array-includes";
* import { assertArrayIncludes } from "@std/assert";
*
* assertArrayIncludes([1, 2], [2]); // Doesn't throw
* assertArrayIncludes([1, 2], [3]); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* assertEquals("world", "world"); // Doesn't throw
* assertEquals("hello", "world"); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_exists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertExists } from "@std/assert/assert-exists";
* import { assertExists } from "@std/assert";
*
* assertExists("something"); // Doesn't throw
* assertExists(undefined); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_false.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Falsy = false | 0 | 0n | "" | null | undefined;
*
* @example Usage
* ```ts no-eval
* import { assertFalse } from "@std/assert/assert-false";
* import { assertFalse } from "@std/assert";
*
* assertFalse(false); // Doesn't throw
* assertFalse(true); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_greater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertGreater } from "@std/assert/assert-greater";
* import { assertGreater } from "@std/assert";
*
* assertGreater(2, 1); // Doesn't throw
* assertGreater(1, 1); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_greater_or_equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertGreaterOrEqual } from "@std/assert/assert-greater-or-equal";
* import { assertGreaterOrEqual } from "@std/assert";
*
* assertGreaterOrEqual(2, 1); // Doesn't throw
* assertGreaterOrEqual(1, 1); // Doesn't throw
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_instance_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ new (...args: any) => infer C ? C
*
* @example Usage
* ```ts no-eval
* import { assertInstanceOf } from "@std/assert/assert-instance-of";
* import { assertInstanceOf } from "@std/assert";
*
* assertInstanceOf(new Date(), Date); // Doesn't throw
* assertInstanceOf(new Date(), Number); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_is_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { stripAnsiCode } from "@std/internal/styles";
*
* @example Usage
* ```ts no-eval
* import { assertIsError } from "@std/assert/assert-is-error";
* import { assertIsError } from "@std/assert";
*
* assertIsError(null); // Throws
* assertIsError(new RangeError("Out of range")); // Doesn't throw
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_less.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertLess } from "@std/assert/assert-less";
* import { assertLess } from "@std/assert";
*
* assertLess(1, 2); // Doesn't throw
* assertLess(2, 1); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_less_or_equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertLessOrEqual } from "@std/assert/assert-less-or-equal";
* import { assertLessOrEqual } from "@std/assert";
*
* assertLessOrEqual(1, 2); // Doesn't throw
* assertLessOrEqual(1, 1); // Doesn't throw
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertMatch } from "@std/assert/assert-match";
* import { assertMatch } from "@std/assert";
*
* assertMatch("Raptor", RegExp(/Raptor/)); // Doesn't throw
* assertMatch("Denosaurus", RegExp(/Raptor/)); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_not_equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertNotEquals } from "@std/assert/assert-not-equals";
* import { assertNotEquals } from "@std/assert";
*
* assertNotEquals(1, 2); // Doesn't throw
* assertNotEquals(1, 1); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_not_instance_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { assertFalse } from "./assert_false.ts";
*
* @example Usage
* ```ts no-eval
* import { assertNotInstanceOf } from "@std/assert/assert-not-instance-of";
* import { assertNotInstanceOf } from "@std/assert";
*
* assertNotInstanceOf(new Date(), Number); // Doesn't throw
* assertNotInstanceOf(new Date(), Date); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_not_match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertNotMatch } from "@std/assert/assert-not-match";
* import { assertNotMatch } from "@std/assert";
*
* assertNotMatch("Denosaurus", RegExp(/Raptor/)); // Doesn't throw
* assertNotMatch("Raptor", RegExp(/Raptor/)); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_not_strict_equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { format } from "@std/internal/format";
*
* @example Usage
* ```ts no-eval
* import { assertNotStrictEquals } from "@std/assert/assert-not-strict-equals";
* import { assertNotStrictEquals } from "@std/assert";
*
* assertNotStrictEquals(1, 1); // Doesn't throw
* assertNotStrictEquals(1, 2); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_object_match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { assertEquals } from "./assert_equals.ts";
*
* @example Usage
* ```ts no-eval
* import { assertObjectMatch } from "@std/assert/assert-object-match";
* import { assertObjectMatch } from "@std/assert";
*
* assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
* assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws
Expand Down
4 changes: 2 additions & 2 deletions assert/assert_rejects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { assertIsError } from "./assert_is_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertRejects } from "@std/assert/assert-rejects";
* import { assertRejects } from "@std/assert";
*
* await assertRejects(async () => Promise.reject(new Error())); // Doesn't throw
* await assertRejects(async () => console.log("Hello world")); // Throws
Expand All @@ -33,7 +33,7 @@ export function assertRejects(
*
* @example Usage
* ```ts no-eval
* import { assertRejects } from "@std/assert/assert-rejects";
* import { assertRejects } from "@std/assert";
*
* await assertRejects(async () => Promise.reject(new Error()), Error); // Doesn't throw
* await assertRejects(async () => Promise.reject(new Error()), SyntaxError); // Throws
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_strict_equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertStrictEquals } from "@std/assert/assert-strict-equals";
* import { assertStrictEquals } from "@std/assert";
*
* const a = {};
* const b = a;
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_string_includes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertStringIncludes } from "@std/assert/assert-string-includes";
* import { assertStringIncludes } from "@std/assert";
*
* assertStringIncludes("Hello", "ello"); // Doesn't throw
* assertStringIncludes("Hello", "world"); // Throws
Expand Down
4 changes: 2 additions & 2 deletions assert/assert_throws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { assertThrows } from "@std/assert/assert-throws";
* import { assertThrows } from "@std/assert";
*
* assertThrows(() => { throw new TypeError("hello world!"); }); // Doesn't throw
* assertThrows(() => console.log("hello world!")); // Throws
Expand All @@ -36,7 +36,7 @@ export function assertThrows(
*
* @example Usage
* ```ts no-eval
* import { assertThrows } from "@std/assert/assert-throws";
* import { assertThrows } from "@std/assert";
*
* assertThrows(() => { throw new TypeError("hello world!"); }, TypeError); // Doesn't throw
* assertThrows(() => { throw new TypeError("hello world!"); }, RangeError); // Throws
Expand Down
4 changes: 2 additions & 2 deletions assert/assertion_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @example Usage
* ```ts no-eval
* import { AssertionError } from "@std/assert/assertion-error";
* import { AssertionError } from "@std/assert";
*
* throw new AssertionError("Assertion failed");
* ```
Expand All @@ -16,7 +16,7 @@ export class AssertionError extends Error {
*
* @example Usage
* ```ts no-eval
* import { AssertionError } from "@std/assert/assertion-error";
* import { AssertionError } from "@std/assert";
*
* throw new AssertionError("Assertion failed");
* ```
Expand Down
2 changes: 1 addition & 1 deletion assert/equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function constructorsEqual(a: object, b: object) {
*
* @example Usage
* ```ts
* import { equal } from "@std/assert/equal";
* import { equal } from "@std/assert";
*
* equal({ foo: "bar" }, { foo: "bar" }); // Returns `true`
* equal({ foo: "bar" }, { foo: "baz" }); // Returns `false
Expand Down
2 changes: 1 addition & 1 deletion assert/fail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { fail } from "@std/assert/fail";
* import { fail } from "@std/assert";
*
* fail("Deliberately failed!"); // Throws
* ```
Expand Down
2 changes: 1 addition & 1 deletion assert/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* values for AssertionError messages in browsers.
*
* ```ts no-eval
* import { assert } from "@std/assert/assert";
* import { assert } from "@std/assert";
*
* assert("I am truthy"); // Doesn't throw
* assert(false); // Throws `AssertionError`
Expand Down
2 changes: 1 addition & 1 deletion assert/unimplemented.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { unimplemented } from "@std/assert/unimplemented";
* import { unimplemented } from "@std/assert";
*
* unimplemented(); // Throws
* ```
Expand Down
2 changes: 1 addition & 1 deletion assert/unreachable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AssertionError } from "./assertion_error.ts";
*
* @example Usage
* ```ts no-eval
* import { unreachable } from "@std/assert/unreachable";
* import { unreachable } from "@std/assert";
*
* unreachable(); // Throws
* ```
Expand Down
8 changes: 4 additions & 4 deletions async/mux_async_iterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface TaggedYieldedValue<T> {
* @example Usage
* ```ts
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* async function* gen123(): AsyncIterableIterator<number> {
* yield 1;
Expand Down Expand Up @@ -55,7 +55,7 @@ export class MuxAsyncIterator<T> implements AsyncIterable<T> {
* @example Usage
* ```ts
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* async function* gen123(): AsyncIterableIterator<number> {
* yield 1;
Expand Down Expand Up @@ -99,7 +99,7 @@ export class MuxAsyncIterator<T> implements AsyncIterable<T> {
* @example Usage
* ```ts
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* async function* gen123(): AsyncIterableIterator<number> {
* yield 1;
Expand Down Expand Up @@ -144,7 +144,7 @@ export class MuxAsyncIterator<T> implements AsyncIterable<T> {
* @example Usage
* ```ts
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* async function* gen123(): AsyncIterableIterator<number> {
* yield 1;
Expand Down
2 changes: 1 addition & 1 deletion async/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ERROR_WHILE_MAPPING_MESSAGE = "Threw while mapping.";
* @example Usage
* ```ts
* import { pooledMap } from "@std/async/pool";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const results = pooledMap(
* 2,
Expand Down
2 changes: 1 addition & 1 deletion async/tee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Queue<T> {
* @example Usage
* ```ts
* import { tee } from "@std/async/tee";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const gen = async function* gen() {
* yield 1;
Expand Down
2 changes: 1 addition & 1 deletion bytes/concat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @example Basic usage
* ```ts
* import { concat } from "@std/bytes/concat";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const a = new Uint8Array([0, 1, 2]);
* const b = new Uint8Array([3, 4, 5]);
Expand Down
4 changes: 2 additions & 2 deletions bytes/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @example Basic usage
* ```ts
* import { copy } from "@std/bytes/copy";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const src = new Uint8Array([9, 8, 7]);
* const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
Expand All @@ -29,7 +29,7 @@
* @example Copy with offset
* ```ts
* import { copy } from "@std/bytes/copy";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const src = new Uint8Array([1, 1, 1, 1]);
* const dst = new Uint8Array([0, 0, 0, 0]);
Expand Down
2 changes: 1 addition & 1 deletion bytes/ends_with.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @example Basic usage
* ```ts
* import { endsWith } from "@std/bytes/ends-with";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const suffix = new Uint8Array([1, 2, 3]);
Expand Down
2 changes: 1 addition & 1 deletion bytes/equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const THRESHOLD_32_BIT = 160;
* @example Basic usage
* ```ts
* import { equals } from "@std/bytes/equals";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const a = new Uint8Array([1, 2, 3]);
* const b = new Uint8Array([1, 2, 3]);
Expand Down
4 changes: 2 additions & 2 deletions bytes/includes_needle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { indexOfNeedle } from "./index_of_needle.ts";
* @example Basic usage
* ```ts
* import { includesNeedle } from "@std/bytes/includes-needle";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const needle = new Uint8Array([1, 2]);
Expand All @@ -29,7 +29,7 @@ import { indexOfNeedle } from "./index_of_needle.ts";
* @example Start index
* ```ts
* import { includesNeedle } from "@std/bytes/includes-needle";
* import { assertEquals } from "@std/assert/assert-equals";
* import { assertEquals } from "@std/assert";
*
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const needle = new Uint8Array([1, 2]);
Expand Down
Loading