@sharadox/web-library 0.4.1 → 0.5.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/README.md +40 -28
- package/distribution/assert/never/index.d.ts +13 -0
- package/distribution/assert/never/index.d.ts.map +1 -0
- package/distribution/assert/never/index.js +15 -0
- package/distribution/assert/never/index.js.map +1 -0
- package/distribution/class-name/index.d.ts +6 -1
- package/distribution/class-name/index.d.ts.map +1 -1
- package/distribution/class-name/index.js +6 -1
- package/distribution/class-name/index.js.map +1 -1
- package/distribution/html/escape/index.d.ts +6 -1
- package/distribution/html/escape/index.d.ts.map +1 -1
- package/distribution/html/escape/index.js +7 -2
- package/distribution/html/escape/index.js.map +1 -1
- package/distribution/math/clamp/index.d.ts +6 -1
- package/distribution/math/clamp/index.d.ts.map +1 -1
- package/distribution/math/clamp/index.js +6 -1
- package/distribution/math/clamp/index.js.map +1 -1
- package/distribution/math/pseudo-random/index.d.ts +6 -1
- package/distribution/math/pseudo-random/index.d.ts.map +1 -1
- package/distribution/math/pseudo-random/index.js +6 -1
- package/distribution/math/pseudo-random/index.js.map +1 -1
- package/distribution/math/radians/index.d.ts +6 -1
- package/distribution/math/radians/index.d.ts.map +1 -1
- package/distribution/math/radians/index.js +6 -1
- package/distribution/math/radians/index.js.map +1 -1
- package/distribution/text/separate/index.d.ts +9 -0
- package/distribution/text/separate/index.d.ts.map +1 -0
- package/distribution/text/separate/index.js +11 -0
- package/distribution/text/separate/index.js.map +1 -0
- package/distribution/type-guard/is-boolean/index.d.ts +8 -0
- package/distribution/type-guard/is-boolean/index.d.ts.map +1 -0
- package/distribution/type-guard/is-boolean/index.js +10 -0
- package/distribution/type-guard/is-boolean/index.js.map +1 -0
- package/distribution/type-guard/is-defined/index.d.ts +8 -0
- package/distribution/type-guard/is-defined/index.d.ts.map +1 -0
- package/distribution/type-guard/is-defined/index.js +10 -0
- package/distribution/type-guard/is-defined/index.js.map +1 -0
- package/distribution/type-guard/is-non-empty-string/index.d.ts +8 -0
- package/distribution/type-guard/is-non-empty-string/index.d.ts.map +1 -0
- package/distribution/type-guard/is-non-empty-string/index.js +11 -0
- package/distribution/type-guard/is-non-empty-string/index.js.map +1 -0
- package/distribution/type-guard/is-number/index.d.ts +9 -0
- package/distribution/type-guard/is-number/index.d.ts.map +1 -0
- package/distribution/type-guard/is-number/index.js +11 -0
- package/distribution/type-guard/is-number/index.js.map +1 -0
- package/distribution/type-guard/is-record/index.d.ts +9 -0
- package/distribution/type-guard/is-record/index.d.ts.map +1 -0
- package/distribution/type-guard/is-record/index.js +14 -0
- package/distribution/type-guard/is-record/index.js.map +1 -0
- package/distribution/type-guard/is-string/index.d.ts +9 -0
- package/distribution/type-guard/is-string/index.d.ts.map +1 -0
- package/distribution/type-guard/is-string/index.js +11 -0
- package/distribution/type-guard/is-string/index.js.map +1 -0
- package/llms.txt +17 -0
- package/package.json +17 -45
- package/distribution/animation/count-up/index.d.ts +0 -6
- package/distribution/animation/count-up/index.d.ts.map +0 -1
- package/distribution/animation/count-up/index.js +0 -29
- package/distribution/animation/count-up/index.js.map +0 -1
- package/distribution/animation/in-view/index.d.ts +0 -3
- package/distribution/animation/in-view/index.d.ts.map +0 -1
- package/distribution/animation/in-view/index.js +0 -15
- package/distribution/animation/in-view/index.js.map +0 -1
- package/distribution/animation/marquee/index.d.ts +0 -9
- package/distribution/animation/marquee/index.d.ts.map +0 -1
- package/distribution/animation/marquee/index.js +0 -78
- package/distribution/animation/marquee/index.js.map +0 -1
- package/distribution/animation/marquee/type.d.ts +0 -5
- package/distribution/animation/marquee/type.d.ts.map +0 -1
- package/distribution/animation/marquee/type.js +0 -2
- package/distribution/animation/marquee/type.js.map +0 -1
- package/distribution/animation/reveal/index.d.ts +0 -4
- package/distribution/animation/reveal/index.d.ts.map +0 -1
- package/distribution/animation/reveal/index.js +0 -9
- package/distribution/animation/reveal/index.js.map +0 -1
- package/distribution/animation/reveal/type.d.ts +0 -14
- package/distribution/animation/reveal/type.d.ts.map +0 -1
- package/distribution/animation/reveal/type.js +0 -2
- package/distribution/animation/reveal/type.js.map +0 -1
- package/distribution/animation/scroll-word/index.d.ts +0 -4
- package/distribution/animation/scroll-word/index.d.ts.map +0 -1
- package/distribution/animation/scroll-word/index.js +0 -16
- package/distribution/animation/scroll-word/index.js.map +0 -1
- package/distribution/animation/scroll-word/type.d.ts +0 -11
- package/distribution/animation/scroll-word/type.d.ts.map +0 -1
- package/distribution/animation/scroll-word/type.js +0 -2
- package/distribution/animation/scroll-word/type.js.map +0 -1
- package/distribution/animation/scroll-word/word/index.d.ts +0 -4
- package/distribution/animation/scroll-word/word/index.d.ts.map +0 -1
- package/distribution/animation/scroll-word/word/index.js +0 -10
- package/distribution/animation/scroll-word/word/index.js.map +0 -1
- package/distribution/animation/scroll-word/word/type.d.ts +0 -14
- package/distribution/animation/scroll-word/word/type.d.ts.map +0 -1
- package/distribution/animation/scroll-word/word/type.js +0 -2
- package/distribution/animation/scroll-word/word/type.js.map +0 -1
- package/distribution/animation/smooth-scroll/index.d.ts +0 -4
- package/distribution/animation/smooth-scroll/index.d.ts.map +0 -1
- package/distribution/animation/smooth-scroll/index.js +0 -33
- package/distribution/animation/smooth-scroll/index.js.map +0 -1
- package/distribution/animation/smooth-scroll/type.d.ts +0 -7
- package/distribution/animation/smooth-scroll/type.d.ts.map +0 -1
- package/distribution/animation/smooth-scroll/type.js +0 -2
- package/distribution/animation/smooth-scroll/type.js.map +0 -1
- package/distribution/form/bot-check/index.d.ts +0 -4
- package/distribution/form/bot-check/index.d.ts.map +0 -1
- package/distribution/form/bot-check/index.js +0 -6
- package/distribution/form/bot-check/index.js.map +0 -1
- package/distribution/form/bot-check/type.d.ts +0 -11
- package/distribution/form/bot-check/type.d.ts.map +0 -1
- package/distribution/form/bot-check/type.js +0 -2
- package/distribution/form/bot-check/type.js.map +0 -1
- package/distribution/form/field/index.d.ts +0 -3
- package/distribution/form/field/index.d.ts.map +0 -1
- package/distribution/form/field/index.js +0 -7
- package/distribution/form/field/index.js.map +0 -1
- package/distribution/form/rate-limit/index.d.ts +0 -4
- package/distribution/form/rate-limit/index.d.ts.map +0 -1
- package/distribution/form/rate-limit/index.js +0 -14
- package/distribution/form/rate-limit/index.js.map +0 -1
- package/distribution/form/rate-limit/type.d.ts +0 -9
- package/distribution/form/rate-limit/type.d.ts.map +0 -1
- package/distribution/form/rate-limit/type.js +0 -2
- package/distribution/form/rate-limit/type.js.map +0 -1
- package/distribution/internationalization/locale/index.d.ts +0 -7
- package/distribution/internationalization/locale/index.d.ts.map +0 -1
- package/distribution/internationalization/locale/index.js +0 -17
- package/distribution/internationalization/locale/index.js.map +0 -1
- package/distribution/internationalization/locale/type.d.ts +0 -3
- package/distribution/internationalization/locale/type.d.ts.map +0 -1
- package/distribution/internationalization/locale/type.js +0 -2
- package/distribution/internationalization/locale/type.js.map +0 -1
- package/distribution/internationalization/locale-preference/index.d.ts +0 -5
- package/distribution/internationalization/locale-preference/index.d.ts.map +0 -1
- package/distribution/internationalization/locale-preference/index.js +0 -9
- package/distribution/internationalization/locale-preference/index.js.map +0 -1
- package/distribution/internationalization/locale-redirect/index.d.ts +0 -8
- package/distribution/internationalization/locale-redirect/index.d.ts.map +0 -1
- package/distribution/internationalization/locale-redirect/index.js +0 -24
- package/distribution/internationalization/locale-redirect/index.js.map +0 -1
- package/distribution/internationalization/locale-redirect/type.d.ts +0 -12
- package/distribution/internationalization/locale-redirect/type.d.ts.map +0 -1
- package/distribution/internationalization/locale-redirect/type.js +0 -2
- package/distribution/internationalization/locale-redirect/type.js.map +0 -1
- package/distribution/internationalization/translate/index.d.ts +0 -4
- package/distribution/internationalization/translate/index.d.ts.map +0 -1
- package/distribution/internationalization/translate/index.js +0 -5
- package/distribution/internationalization/translate/index.js.map +0 -1
- package/distribution/pointer/spotlight/index.d.ts +0 -3
- package/distribution/pointer/spotlight/index.d.ts.map +0 -1
- package/distribution/pointer/spotlight/index.js +0 -20
- package/distribution/pointer/spotlight/index.js.map +0 -1
- package/distribution/pointer/tilt/index.d.ts +0 -7
- package/distribution/pointer/tilt/index.d.ts.map +0 -1
- package/distribution/pointer/tilt/index.js +0 -34
- package/distribution/pointer/tilt/index.js.map +0 -1
- package/distribution/privacy/consent/index.d.ts +0 -22
- package/distribution/privacy/consent/index.d.ts.map +0 -1
- package/distribution/privacy/consent/index.js +0 -75
- package/distribution/privacy/consent/index.js.map +0 -1
- package/distribution/privacy/consent/type.d.ts +0 -35
- package/distribution/privacy/consent/type.d.ts.map +0 -1
- package/distribution/privacy/consent/type.js +0 -2
- package/distribution/privacy/consent/type.js.map +0 -1
- package/distribution/privacy/use-consent/index.d.ts +0 -5
- package/distribution/privacy/use-consent/index.d.ts.map +0 -1
- package/distribution/privacy/use-consent/index.js +0 -22
- package/distribution/privacy/use-consent/index.js.map +0 -1
- package/distribution/privacy/use-consent/type.d.ts +0 -10
- package/distribution/privacy/use-consent/type.d.ts.map +0 -1
- package/distribution/privacy/use-consent/type.js +0 -2
- package/distribution/privacy/use-consent/type.js.map +0 -1
- package/distribution/scroll/active-section/index.d.ts +0 -7
- package/distribution/scroll/active-section/index.d.ts.map +0 -1
- package/distribution/scroll/active-section/index.js +0 -49
- package/distribution/scroll/active-section/index.js.map +0 -1
- package/distribution/scroll/active-section/type.d.ts +0 -9
- package/distribution/scroll/active-section/type.d.ts.map +0 -1
- package/distribution/scroll/active-section/type.js +0 -2
- package/distribution/scroll/active-section/type.js.map +0 -1
- package/distribution/search-engine/robots/index.d.ts +0 -4
- package/distribution/search-engine/robots/index.d.ts.map +0 -1
- package/distribution/search-engine/robots/index.js +0 -7
- package/distribution/search-engine/robots/index.js.map +0 -1
- package/distribution/search-engine/robots/type.d.ts +0 -17
- package/distribution/search-engine/robots/type.d.ts.map +0 -1
- package/distribution/search-engine/robots/type.js +0 -2
- package/distribution/search-engine/robots/type.js.map +0 -1
- package/distribution/search-engine/sitemap/index.d.ts +0 -4
- package/distribution/search-engine/sitemap/index.d.ts.map +0 -1
- package/distribution/search-engine/sitemap/index.js +0 -12
- package/distribution/search-engine/sitemap/index.js.map +0 -1
- package/distribution/search-engine/sitemap/type.d.ts +0 -22
- package/distribution/search-engine/sitemap/type.d.ts.map +0 -1
- package/distribution/search-engine/sitemap/type.js +0 -2
- package/distribution/search-engine/sitemap/type.js.map +0 -1
- package/distribution/search-engine/structured-data/index.d.ts +0 -4
- package/distribution/search-engine/structured-data/index.d.ts.map +0 -1
- package/distribution/search-engine/structured-data/index.js +0 -6
- package/distribution/search-engine/structured-data/index.js.map +0 -1
- package/distribution/search-engine/structured-data/type.d.ts +0 -5
- package/distribution/search-engine/structured-data/type.d.ts.map +0 -1
- package/distribution/search-engine/structured-data/type.js +0 -2
- package/distribution/search-engine/structured-data/type.js.map +0 -1
- package/distribution/style/apply/index.d.ts +0 -11
- package/distribution/style/apply/index.d.ts.map +0 -1
- package/distribution/style/apply/index.js +0 -50
- package/distribution/style/apply/index.js.map +0 -1
- package/distribution/style/apply/type.d.ts +0 -12
- package/distribution/style/apply/type.d.ts.map +0 -1
- package/distribution/style/apply/type.js +0 -2
- package/distribution/style/apply/type.js.map +0 -1
- package/distribution/style/definition/index.d.ts +0 -14
- package/distribution/style/definition/index.d.ts.map +0 -1
- package/distribution/style/definition/index.js +0 -26
- package/distribution/style/definition/index.js.map +0 -1
- package/distribution/style/definition/type.d.ts +0 -29
- package/distribution/style/definition/type.d.ts.map +0 -1
- package/distribution/style/definition/type.js +0 -2
- package/distribution/style/definition/type.js.map +0 -1
- package/distribution/style/style-script/index.d.ts +0 -10
- package/distribution/style/style-script/index.d.ts.map +0 -1
- package/distribution/style/style-script/index.js +0 -16
- package/distribution/style/style-script/index.js.map +0 -1
- package/distribution/style/style-script/type.d.ts +0 -5
- package/distribution/style/style-script/type.d.ts.map +0 -1
- package/distribution/style/style-script/type.js +0 -2
- package/distribution/style/style-script/type.js.map +0 -1
- package/distribution/style/style-sheet/index.d.ts +0 -8
- package/distribution/style/style-sheet/index.d.ts.map +0 -1
- package/distribution/style/style-sheet/index.js +0 -25
- package/distribution/style/style-sheet/index.js.map +0 -1
- package/distribution/style/use-style/index.d.ts +0 -5
- package/distribution/style/use-style/index.d.ts.map +0 -1
- package/distribution/style/use-style/index.js +0 -37
- package/distribution/style/use-style/index.js.map +0 -1
- package/distribution/style/use-style/type.d.ts +0 -9
- package/distribution/style/use-style/type.d.ts.map +0 -1
- package/distribution/style/use-style/type.js +0 -2
- package/distribution/style/use-style/type.js.map +0 -1
- package/distribution/test/visual-snapshot/index.d.ts +0 -8
- package/distribution/test/visual-snapshot/index.d.ts.map +0 -1
- package/distribution/test/visual-snapshot/index.js +0 -20
- package/distribution/test/visual-snapshot/index.js.map +0 -1
- package/distribution/test/visual-snapshot/type.d.ts +0 -7
- package/distribution/test/visual-snapshot/type.d.ts.map +0 -1
- package/distribution/test/visual-snapshot/type.js +0 -2
- package/distribution/test/visual-snapshot/type.js.map +0 -1
- package/distribution/time/format-time/index.d.ts +0 -3
- package/distribution/time/format-time/index.d.ts.map +0 -1
- package/distribution/time/format-time/index.js +0 -5
- package/distribution/time/format-time/index.js.map +0 -1
- package/distribution/time/open-state/index.d.ts +0 -4
- package/distribution/time/open-state/index.d.ts.map +0 -1
- package/distribution/time/open-state/index.js +0 -11
- package/distribution/time/open-state/index.js.map +0 -1
- package/distribution/time/open-state/type.d.ts +0 -5
- package/distribution/time/open-state/type.d.ts.map +0 -1
- package/distribution/time/open-state/type.js +0 -2
- package/distribution/time/open-state/type.js.map +0 -1
- package/distribution/time/sun-time/index.d.ts +0 -4
- package/distribution/time/sun-time/index.d.ts.map +0 -1
- package/distribution/time/sun-time/index.js +0 -27
- package/distribution/time/sun-time/index.js.map +0 -1
- package/distribution/time/sun-time/type.d.ts +0 -6
- package/distribution/time/sun-time/type.d.ts.map +0 -1
- package/distribution/time/sun-time/type.js +0 -2
- package/distribution/time/sun-time/type.js.map +0 -1
- package/distribution/time/sun-today/index.d.ts +0 -4
- package/distribution/time/sun-today/index.d.ts.map +0 -1
- package/distribution/time/sun-today/index.js +0 -25
- package/distribution/time/sun-today/index.js.map +0 -1
- package/distribution/time/sun-today/type.d.ts +0 -9
- package/distribution/time/sun-today/type.d.ts.map +0 -1
- package/distribution/time/sun-today/type.js +0 -2
- package/distribution/time/sun-today/type.js.map +0 -1
- package/distribution/time/zone-minute/index.d.ts +0 -3
- package/distribution/time/zone-minute/index.d.ts.map +0 -1
- package/distribution/time/zone-minute/index.js +0 -13
- package/distribution/time/zone-minute/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,40 +1,52 @@
|
|
|
1
1
|
# @sharadox/web-library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The small, general utilities every Sharadox library and application imports, so even one-liners are written once: type guards, class names, HTML escaping, joining labels, math helpers and exhaustiveness checks. No dependencies.
|
|
4
|
+
|
|
5
|
+
Topic code lives in its own libraries. This package used to hold it up to version 0.4. Each topic's new home:
|
|
6
|
+
|
|
7
|
+
| Topic | Library |
|
|
8
|
+
| ----------------------------------------------------------------------- | -------------------------------------------- |
|
|
9
|
+
| Languages, translations, locale redirects and links | `@sharadox/internationalization-web-library` |
|
|
10
|
+
| Page metadata, sitemap, robots, manifest, structured data, share images | `@sharadox/metadata-web-library` |
|
|
11
|
+
| Styles (themes) | `@sharadox/style-web-library` |
|
|
12
|
+
| Cookie consent | `@sharadox/consent-web-library` |
|
|
13
|
+
| Reveal, scroll-lit words, in-view, count-up, marquee | `@sharadox/animation-web-library` |
|
|
14
|
+
| Smooth scrolling, active section | `@sharadox/scroll-web-library` |
|
|
15
|
+
| Spotlight, tilt, custom cursor | `@sharadox/pointer-web-library` |
|
|
16
|
+
| Bot checks, rate limit, contact forms | `@sharadox/form-web-library` |
|
|
17
|
+
| Time zones, opening hours, sunrise and sunset | `@sharadox/time-web-library` |
|
|
18
|
+
| Playwright helpers and shared test suites | `@sharadox/test-web-library` |
|
|
19
|
+
|
|
20
|
+
## Install
|
|
4
21
|
|
|
5
22
|
```sh
|
|
6
23
|
pnpm add @sharadox/web-library
|
|
7
24
|
```
|
|
8
25
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import { Reveal } from "@sharadox/web-library/animation/reveal";
|
|
29
|
-
import { translate } from "@sharadox/web-library/internationalization/translate";
|
|
30
|
-
|
|
31
|
-
<Reveal delay={0.1}>{translate({ en: "Hello", pt: "Olá" }, locale)}</Reveal>;
|
|
32
|
-
```
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
Import each utility by its path:
|
|
29
|
+
|
|
30
|
+
| Import | Export | Example |
|
|
31
|
+
| -------------------------------------------- | ------------------------------------------------- | ---------------------------------------------------- |
|
|
32
|
+
| `@sharadox/web-library/type-guard/is-string` | `isString(value)` | `isString("a") // true` |
|
|
33
|
+
| `…/type-guard/is-non-empty-string` | `isNonEmptyString(value)` | `isNonEmptyString("") // false` |
|
|
34
|
+
| `…/type-guard/is-number` | `isNumber(value)`: finite numbers only | `isNumber(NaN) // false` |
|
|
35
|
+
| `…/type-guard/is-boolean` | `isBoolean(value)` | `isBoolean(false) // true` |
|
|
36
|
+
| `…/type-guard/is-record` | `isRecord(value)`: plain objects only | `isRecord([]) // false` |
|
|
37
|
+
| `…/type-guard/is-defined` | `isDefined(value)`: not `null`/`undefined` | `[1, undefined].filter(isDefined) // [1]` |
|
|
38
|
+
| `…/class-name` | `classNames(...names)` | `classNames("a", false, "b") // "a b"` |
|
|
39
|
+
| `…/html/escape` | `escapeHtml(text)` | `escapeHtml("<b>") // "<b>"` |
|
|
40
|
+
| `…/text/separate` | `separate(separator, ...parts)` | `separate("•", "Contact", "Ana") // "Contact • Ana"` |
|
|
41
|
+
| `…/math/clamp` | `clamp(value, minimum, maximum)` | `clamp(5, 0, 1) // 1` |
|
|
42
|
+
| `…/math/radians` | `radians(degrees)` | `radians(180) // Math.PI` |
|
|
43
|
+
| `…/math/pseudo-random` | `pseudoRandom(seed)`: repeatable number in [0, 1) | `pseudoRandom(3) === pseudoRandom(3)` |
|
|
44
|
+
| `…/assert/never` | `assertNever(value)`: exhaustive `switch` checks | `default: return assertNever(kind)` |
|
|
33
45
|
|
|
34
|
-
|
|
46
|
+
## Develop
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
Every function is tested at 100% coverage (`pnpm test:unit`). `pnpm verify` runs formatting, lint, type-check, tests and the build. Branches follow `<feature>.development` → `development` → `index`, and releases are `v<version>` tags on `index`.
|
|
37
49
|
|
|
38
50
|
## Licence
|
|
39
51
|
|
|
40
|
-
Licença Sharadox de Código Aberto, versão 0.1.0
|
|
52
|
+
Licença Sharadox de Código Aberto, versão 0.1.0. See [português](LICENCA.md) (the binding text) and the [English translation](LICENSE.md).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks code that can't be reached when every case of a union is handled: TypeScript reports an error if a case
|
|
3
|
+
* is added and forgotten, and calling it at run time throws.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* switch (kind) {
|
|
7
|
+
* case "a": return 1;
|
|
8
|
+
* case "b": return 2;
|
|
9
|
+
* default: return assertNever(kind);
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertNever(value: never): never;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/assert/never/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAE/C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks code that can't be reached when every case of a union is handled: TypeScript reports an error if a case
|
|
3
|
+
* is added and forgotten, and calling it at run time throws.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* switch (kind) {
|
|
7
|
+
* case "a": return 1;
|
|
8
|
+
* case "b": return 2;
|
|
9
|
+
* default: return assertNever(kind);
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export function assertNever(value) {
|
|
13
|
+
throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/assert/never/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Joins the class names that are set, skipping `false`, `null`, `undefined` and empty strings.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* classNames("button", isActive && "active", undefined); // "button active" or "button"
|
|
6
|
+
*/
|
|
2
7
|
export declare function classNames(...names: (string | false | null | undefined)[]): string;
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/class-name/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/class-name/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAElF"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Joins the class names that are set, skipping `false`, `null`, `undefined` and empty strings.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* classNames("button", isActive && "active", undefined); // "button active" or "button"
|
|
6
|
+
*/
|
|
2
7
|
export function classNames(...names) {
|
|
3
8
|
return names.filter(Boolean).join(" ");
|
|
4
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/class-name/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/class-name/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAG,KAA4C;IACxE,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Escapes text for safe use inside HTML, for example user input in an email body.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* escapeHtml(`<b>"Tom" & 'Jerry'</b>`); // "<b>"Tom" & 'Jerry'</b>"
|
|
6
|
+
*/
|
|
2
7
|
export declare function escapeHtml(text: string): string;
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/html/escape/index.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/html/escape/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
const ENTITIES = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Escapes text for safe use inside HTML, for example user input in an email body.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* escapeHtml(`<b>"Tom" & 'Jerry'</b>`); // "<b>"Tom" & 'Jerry'</b>"
|
|
7
|
+
*/
|
|
3
8
|
export function escapeHtml(text) {
|
|
4
|
-
return text.replace(/[&<>"']/g, (character) => ENTITIES[character]
|
|
9
|
+
return text.replace(/[&<>"']/g, (character) => ENTITIES[character]);
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/html/escape/index.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/html/escape/index.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAW,CAAC;AAElG;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAkC,CAAC,CAAC,CAAC;AAC/F,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Keeps a value between a minimum and a maximum.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* clamp(5, 0, 1); // 1
|
|
6
|
+
*/
|
|
2
7
|
export declare function clamp(value: number, minimum: number, maximum: number): number;
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/math/clamp/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/math/clamp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7E"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Keeps a value between a minimum and a maximum.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* clamp(5, 0, 1); // 1
|
|
6
|
+
*/
|
|
2
7
|
export function clamp(value, minimum, maximum) {
|
|
3
8
|
return Math.min(maximum, Math.max(minimum, value));
|
|
4
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/math/clamp/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/math/clamp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe;IACnE,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A deterministic number in [0, 1) for a seed: the same seed always gives the same value, so renders are stable.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* pseudoRandom(3) === pseudoRandom(3); // true
|
|
6
|
+
*/
|
|
2
7
|
export declare function pseudoRandom(seed: number): number;
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/math/pseudo-random/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/math/pseudo-random/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A deterministic number in [0, 1) for a seed: the same seed always gives the same value, so renders are stable.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* pseudoRandom(3) === pseudoRandom(3); // true
|
|
6
|
+
*/
|
|
2
7
|
export function pseudoRandom(seed) {
|
|
3
8
|
const value = Math.sin(seed * 12.9898) * 43758.5453;
|
|
4
9
|
return value - Math.floor(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/math/pseudo-random/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/math/pseudo-random/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC;IACpD,OAAO,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/math/radians/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/math/radians/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/math/radians/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/math/radians/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joins the parts that are set with a separator surrounded by spaces, skipping `false`, `null`, `undefined` and empty
|
|
3
|
+
* strings. Brands keep their separator in one constant and pass it here.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* separate("•", "Contact", "Ana", undefined); // "Contact • Ana"
|
|
7
|
+
*/
|
|
8
|
+
export declare function separate(separator: string, ...parts: (string | false | null | undefined)[]): string;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/text/separate/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAEnG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joins the parts that are set with a separator surrounded by spaces, skipping `false`, `null`, `undefined` and empty
|
|
3
|
+
* strings. Brands keep their separator in one constant and pass it here.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* separate("•", "Contact", "Ana", undefined); // "Contact • Ana"
|
|
7
|
+
*/
|
|
8
|
+
export function separate(separator, ...parts) {
|
|
9
|
+
return parts.filter(Boolean).join(` ${separator} `);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/text/separate/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAiB,EAAE,GAAG,KAA4C;IACzF,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/type-guard/is-boolean/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/type-guard/is-boolean/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a value is neither `undefined` nor `null`. Handy with `filter` to narrow arrays.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* [1, undefined, 2].filter(isDefined); // [1, 2] as number[]
|
|
6
|
+
*/
|
|
7
|
+
export declare function isDefined<Value>(value: Value): value is NonNullable<Value>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/type-guard/is-defined/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC,CAE1E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a value is neither `undefined` nor `null`. Handy with `filter` to narrow arrays.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* [1, undefined, 2].filter(isDefined); // [1, 2] as number[]
|
|
6
|
+
*/
|
|
7
|
+
export function isDefined(value) {
|
|
8
|
+
return value !== undefined && value !== null;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/type-guard/is-defined/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAQ,KAAY;IAC3C,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/type-guard/is-non-empty-string/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEhE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isString } from "@sharadox/web-library/type-guard/is-string";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a value is a string with at least one character.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* isNonEmptyString(""); // false
|
|
7
|
+
*/
|
|
8
|
+
export function isNonEmptyString(value) {
|
|
9
|
+
return isString(value) && value.length > 0;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/type-guard/is-non-empty-string/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/type-guard/is-number/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a value is a finite number (not `NaN`, not `Infinity`).
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* isNumber(1.5); // true
|
|
6
|
+
* isNumber(Number.NaN); // false
|
|
7
|
+
*/
|
|
8
|
+
export function isNumber(value) {
|
|
9
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/type-guard/is-number/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a value is a plain object (an object literal or `Object.create(null)`), not an array, a date or `null`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* isRecord({ a: 1 }); // true
|
|
6
|
+
* isRecord([]); // false
|
|
7
|
+
*/
|
|
8
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/type-guard/is-record/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIzE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a value is a plain object (an object literal or `Object.create(null)`), not an array, a date or `null`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* isRecord({ a: 1 }); // true
|
|
6
|
+
* isRecord([]); // false
|
|
7
|
+
*/
|
|
8
|
+
export function isRecord(value) {
|
|
9
|
+
if (typeof value !== "object" || value === null)
|
|
10
|
+
return false;
|
|
11
|
+
const prototype = Object.getPrototypeOf(value);
|
|
12
|
+
return prototype === Object.prototype || prototype === null;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/type-guard/is-record/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAY,CAAC;IAC1D,OAAO,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/type-guard/is-string/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/type-guard/is-string/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC"}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @sharadox/web-library
|
|
2
|
+
|
|
3
|
+
> General TypeScript utilities shared by every Sharadox library (no dependencies). Topic code moved to *-web-library topic packages (internationalization, metadata, style, consent, animation, scroll, pointer, form, time, test).
|
|
4
|
+
|
|
5
|
+
- type-guard/is-string → isString(value): value is string
|
|
6
|
+
- type-guard/is-non-empty-string → isNonEmptyString(value)
|
|
7
|
+
- type-guard/is-number → isNumber(value): finite numbers
|
|
8
|
+
- type-guard/is-boolean → isBoolean(value)
|
|
9
|
+
- type-guard/is-record → isRecord(value): plain objects
|
|
10
|
+
- type-guard/is-defined → isDefined(value): not null/undefined
|
|
11
|
+
- class-name → classNames(...names): joins truthy names
|
|
12
|
+
- html/escape → escapeHtml(text)
|
|
13
|
+
- text/separate → separate(separator, ...parts): "a • b", skipping empty parts
|
|
14
|
+
- math/clamp, math/radians, math/pseudo-random
|
|
15
|
+
- assert/never → assertNever(value): throws; for exhaustive switches
|
|
16
|
+
- Import by path: `import { isString } from "@sharadox/web-library/type-guard/is-string";`
|
|
17
|
+
- Licence: Sharadox Open Source Licence 0.1.0
|