@temboplus/afloat 0.1.60 → 0.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
- package/esm/src/models/contact/validation.test.d.ts.map +0 -1
- package/esm/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
- package/script/npm/src/_dnt.test_shims.d.ts +0 -6
- package/script/npm/src/_dnt.test_shims.d.ts.map +0 -1
- package/script/npm/src/_dnt.test_shims.js +0 -65
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.js +0 -49
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts +0 -24
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/array_includes.js +0 -49
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assert.d.ts +0 -16
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assert.js +0 -25
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts +0 -26
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.js +0 -34
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equal.d.ts +0 -17
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equal.js +0 -209
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equals.d.ts +0 -35
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equals.js +0 -61
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/exists.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/exists.js +0 -30
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/fail.d.ts +0 -15
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/fail.js +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/false.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/false.js +0 -25
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/instance_of.js +0 -55
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts +0 -25
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/is_error.js +0 -56
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less.d.ts +0 -19
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less.js +0 -31
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/match.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/match.js +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/mod.d.ts +0 -44
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/mod.js +0 -61
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts +0 -21
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_equals.js +0 -36
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_match.js +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.js +0 -35
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/object_match.js +0 -163
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts +0 -42
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/rejects.js +0 -56
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts +0 -24
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.js +0 -60
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/string_includes.js +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/throws.d.ts +0 -45
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/throws.js +0 -47
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts +0 -15
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.js +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts +0 -15
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unreachable.js +0 -23
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -115
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -283
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -185
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/format.js +0 -63
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -242
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/script/npm/src/src/models/contact/derivatives/contact.test.d.ts +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.test.js +0 -64
- package/script/npm/src/src/models/contact/derivatives/contact_info.test.d.ts +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.test.js +0 -331
- package/script/npm/src/src/models/contact/validation.test.d.ts +0 -2
- package/script/npm/src/src/models/contact/validation.test.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/validation.test.js +0 -186
- package/script/npm/src/src/models/payout/derivatives/payout.test.d.ts +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.test.js +0 -76
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertObjectMatch = assertObjectMatch;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const equals_js_1 = require("./equals.js");
|
|
7
|
-
/**
|
|
8
|
-
* Make an assertion that `expected` object is a subset of `actual` object,
|
|
9
|
-
* deeply. If not, then throw a diff of the objects, with mismatching
|
|
10
|
-
* properties highlighted.
|
|
11
|
-
*
|
|
12
|
-
* @example Usage
|
|
13
|
-
* ```ts ignore
|
|
14
|
-
* import { assertObjectMatch } from "@std/assert";
|
|
15
|
-
*
|
|
16
|
-
* assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
|
|
17
|
-
* assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws
|
|
18
|
-
* assertObjectMatch({ foo: 1, bar: 2 }, { foo: 1 }); // Doesn't throw
|
|
19
|
-
* assertObjectMatch({ foo: 1 }, { foo: 1, bar: 2 }); // Throws
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @example Usage with nested objects
|
|
23
|
-
* ```ts ignore
|
|
24
|
-
* import { assertObjectMatch } from "@std/assert";
|
|
25
|
-
*
|
|
26
|
-
* assertObjectMatch({ foo: { bar: 3, baz: 4 } }, { foo: { bar: 3 } }); // Doesn't throw
|
|
27
|
-
* assertObjectMatch({ foo: { bar: 3 } }, { foo: { bar: 3, baz: 4 } }); // Throws
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @param actual The actual value to be matched.
|
|
31
|
-
* @param expected The expected value to match.
|
|
32
|
-
* @param msg The optional message to display if the assertion fails.
|
|
33
|
-
*/
|
|
34
|
-
function assertObjectMatch(
|
|
35
|
-
// deno-lint-ignore no-explicit-any
|
|
36
|
-
actual, expected, msg) {
|
|
37
|
-
return (0, equals_js_1.assertEquals)(
|
|
38
|
-
// get the intersection of "actual" and "expected"
|
|
39
|
-
// side effect: all the instances' constructor field is "Object" now.
|
|
40
|
-
filter(actual, expected),
|
|
41
|
-
// set (nested) instances' constructor field to be "Object" without changing expected value.
|
|
42
|
-
// see https://github.com/denoland/deno_std/pull/1419
|
|
43
|
-
filter(expected, expected), msg);
|
|
44
|
-
}
|
|
45
|
-
function isObject(val) {
|
|
46
|
-
return typeof val === "object" && val !== null;
|
|
47
|
-
}
|
|
48
|
-
function filter(a, b) {
|
|
49
|
-
const seen = new WeakMap();
|
|
50
|
-
return filterObject(a, b);
|
|
51
|
-
function filterObject(a, b) {
|
|
52
|
-
// Prevent infinite loop with circular references with same filter
|
|
53
|
-
if ((seen.has(a)) && (seen.get(a) === b)) {
|
|
54
|
-
return a;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
seen.set(a, b);
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
if (err instanceof TypeError) {
|
|
61
|
-
throw new TypeError(`Cannot assertObjectMatch ${a === null ? null : `type ${typeof a}`}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// Filter keys and symbols which are present in both actual and expected
|
|
65
|
-
const filtered = {};
|
|
66
|
-
const keysA = Reflect.ownKeys(a);
|
|
67
|
-
const keysB = Reflect.ownKeys(b);
|
|
68
|
-
const entries = keysA.filter((key) => keysB.includes(key))
|
|
69
|
-
.map((key) => [key, a[key]]);
|
|
70
|
-
if (keysA.length && keysB.length && !entries.length) {
|
|
71
|
-
// If both objects are not empty but don't have the same keys or symbols,
|
|
72
|
-
// returns the entries in object a.
|
|
73
|
-
for (const key of keysA) {
|
|
74
|
-
filtered[key] = a[key];
|
|
75
|
-
}
|
|
76
|
-
return filtered;
|
|
77
|
-
}
|
|
78
|
-
for (const [key, value] of entries) {
|
|
79
|
-
// On regexp references, keep value as it to avoid loosing pattern and flags
|
|
80
|
-
if (value instanceof RegExp) {
|
|
81
|
-
filtered[key] = value;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const subset = b[key];
|
|
85
|
-
// On array references, build a filtered array and filter nested objects inside
|
|
86
|
-
if (Array.isArray(value) && Array.isArray(subset)) {
|
|
87
|
-
filtered[key] = filterArray(value, subset);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
// On nested objects references, build a filtered object recursively
|
|
91
|
-
if (isObject(value) && isObject(subset)) {
|
|
92
|
-
// When both operands are maps, build a filtered map with common keys and filter nested objects inside
|
|
93
|
-
if ((value instanceof Map) && (subset instanceof Map)) {
|
|
94
|
-
filtered[key] = new Map([...value].filter(([k]) => subset.has(k)).map(([k, v]) => {
|
|
95
|
-
const v2 = subset.get(k);
|
|
96
|
-
if (isObject(v) && isObject(v2)) {
|
|
97
|
-
return [k, filterObject(v, v2)];
|
|
98
|
-
}
|
|
99
|
-
return [k, v];
|
|
100
|
-
}));
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
// When both operands are set, build a filtered set with common values
|
|
104
|
-
if ((value instanceof Set) && (subset instanceof Set)) {
|
|
105
|
-
filtered[key] = value.intersection(subset);
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
filtered[key] = filterObject(value, subset);
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
filtered[key] = value;
|
|
112
|
-
}
|
|
113
|
-
return filtered;
|
|
114
|
-
}
|
|
115
|
-
function filterArray(a, b) {
|
|
116
|
-
// Prevent infinite loop with circular references with same filter
|
|
117
|
-
if (seen.has(a) && (seen.get(a) === b)) {
|
|
118
|
-
return a;
|
|
119
|
-
}
|
|
120
|
-
seen.set(a, b);
|
|
121
|
-
const filtered = [];
|
|
122
|
-
const count = Math.min(a.length, b.length);
|
|
123
|
-
for (let i = 0; i < count; ++i) {
|
|
124
|
-
const value = a[i];
|
|
125
|
-
const subset = b[i];
|
|
126
|
-
// On regexp references, keep value as it to avoid loosing pattern and flags
|
|
127
|
-
if (value instanceof RegExp) {
|
|
128
|
-
filtered.push(value);
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
// On array references, build a filtered array and filter nested objects inside
|
|
132
|
-
if (Array.isArray(value) && Array.isArray(subset)) {
|
|
133
|
-
filtered.push(filterArray(value, subset));
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
// On nested objects references, build a filtered object recursively
|
|
137
|
-
if (isObject(value) && isObject(subset)) {
|
|
138
|
-
// When both operands are maps, build a filtered map with common keys and filter nested objects inside
|
|
139
|
-
if ((value instanceof Map) && (subset instanceof Map)) {
|
|
140
|
-
const map = new Map([...value].filter(([k]) => subset.has(k))
|
|
141
|
-
.map(([k, v]) => {
|
|
142
|
-
const v2 = subset.get(k);
|
|
143
|
-
if (isObject(v) && isObject(v2)) {
|
|
144
|
-
return [k, filterObject(v, v2)];
|
|
145
|
-
}
|
|
146
|
-
return [k, v];
|
|
147
|
-
}));
|
|
148
|
-
filtered.push(map);
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
// When both operands are set, build a filtered set with common values
|
|
152
|
-
if ((value instanceof Set) && (subset instanceof Set)) {
|
|
153
|
-
filtered.push(value.intersection(subset));
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
filtered.push(filterObject(value, subset));
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
filtered.push(value);
|
|
160
|
-
}
|
|
161
|
-
return filtered;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Executes a function which returns a promise, expecting it to reject.
|
|
3
|
-
*
|
|
4
|
-
* To assert that a synchronous function throws, use {@linkcode assertThrows}.
|
|
5
|
-
*
|
|
6
|
-
* @example Usage
|
|
7
|
-
* ```ts ignore
|
|
8
|
-
* import { assertRejects } from "@std/assert";
|
|
9
|
-
*
|
|
10
|
-
* await assertRejects(async () => Promise.reject(new Error())); // Doesn't throw
|
|
11
|
-
* await assertRejects(async () => console.log("Hello world")); // Throws
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @param fn The function to execute.
|
|
15
|
-
* @param msg The optional message to display if the assertion fails.
|
|
16
|
-
* @returns The promise which resolves to the thrown error.
|
|
17
|
-
*/
|
|
18
|
-
export declare function assertRejects(fn: () => PromiseLike<unknown>, msg?: string): Promise<unknown>;
|
|
19
|
-
/**
|
|
20
|
-
* Executes a function which returns a promise, expecting it to reject.
|
|
21
|
-
* If it does not, then it throws. An error class and a string that should be
|
|
22
|
-
* included in the error message can also be asserted.
|
|
23
|
-
*
|
|
24
|
-
* To assert that a synchronous function throws, use {@linkcode assertThrows}.
|
|
25
|
-
*
|
|
26
|
-
* @example Usage
|
|
27
|
-
* ```ts ignore
|
|
28
|
-
* import { assertRejects } from "@std/assert";
|
|
29
|
-
*
|
|
30
|
-
* await assertRejects(async () => Promise.reject(new Error()), Error); // Doesn't throw
|
|
31
|
-
* await assertRejects(async () => Promise.reject(new Error()), SyntaxError); // Throws
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @typeParam E The error class to assert.
|
|
35
|
-
* @param fn The function to execute.
|
|
36
|
-
* @param ErrorClass The error class to assert.
|
|
37
|
-
* @param msgIncludes The string that should be included in the error message.
|
|
38
|
-
* @param msg The optional message to display if the assertion fails.
|
|
39
|
-
* @returns The promise which resolves to the thrown error.
|
|
40
|
-
*/
|
|
41
|
-
export declare function assertRejects<E extends Error = Error>(fn: () => PromiseLike<unknown>, ErrorClass: abstract new (...args: any[]) => E, msgIncludes?: string, msg?: string): Promise<E>;
|
|
42
|
-
//# sourceMappingURL=rejects.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rejects.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@std/assert/1.0.10/rejects.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAAC;AACpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAE9B,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertRejects = assertRejects;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const assertion_error_js_1 = require("./assertion_error.js");
|
|
7
|
-
const is_error_js_1 = require("./is_error.js");
|
|
8
|
-
async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
9
|
-
// deno-lint-ignore no-explicit-any
|
|
10
|
-
let ErrorClass;
|
|
11
|
-
let msgIncludes;
|
|
12
|
-
let err;
|
|
13
|
-
if (typeof errorClassOrMsg !== "string") {
|
|
14
|
-
if (errorClassOrMsg === undefined ||
|
|
15
|
-
errorClassOrMsg.prototype instanceof Error ||
|
|
16
|
-
errorClassOrMsg.prototype === Error.prototype) {
|
|
17
|
-
ErrorClass = errorClassOrMsg;
|
|
18
|
-
msgIncludes = msgIncludesOrMsg;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
msg = errorClassOrMsg;
|
|
23
|
-
}
|
|
24
|
-
let doesThrow = false;
|
|
25
|
-
let isPromiseReturned = false;
|
|
26
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
27
|
-
try {
|
|
28
|
-
const possiblePromise = fn();
|
|
29
|
-
if (possiblePromise &&
|
|
30
|
-
typeof possiblePromise === "object" &&
|
|
31
|
-
typeof possiblePromise.then === "function") {
|
|
32
|
-
isPromiseReturned = true;
|
|
33
|
-
await possiblePromise;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
throw new Error();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (!isPromiseReturned) {
|
|
41
|
-
throw new assertion_error_js_1.AssertionError(`Function throws when expected to reject${msgSuffix}`);
|
|
42
|
-
}
|
|
43
|
-
if (ErrorClass) {
|
|
44
|
-
if (!(error instanceof Error)) {
|
|
45
|
-
throw new assertion_error_js_1.AssertionError(`A non-Error object was rejected${msgSuffix}`);
|
|
46
|
-
}
|
|
47
|
-
(0, is_error_js_1.assertIsError)(error, ErrorClass, msgIncludes, msg);
|
|
48
|
-
}
|
|
49
|
-
err = error;
|
|
50
|
-
doesThrow = true;
|
|
51
|
-
}
|
|
52
|
-
if (!doesThrow) {
|
|
53
|
-
throw new assertion_error_js_1.AssertionError(`Expected function to reject${msgSuffix}`);
|
|
54
|
-
}
|
|
55
|
-
return err;
|
|
56
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` and `expected` are strictly equal, using
|
|
3
|
-
* {@linkcode Object.is} for equality comparison. If not, then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertStrictEquals } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* const a = {};
|
|
10
|
-
* const b = a;
|
|
11
|
-
* assertStrictEquals(a, b); // Doesn't throw
|
|
12
|
-
*
|
|
13
|
-
* const c = {};
|
|
14
|
-
* const d = {};
|
|
15
|
-
* assertStrictEquals(c, d); // Throws
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @typeParam T The type of the expected value.
|
|
19
|
-
* @param actual The actual value to compare.
|
|
20
|
-
* @param expected The expected value to compare.
|
|
21
|
-
* @param msg The optional message to display if the assertion fails.
|
|
22
|
-
*/
|
|
23
|
-
export declare function assertStrictEquals<T>(actual: unknown, expected: T, msg?: string): asserts actual is T;
|
|
24
|
-
//# sourceMappingURL=strict_equals.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@std/assert/1.0.10/strict_equals.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,CAAC,CA+BrB"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertStrictEquals = assertStrictEquals;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const build_message_js_1 = require("../../internal/1.0.5/build_message.js");
|
|
7
|
-
const diff_js_1 = require("../../internal/1.0.5/diff.js");
|
|
8
|
-
const diff_str_js_1 = require("../../internal/1.0.5/diff_str.js");
|
|
9
|
-
const format_js_1 = require("../../internal/1.0.5/format.js");
|
|
10
|
-
const styles_js_1 = require("../../internal/1.0.5/styles.js");
|
|
11
|
-
const assertion_error_js_1 = require("./assertion_error.js");
|
|
12
|
-
/**
|
|
13
|
-
* Make an assertion that `actual` and `expected` are strictly equal, using
|
|
14
|
-
* {@linkcode Object.is} for equality comparison. If not, then throw.
|
|
15
|
-
*
|
|
16
|
-
* @example Usage
|
|
17
|
-
* ```ts ignore
|
|
18
|
-
* import { assertStrictEquals } from "@std/assert";
|
|
19
|
-
*
|
|
20
|
-
* const a = {};
|
|
21
|
-
* const b = a;
|
|
22
|
-
* assertStrictEquals(a, b); // Doesn't throw
|
|
23
|
-
*
|
|
24
|
-
* const c = {};
|
|
25
|
-
* const d = {};
|
|
26
|
-
* assertStrictEquals(c, d); // Throws
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @typeParam T The type of the expected value.
|
|
30
|
-
* @param actual The actual value to compare.
|
|
31
|
-
* @param expected The expected value to compare.
|
|
32
|
-
* @param msg The optional message to display if the assertion fails.
|
|
33
|
-
*/
|
|
34
|
-
function assertStrictEquals(actual, expected, msg) {
|
|
35
|
-
if (Object.is(actual, expected)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
39
|
-
let message;
|
|
40
|
-
const actualString = (0, format_js_1.format)(actual);
|
|
41
|
-
const expectedString = (0, format_js_1.format)(expected);
|
|
42
|
-
if (actualString === expectedString) {
|
|
43
|
-
const withOffset = actualString
|
|
44
|
-
.split("\n")
|
|
45
|
-
.map((l) => ` ${l}`)
|
|
46
|
-
.join("\n");
|
|
47
|
-
message =
|
|
48
|
-
`Values have the same structure but are not reference-equal${msgSuffix}\n\n${(0, styles_js_1.red)(withOffset)}\n`;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const stringDiff = (typeof actual === "string") &&
|
|
52
|
-
(typeof expected === "string");
|
|
53
|
-
const diffResult = stringDiff
|
|
54
|
-
? (0, diff_str_js_1.diffStr)(actual, expected)
|
|
55
|
-
: (0, diff_js_1.diff)(actualString.split("\n"), expectedString.split("\n"));
|
|
56
|
-
const diffMsg = (0, build_message_js_1.buildMessage)(diffResult, { stringDiff }).join("\n");
|
|
57
|
-
message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
|
|
58
|
-
}
|
|
59
|
-
throw new assertion_error_js_1.AssertionError(message);
|
|
60
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that actual includes expected. If not
|
|
3
|
-
* then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertStringIncludes } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertStringIncludes("Hello", "ello"); // Doesn't throw
|
|
10
|
-
* assertStringIncludes("Hello", "world"); // Throws
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param actual The actual string to check for inclusion.
|
|
14
|
-
* @param expected The expected string to check for inclusion.
|
|
15
|
-
* @param msg The optional message to display if the assertion fails.
|
|
16
|
-
*/
|
|
17
|
-
export declare function assertStringIncludes(actual: string, expected: string, msg?: string): void;
|
|
18
|
-
//# sourceMappingURL=string_includes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string_includes.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@std/assert/1.0.10/string_includes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertStringIncludes = assertStringIncludes;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const assertion_error_js_1 = require("./assertion_error.js");
|
|
7
|
-
/**
|
|
8
|
-
* Make an assertion that actual includes expected. If not
|
|
9
|
-
* then throw.
|
|
10
|
-
*
|
|
11
|
-
* @example Usage
|
|
12
|
-
* ```ts ignore
|
|
13
|
-
* import { assertStringIncludes } from "@std/assert";
|
|
14
|
-
*
|
|
15
|
-
* assertStringIncludes("Hello", "ello"); // Doesn't throw
|
|
16
|
-
* assertStringIncludes("Hello", "world"); // Throws
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @param actual The actual string to check for inclusion.
|
|
20
|
-
* @param expected The expected string to check for inclusion.
|
|
21
|
-
* @param msg The optional message to display if the assertion fails.
|
|
22
|
-
*/
|
|
23
|
-
function assertStringIncludes(actual, expected, msg) {
|
|
24
|
-
if (actual.includes(expected))
|
|
25
|
-
return;
|
|
26
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
27
|
-
msg = `Expected actual: "${actual}" to contain: "${expected}"${msgSuffix}`;
|
|
28
|
-
throw new assertion_error_js_1.AssertionError(msg);
|
|
29
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Executes a function, expecting it to throw. If it does not, then it
|
|
3
|
-
* throws.
|
|
4
|
-
*
|
|
5
|
-
* To assert that an asynchronous function rejects, use
|
|
6
|
-
* {@linkcode assertRejects}.
|
|
7
|
-
*
|
|
8
|
-
* @example Usage
|
|
9
|
-
* ```ts ignore
|
|
10
|
-
* import { assertThrows } from "@std/assert";
|
|
11
|
-
*
|
|
12
|
-
* assertThrows(() => { throw new TypeError("hello world!"); }); // Doesn't throw
|
|
13
|
-
* assertThrows(() => console.log("hello world!")); // Throws
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @param fn The function to execute.
|
|
17
|
-
* @param msg The optional message to display if the assertion fails.
|
|
18
|
-
* @returns The error that was thrown.
|
|
19
|
-
*/
|
|
20
|
-
export declare function assertThrows(fn: () => unknown, msg?: string): unknown;
|
|
21
|
-
/**
|
|
22
|
-
* Executes a function, expecting it to throw. If it does not, then it
|
|
23
|
-
* throws. An error class and a string that should be included in the
|
|
24
|
-
* error message can also be asserted.
|
|
25
|
-
*
|
|
26
|
-
* To assert that an asynchronous function rejects, use
|
|
27
|
-
* {@linkcode assertRejects}.
|
|
28
|
-
*
|
|
29
|
-
* @example Usage
|
|
30
|
-
* ```ts ignore
|
|
31
|
-
* import { assertThrows } from "@std/assert";
|
|
32
|
-
*
|
|
33
|
-
* assertThrows(() => { throw new TypeError("hello world!"); }, TypeError); // Doesn't throw
|
|
34
|
-
* assertThrows(() => { throw new TypeError("hello world!"); }, RangeError); // Throws
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @typeParam E The error class to assert.
|
|
38
|
-
* @param fn The function to execute.
|
|
39
|
-
* @param ErrorClass The error class to assert.
|
|
40
|
-
* @param msgIncludes The string that should be included in the error message.
|
|
41
|
-
* @param msg The optional message to display if the assertion fails.
|
|
42
|
-
* @returns The error that was thrown.
|
|
43
|
-
*/
|
|
44
|
-
export declare function assertThrows<E extends Error = Error>(fn: () => unknown, ErrorClass: abstract new (...args: any[]) => E, msgIncludes?: string, msg?: string): E;
|
|
45
|
-
//# sourceMappingURL=throws.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@std/assert/1.0.10/throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertThrows = assertThrows;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const is_error_js_1 = require("./is_error.js");
|
|
7
|
-
const assertion_error_js_1 = require("./assertion_error.js");
|
|
8
|
-
function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
9
|
-
// deno-lint-ignore no-explicit-any
|
|
10
|
-
let ErrorClass;
|
|
11
|
-
let msgIncludes;
|
|
12
|
-
let err;
|
|
13
|
-
if (typeof errorClassOrMsg !== "string") {
|
|
14
|
-
if (errorClassOrMsg === undefined ||
|
|
15
|
-
errorClassOrMsg?.prototype instanceof Error ||
|
|
16
|
-
errorClassOrMsg?.prototype === Error.prototype) {
|
|
17
|
-
ErrorClass = errorClassOrMsg;
|
|
18
|
-
msgIncludes = msgIncludesOrMsg;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
msg = msgIncludesOrMsg;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
msg = errorClassOrMsg;
|
|
26
|
-
}
|
|
27
|
-
let doesThrow = false;
|
|
28
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
29
|
-
try {
|
|
30
|
-
fn();
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
if (ErrorClass) {
|
|
34
|
-
if (error instanceof Error === false) {
|
|
35
|
-
throw new assertion_error_js_1.AssertionError(`A non-Error object was thrown${msgSuffix}`);
|
|
36
|
-
}
|
|
37
|
-
(0, is_error_js_1.assertIsError)(error, ErrorClass, msgIncludes, msg);
|
|
38
|
-
}
|
|
39
|
-
err = error;
|
|
40
|
-
doesThrow = true;
|
|
41
|
-
}
|
|
42
|
-
if (!doesThrow) {
|
|
43
|
-
msg = `Expected function to throw${msgSuffix}`;
|
|
44
|
-
throw new assertion_error_js_1.AssertionError(msg);
|
|
45
|
-
}
|
|
46
|
-
return err;
|
|
47
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use this to stub out methods that will throw when invoked.
|
|
3
|
-
*
|
|
4
|
-
* @example Usage
|
|
5
|
-
* ```ts ignore
|
|
6
|
-
* import { unimplemented } from "@std/assert";
|
|
7
|
-
*
|
|
8
|
-
* unimplemented(); // Throws
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @param msg Optional message to include in the error.
|
|
12
|
-
* @returns Never returns, always throws.
|
|
13
|
-
*/
|
|
14
|
-
export declare function unimplemented(msg?: string): never;
|
|
15
|
-
//# sourceMappingURL=unimplemented.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unimplemented.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@std/assert/1.0.10/unimplemented.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGjD"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unimplemented = unimplemented;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const assertion_error_js_1 = require("./assertion_error.js");
|
|
7
|
-
/**
|
|
8
|
-
* Use this to stub out methods that will throw when invoked.
|
|
9
|
-
*
|
|
10
|
-
* @example Usage
|
|
11
|
-
* ```ts ignore
|
|
12
|
-
* import { unimplemented } from "@std/assert";
|
|
13
|
-
*
|
|
14
|
-
* unimplemented(); // Throws
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @param msg Optional message to include in the error.
|
|
18
|
-
* @returns Never returns, always throws.
|
|
19
|
-
*/
|
|
20
|
-
function unimplemented(msg) {
|
|
21
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
22
|
-
throw new assertion_error_js_1.AssertionError(`Unimplemented${msgSuffix}`);
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use this to assert unreachable code.
|
|
3
|
-
*
|
|
4
|
-
* @example Usage
|
|
5
|
-
* ```ts ignore
|
|
6
|
-
* import { unreachable } from "@std/assert";
|
|
7
|
-
*
|
|
8
|
-
* unreachable(); // Throws
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @param msg Optional message to include in the error.
|
|
12
|
-
* @returns Never returns, always throws.
|
|
13
|
-
*/
|
|
14
|
-
export declare function unreachable(msg?: string): never;
|
|
15
|
-
//# sourceMappingURL=unreachable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@std/assert/1.0.10/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unreachable = unreachable;
|
|
4
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
|
-
// This module is browser compatible.
|
|
6
|
-
const assertion_error_js_1 = require("./assertion_error.js");
|
|
7
|
-
/**
|
|
8
|
-
* Use this to assert unreachable code.
|
|
9
|
-
*
|
|
10
|
-
* @example Usage
|
|
11
|
-
* ```ts ignore
|
|
12
|
-
* import { unreachable } from "@std/assert";
|
|
13
|
-
*
|
|
14
|
-
* unreachable(); // Throws
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @param msg Optional message to include in the error.
|
|
18
|
-
* @returns Never returns, always throws.
|
|
19
|
-
*/
|
|
20
|
-
function unreachable(msg) {
|
|
21
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
22
|
-
throw new assertion_error_js_1.AssertionError(`Unreachable${msgSuffix}`);
|
|
23
|
-
}
|