@bytebury/toolkit 1.0.0
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/LICENSE +21 -0
- package/README.md +49 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
- package/esm/mod.d.ts +7 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +6 -0
- package/esm/package.json +3 -0
- package/esm/src/core.d.ts +297 -0
- package/esm/src/core.d.ts.map +1 -0
- package/esm/src/core.js +256 -0
- package/esm/src/core_test.d.ts.map +1 -0
- package/esm/src/dates.d.ts +113 -0
- package/esm/src/dates.d.ts.map +1 -0
- package/esm/src/dates.js +197 -0
- package/esm/src/dates_test.d.ts.map +1 -0
- package/esm/src/duration.d.ts +102 -0
- package/esm/src/duration.d.ts.map +1 -0
- package/esm/src/duration.js +110 -0
- package/esm/src/duration_test.d.ts.map +1 -0
- package/esm/src/numbers.d.ts +58 -0
- package/esm/src/numbers.d.ts.map +1 -0
- package/esm/src/numbers.js +76 -0
- package/esm/src/numbers_test.d.ts.map +1 -0
- package/esm/src/strings.d.ts +164 -0
- package/esm/src/strings.d.ts.map +1 -0
- package/esm/src/strings.js +196 -0
- package/esm/src/strings_test.d.ts.map +1 -0
- package/esm/src/utility_types.d.ts +117 -0
- package/esm/src/utility_types.d.ts.map +1 -0
- package/esm/src/utility_types.js +1 -0
- package/package.json +28 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
- package/script/mod.d.ts +7 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +22 -0
- package/script/package.json +3 -0
- package/script/src/core.d.ts +297 -0
- package/script/src/core.d.ts.map +1 -0
- package/script/src/core.js +279 -0
- package/script/src/core_test.d.ts.map +1 -0
- package/script/src/dates.d.ts +113 -0
- package/script/src/dates.d.ts.map +1 -0
- package/script/src/dates.js +224 -0
- package/script/src/dates_test.d.ts.map +1 -0
- package/script/src/duration.d.ts +102 -0
- package/script/src/duration.d.ts.map +1 -0
- package/script/src/duration.js +114 -0
- package/script/src/duration_test.d.ts.map +1 -0
- package/script/src/numbers.d.ts +58 -0
- package/script/src/numbers.d.ts.map +1 -0
- package/script/src/numbers.js +81 -0
- package/script/src/numbers_test.d.ts.map +1 -0
- package/script/src/strings.d.ts +164 -0
- package/script/src/strings.d.ts.map +1 -0
- package/script/src/strings.js +209 -0
- package/script/src/strings_test.d.ts.map +1 -0
- package/script/src/utility_types.d.ts +117 -0
- package/script/src/utility_types.d.ts.map +1 -0
- package/script/src/utility_types.js +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 Bytebury LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="./assets/logo.png" alt="Toolkit Logo" width="256" height="256" /><br />
|
|
4
|
+
|
|
5
|
+
# toolkit
|
|
6
|
+
|
|
7
|
+
toolkit is a developer-friendly TypeScript utility library with small, <br />
|
|
8
|
+
well-typed helpers for common tasks. It’s designed to reduce boilerplate, <br />
|
|
9
|
+
stay out of your way, and feel natural to use in everyday projects.
|
|
10
|
+
|
|
11
|
+
<hr />
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
You can install this application from `npm` or `jsr`.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# recommended if using NodeJS
|
|
21
|
+
npx jsr add @bytebury/toolkit
|
|
22
|
+
|
|
23
|
+
# good, old-fashion npm
|
|
24
|
+
npm install @bytebury/toolkit --save
|
|
25
|
+
|
|
26
|
+
# or, if you're using Deno
|
|
27
|
+
deno add jsr:@bytebury/toolkit
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Sample Usage
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
function sayHelloTo(name: string): void {
|
|
34
|
+
if (isWhitespace(name) {
|
|
35
|
+
console.log("Hello, Guest!");
|
|
36
|
+
} else {
|
|
37
|
+
console.log(`Hello, ${title(name)}!`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getAverageAge(): number {
|
|
42
|
+
const people = [
|
|
43
|
+
{ name: "Tom", age: 2 },
|
|
44
|
+
{ name: "Carly", age: 8 },
|
|
45
|
+
{ name: "Jenny", age: 5 }
|
|
46
|
+
];
|
|
47
|
+
return average(people, "age"); // 5
|
|
48
|
+
}
|
|
49
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_dnt.test_polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.test_polyfills.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM;QACd;;;;WAIG;QACH,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;QAEvE;;;;WAIG;QACH,UAAU,CACR,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,GACtD,MAAM,CAAC;KACX;CACF;AAsBD,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"almost_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/almost_equals.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,QAmBb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/array_includes.ts"],"names":[],"mappings":"AAMA,0FAA0F;AAC1F,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,QAwBb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/equal.ts"],"names":[],"mappings":"AA0FA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAgHrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/equals.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAmBb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/exists.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAOlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fail.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/fail.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"false.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/false.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAI1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/greater.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAE9B,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAE9C,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CA6BnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"less.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/less.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"less_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/less_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not_instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_instance_of.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,EAET,cAAc,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAClD,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAKjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not_strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAYb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/object_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAE/B,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAChC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,GAAG,CAAC,EAAE,MAAM,GACX,IAAI,CAUN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejects.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/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,CAgCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/string_includes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unimplemented.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/unimplemented.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_message.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/build_message.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,QAAQ;AAClB;;;GAGG;AACH,UAAU,UAAQ,GACjB,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAWvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CASrD;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAC7C,OAAO,GAAE,mBAAwB,EACjC,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAC7C,UAAU,EAAE,OAAO,EACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,KAC1B,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GACrC,MAAM,EAAE,CA8BV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/diff.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAanD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAWvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,CAAC,EAAE,CAAC,EAAE,EACN,CAAC,EAAE,CAAC,EAAE,EACN,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,WAAW,EACnB,kBAAkB,EAAE,MAAM,GACzB,KAAK,CAAC;IACP,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAgCD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,WAAW,EACnB,kBAAkB,EAAE,MAAM,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,aAAa,EACrB,IAAI,CAAC,EAAE,aAAa,GACnB,aAAa,CAsBf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAwEvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff_str.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/diff_str.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,YAAY,CAAC;AAGhE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAY/C;AAKD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,MAAM,EAAE,CAiBnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EACxB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,GAC3B,UAAU,CAAC,MAAM,CAAC,EAAE,CAetB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,CAkDlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/format.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,SAAS,GAAG,CACtB,CAAC,EAAE,OAAO,EACV,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,KACE,MAAM,CAAC;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAmBzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/styles.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/types.ts"],"names":[],"mappings":"AAGA,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAC1B,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B,CAAC"}
|
package/esm/mod.d.ts
ADDED
package/esm/mod.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
|
package/esm/mod.js
ADDED
package/esm/package.json
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import type { NonEmptyList } from "./utility_types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Clone an object using structuredClone.
|
|
4
|
+
*/
|
|
5
|
+
export declare function clone<T>(obj: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Compares two things by turning them into strings,
|
|
8
|
+
* and comparing them by their string value.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* isEqual("1", 1); // true
|
|
13
|
+
* isEqual({foo: "bar"}, {foo: "bar"}); // true
|
|
14
|
+
* isEqual([], []); // true
|
|
15
|
+
* isEqual([0], [1]); // false
|
|
16
|
+
* isEqual(false, " false "); // false
|
|
17
|
+
* isEqual(false, "FALSE"); // false
|
|
18
|
+
* ````
|
|
19
|
+
*/
|
|
20
|
+
export declare function isEqual(thing1: unknown, thing2: unknown): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the first thing in a list. If the value
|
|
23
|
+
* is a string, then it will return the first character.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* If an empty list is passed then this will return undefined.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* first("hello"); // "h"
|
|
31
|
+
* first([1, 2, 3]); // 1
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function first<T>(list: NonEmptyList<T>): T;
|
|
35
|
+
export declare function first(value: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the last thing in a list. If the value
|
|
38
|
+
* is a string, then it will return the last character.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* If an empty list is passed then this will return undefined.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* last("hello"); // "o"
|
|
46
|
+
* last([1, 2, 3]); // 3
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function last<T>(list: NonEmptyList<T>): T;
|
|
50
|
+
export declare function last(value: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Compares two things by turning them into strings,
|
|
53
|
+
* and comparing them by their string value.
|
|
54
|
+
*
|
|
55
|
+
* @remarks this is the inverse of `isEqual`.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* isNotEqual("1", 1); // true
|
|
60
|
+
* isNotEqual({foo: "bar"}, {foo: "bar"}); // true
|
|
61
|
+
* isNotEqual([], []); // true
|
|
62
|
+
* isNotEqual([0], [1]); // false
|
|
63
|
+
* isNotEqual(false, " false "); // true
|
|
64
|
+
* isNotEqual(false, "FALSE"); // false
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function isNotEqual(thing1: unknown, thing2: unknown): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Compares two things by turning them into strings and lowercasing
|
|
70
|
+
* them, and comparing the string values. Works exactly like `isEqual` except
|
|
71
|
+
* will lowercase both things before comparing.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* isEqualIgnoreCase("1", 1); // true
|
|
76
|
+
* isEqualIgnoreCase({foo: "bar"}, {foo: "bar"}); // true
|
|
77
|
+
* isEqualIgnoreCase([], []); // true
|
|
78
|
+
* isEqualIgnoreCase([0], [1]); // false
|
|
79
|
+
* isEqualIgnoreCase(false, " false "); // false
|
|
80
|
+
* isEqualIgnoreCase(false, "FALSE"); // true
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function isEqualIgnoreCase(thing1: unknown, thing2: unknown): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Compares two things by turning them into strings, trimming and lowercasing
|
|
86
|
+
* them, and comparing the string values. Works exactly like `isEqual` except
|
|
87
|
+
* will lowercase both things before comparing.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* isNotEqualIgnoreCase("1", 1); // false
|
|
92
|
+
* isNotEqualIgnoreCase({foo: "bar"}, {foo: "bar"}); // false
|
|
93
|
+
* isNotEqualIgnoreCase([], []); // false
|
|
94
|
+
* isNotEqualIgnoreCase([0], [1]); // true
|
|
95
|
+
* isNotEqualIgnoreCase(false, " false "); // true
|
|
96
|
+
* isNotEqualIgnoreCase(false, "FALSE"); // false
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare function isNotEqualIgnoreCase(thing1: unknown, thing2: unknown): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Converts the given parameter into the string equivalent.
|
|
102
|
+
*
|
|
103
|
+
* If the thing provided has the type of "object", then this function
|
|
104
|
+
* returns `JSON.stringify(thing)`. Otherwise, it will wrap the `thing`
|
|
105
|
+
* in a String and convert it to it's string representation.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* stringify({ foo: "bar" }); // "{ "foo": "bar" }"
|
|
110
|
+
* stringify([1, 2, 3]); // "[1, 2, 3]"
|
|
111
|
+
* stringify(1); // "1"
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare function stringify(thing: unknown): string;
|
|
115
|
+
/**
|
|
116
|
+
* Reverses the given string or list.
|
|
117
|
+
*
|
|
118
|
+
* If the thing provided is a string, then it will return the string in reverse
|
|
119
|
+
* respecting all characters.
|
|
120
|
+
*
|
|
121
|
+
* If the thing is a list, then it will reverse all items in the list.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* reverse('Apple'); // "elppA"
|
|
126
|
+
* reverse([1, 2, 3]); // [3, 2, 1]
|
|
127
|
+
* reverse(new Set([1, 2, 3])); // Set[3, 2, 1]
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare function reverse(thing: string): string;
|
|
131
|
+
export declare function reverse<T>(thing: T[]): T[];
|
|
132
|
+
export declare function reverse<T>(thing: Set<T>): Set<T>;
|
|
133
|
+
/**
|
|
134
|
+
* Determines if the given thing is empty.
|
|
135
|
+
*
|
|
136
|
+
* Things are empty when:
|
|
137
|
+
* * They are `None`
|
|
138
|
+
* * They are empty strings
|
|
139
|
+
* * They are strings of only whitespace
|
|
140
|
+
* * They have length or size
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* isEmpty([]); // true
|
|
145
|
+
* isEmpty([0]); // false
|
|
146
|
+
* isEmpty(""); // true
|
|
147
|
+
* isEmpty(" "); // true
|
|
148
|
+
* isEmpty(new Set()); // true
|
|
149
|
+
* isEmpty({}); // true
|
|
150
|
+
* isEmpty(new Map()); // true
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export declare function isEmpty(thing: unknown[]): boolean;
|
|
154
|
+
export declare function isEmpty(thing: unknown): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Determines if the given thing is not empty.
|
|
157
|
+
*
|
|
158
|
+
* @remarks this is the inverse of `isEmpty`.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* isNotEmpty([]); // false
|
|
163
|
+
* isNotEmpty([0]); // true
|
|
164
|
+
* isNotEmpty(""); // false
|
|
165
|
+
* isNotEmpty(" "); // true
|
|
166
|
+
* isNotEmpty(new Set()); // false
|
|
167
|
+
* isNotEmpty({}); // false
|
|
168
|
+
* isNotEmpty(new Map()); // false
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare function isNotEmpty(thing: unknown[]): boolean;
|
|
172
|
+
export declare function isNotEmpty(thing: unknown): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Returns the distinct values from a list.
|
|
175
|
+
*
|
|
176
|
+
* @remarks same as `distinct`.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const myList = [1, 2, 3, 3];
|
|
181
|
+
* unique(myList); // [1, 2, 3];
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export declare function unique<T>(list: T[]): T[];
|
|
185
|
+
/**
|
|
186
|
+
* Returns the distinct values from a list.
|
|
187
|
+
*
|
|
188
|
+
* @remarks alias for `unique`.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* const myList = [1, 2, 3, 3];
|
|
193
|
+
* distinct(myList); // [1, 2, 3];
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
export declare function distinct<T>(list: T[]): T[];
|
|
197
|
+
/**
|
|
198
|
+
* Pick a random item from an array.
|
|
199
|
+
*
|
|
200
|
+
* @remarks
|
|
201
|
+
* If you pass an empty list, then this function will return `undefined`.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* const myList = [1, 2, 3, 4];
|
|
206
|
+
* const randomItem = sample(myList);
|
|
207
|
+
*
|
|
208
|
+
* console.log(randomItem); // could be 1, 2, 3, or 4
|
|
209
|
+
* console.log(sample([])); // undefined
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
export declare function sample<T>(list: NonEmptyList<T>): T;
|
|
213
|
+
/**
|
|
214
|
+
* Gives a random number in the given range. The first parameter is inclusive
|
|
215
|
+
* and the second one is exclusive. Therefore, it will work with lists out of
|
|
216
|
+
* the box.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* rand(0, 10); // 0 -> 9
|
|
221
|
+
* rand(3, 7); // 3 -> 6
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
export declare function rand(start: number, end: number): number;
|
|
225
|
+
/**
|
|
226
|
+
* Determines if the given value is truthy.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```ts
|
|
230
|
+
* truthy(true); // true
|
|
231
|
+
* truthy(false); // false
|
|
232
|
+
* truthy(''); // false
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
export declare function truthy(thing: unknown): boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Determines if the given value is falsy.
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```ts
|
|
241
|
+
* falsy(true); // false
|
|
242
|
+
* falsy(false); // true
|
|
243
|
+
* falsy(''); // true
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export declare function falsy(thing: unknown): boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Returns true if the given value is not null or undefined.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* isSome(null); // false
|
|
253
|
+
* isSome(undefined); // false
|
|
254
|
+
* isSome(0); // true
|
|
255
|
+
* isSome({}); // true
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
export declare function isSome(thing: unknown): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Returns true if the given value is null or undefined.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```ts
|
|
264
|
+
* isNone(null); // true
|
|
265
|
+
* isNone(undefined); // true
|
|
266
|
+
* isNone(true); // false
|
|
267
|
+
* isNone(0); // false
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
export declare function isNone(thing: unknown): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Sums the elements in the given list. If you pass a list of numbers, it sums
|
|
273
|
+
* them directly. If you pass a list of objects, provide the key to sum.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* sum([1, 2, 3]); // 6
|
|
278
|
+
* sum([{ x: 1 }, { x: 2 }], "x"); // 3
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
export declare function sum(list: number[]): number;
|
|
282
|
+
export declare function sum<T extends Record<PropertyKey, number>>(list: T[], key: keyof T): number;
|
|
283
|
+
/**
|
|
284
|
+
* Calculates the average of the elements in the given list.
|
|
285
|
+
* If you pass a list of numbers, it calculates the average directly.
|
|
286
|
+
* If you pass a list of objects, provide the key to calculate the average.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* average([1, 2, 3]); // 2
|
|
291
|
+
* average([{ x: 1 }, { x: 2 }], "x"); // 1.5
|
|
292
|
+
* average([]); // 0
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
export declare function average(list: number[]): number;
|
|
296
|
+
export declare function average<T extends Record<PropertyKey, number>>(list: T[], key: keyof T): number;
|
|
297
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/src/core.ts"],"names":[],"mappings":"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"}
|