@deslop/coding-standards 0.1.1082 → 0.1.1085
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 +12 -8
- package/dist/{MutableList-BCF17jPH.mjs → MutableList-NTBI6AHW.mjs} +231 -8
- package/dist/install.js +35 -80
- package/dist/oxlint.d.ts +86 -4
- package/dist/oxlint.js +837 -147
- package/package.json +1 -1
- package/skills/design/SKILL.md +52 -129
- package/skills/engineering/SKILL.md +193 -128
- package/skills/review/SKILL.md +37 -35
- package/skills/architecture/EVALS.md +0 -21
- package/skills/architecture/SKILL.md +0 -39
- package/skills/design/EVALS.md +0 -46
- package/skills/engineering/EVALS.md +0 -34
- package/skills/review/EVALS.md +0 -24
- package/skills/testing/EVALS.md +0 -22
- package/skills/testing/SKILL.md +0 -64
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Coding standards
|
|
2
2
|
|
|
3
|
-
A strict Oxlint preset and an installer for the
|
|
3
|
+
A strict Oxlint preset and an installer for the engineering, design and review skills. Requires Node 26+.
|
|
4
4
|
|
|
5
5
|
## Install the skills
|
|
6
6
|
|
|
@@ -10,9 +10,9 @@ Run inside a Git repository, including a linked worktree:
|
|
|
10
10
|
vpx @deslop/coding-standards@latest
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
It copies all package-owned skills into the repository's existing `.agents`, `.claude` and `.codex` directories
|
|
13
|
+
It copies all package-owned skills into the repository's existing `.agents`, `.claude` and `.codex` directories. It always writes `.claude`, which Claude Code reads, and writes `.agents` when no `.codex` exists. A refresh replaces only those names; destinations outside the repository or inside global agent configuration are rejected. Other skills, sign-ins, manifests, lockfiles and lint configuration stay unchanged. Edit package sources, then refresh installed copies with the CLI.
|
|
14
14
|
|
|
15
|
-
Use
|
|
15
|
+
Use engineering for mechanisms, code, tests and proof, design for visible behavior and review for independent critique and cleanup. Refer to another skill by name, not its installation path. Personal orchestration, delivery, machine commands and reply preferences stay outside this package.
|
|
16
16
|
|
|
17
17
|
## Use the lint preset
|
|
18
18
|
|
|
@@ -39,9 +39,9 @@ The preset needs Effect-tsgo's patched Oxlint, so keep the patch command in the
|
|
|
39
39
|
| Owner | Decision |
|
|
40
40
|
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
41
|
| `src/` | Flat package structure; rules in `src/rules`, no separate plugin or install-test harness |
|
|
42
|
-
| `skills/` | Maintained
|
|
42
|
+
| `skills/` | Maintained engineering, design and review sources; refresh repository copies from the TypeScript CLI, no build needed |
|
|
43
43
|
| Lint rules | Prefer an equivalent maintained rule before custom enforcement; consumer code conforms to strict standards, not the reverse. Fix broken or imprecise rules, not inconvenient valid diagnostics. A rule targets code the engineering skill and the other rules allow; an edge case that only unusual code reaches takes an inline disable with its reason, never a looser rule |
|
|
44
|
-
| Rule proof |
|
|
44
|
+
| Rule proof | Public CLI cases with accepted and rejected inputs; no severity or exclusion workaround |
|
|
45
45
|
|
|
46
46
|
With workspace dependencies installed, from the repository root:
|
|
47
47
|
|
|
@@ -66,7 +66,7 @@ node tools/coding-standards/src/install.ts
|
|
|
66
66
|
| [Cursor / pstack](https://github.com/cursor/plugins/tree/e43c7ee26e0038c6c1fa8380dd34ce86ff94cb2a/pstack) | Interface rationale, focused bug replay and defensible benchmarks; no playbook-stage machinery |
|
|
67
67
|
| [Kit Langton's Effect skill](https://github.com/kitlangton/skills/tree/71195e36024ebd2e66c5beac946e81eafd5abc43/skills/effect) | Schema construction/optionality, checked against actual [Effect 4 source](https://github.com/Effect-TS/effect/tree/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src) |
|
|
68
68
|
| [Vercel's agent skills](https://github.com/vercel-labs/agent-skills/tree/063bee94c3f4df8453406c830b0a7df0f2860278/skills) | Independent I/O and narrow subscriptions, translated to Effect/atoms; no manual React memoization |
|
|
69
|
-
| [Anthropic frontend-design](https://github.com/anthropics/skills/tree/main/skills/frontend-design) and [Vercel design guidelines](https://vercel.com/design/guidelines) | Task-led composition, copy and interaction contracts (targets, focus, URL state, forms);
|
|
69
|
+
| [Anthropic frontend-design](https://github.com/anthropics/skills/tree/main/skills/frontend-design) and [Vercel design guidelines](https://vercel.com/design/guidelines) | Task-led composition, copy and interaction contracts (targets, focus, URL state, forms); Critique keeps the generated-default list, not a studio persona |
|
|
70
70
|
| [Emil Kowalski's skills](https://github.com/emilkowalski/skills/tree/e8a175de22ae1e49370fc144c1f3bb9aeedf988d/skills) | Realistic layout stress, interruptible motion and mobile checks; no fixed variant picker or audit fan-out. Performance caveats checked against [Motion docs](https://motion.dev/docs/performance) |
|
|
71
71
|
| [Dillon Mulroy's skills](https://github.com/dmmulroy/skills/tree/8603380821fee6a77c82639f364ce8fe4f5a92be) and [anti-slop](https://github.com/dmmulroy/anti-slop/tree/c44ef22ca116d0ba62a3ff663a0bd13a3f3fa40b) | Reviewed Effect/error and cleanup approaches; retain our own service layout and ownership |
|
|
72
72
|
| [Interface Craft](https://www.interfacecraft.dev/library), the user's licensed library | Before-the-first-draft steps, range and depth, agent-run tuning, the four-pass critique, optical, color, type and motion values; ideas adapted in our words, no files copied |
|
|
@@ -74,7 +74,7 @@ node tools/coding-standards/src/install.ts
|
|
|
74
74
|
|
|
75
75
|
Additional sources for this refinement:
|
|
76
76
|
|
|
77
|
-
- [OpenClaw test audit](https://github.com/openclaw/openclaw/blob/main/.agents/skills/test-audit/SKILL.md):
|
|
77
|
+
- [OpenClaw test audit](https://github.com/openclaw/openclaw/blob/main/.agents/skills/test-audit/SKILL.md): deletion of tautological tests; retain independent boundary contracts.
|
|
78
78
|
- [Trail of Bits](https://github.com/trailofbits/skills): reproduce the strongest reachable counterexample and inspect variants of a known root cause; no routine security-audit machinery.
|
|
79
79
|
- [Bret Victor](https://worrydream.com/ExplorableExplanations/) and [Nicky Case](https://blog.ncase.me/how-i-make-an-explorable-explanation/): concrete cause and consequence, with optional exploration rather than mandatory navigation.
|
|
80
80
|
- [Taste skill](https://github.com/Leonxlnx/taste-skill/tree/a60a36dc2bb3bb77ccf17f2f62041f5ca8a458b9): real subject inventory and screenshot critique; no mandatory image, motion or component quotas.
|
|
@@ -83,6 +83,10 @@ Additional sources for this refinement:
|
|
|
83
83
|
- [Animated sprites](https://github.com/elithrar/dotfiles/tree/main/.agents/skills/animated-sprites): separate structural validity from perceptual motion and actual timing; no character assets required.
|
|
84
84
|
- [pstack correct](https://github.com/cursor/plugins/blob/e5136d82418d2db3165ea1050d17577cd618cc05/pstack/skills/correct/SKILL.md), [caller migration](https://github.com/cursor/plugins/blob/e5136d82418d2db3165ea1050d17577cd618cc05/pstack/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md) and [design red flags](https://github.com/cursor/plugins/blob/e5136d82418d2db3165ea1050d17577cd618cc05/pstack/skills/architect/references/design-red-flags.md): engineering's Patterns, with a canonical example per shape, whole-repository pattern changes and enforcement of repeated corrections above prose; no rule table beside the Patterns rows, no expiry dates on exceptions.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
- [obra/superpowers](https://github.com/obra/superpowers/tree/bb92a77741419a4ab5f06e711a283343f1ada0c3), [Matt Pocock](https://github.com/mattpocock/skills/tree/49dd158d1076134a641b33efb035946536778336) and [pstack](https://github.com/cursor/plugins/tree/09d06eb4b97a1020ab31e84030e38baf1099c7dc/pstack): recipes over prohibitions, requirement-to-proof mapping, domain-concept search, shrunk reproductions, the shared premise after two failed fixes, a behavior capture before refactors and three similar lines over an abstraction; no approval gates, test-first rituals or verification quotas.
|
|
87
|
+
- [Felix Rieseberg, How to be more ambitious](https://felixrieseberg.com/how-to-be-more-ambitious-a-tutorial-for-humans-with-models/): adversarial review by activity, never persona, from raw evidence, and the expert's unrequested check.
|
|
88
|
+
- [Emil Kowalski's animate skill](https://github.com/emilkowalski/skills/tree/2d228630ba1446365f614a108cb8252f1feda202/skills/animate) and [Taste v2](https://github.com/Leonxlnx/taste-skill/tree/f624f37a8c650b9cc550253104925efe4c8de246): a slower pace for explanatory motion and measured overflow, clipping and font checks before visual critique.
|
|
89
|
+
|
|
90
|
+
These are selectively adapted ideas, not imported frameworks. Concrete behavior, existing stack and settled user decisions govern the maintained skills. Source inspection does not establish a model-quality improvement.
|
|
87
91
|
|
|
88
92
|
</details>
|
|
@@ -3283,7 +3283,7 @@ const String$2 = /*#__PURE__*/ make$2((self, that) => self < that ? -1 : 1);
|
|
|
3283
3283
|
* @category instances
|
|
3284
3284
|
* @since 4.0.0
|
|
3285
3285
|
*/
|
|
3286
|
-
const Number$
|
|
3286
|
+
const Number$2 = /*#__PURE__*/ make$2((self, that) => {
|
|
3287
3287
|
if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that)) return 0;
|
|
3288
3288
|
if (globalThis.Number.isNaN(self)) return -1;
|
|
3289
3289
|
if (globalThis.Number.isNaN(that)) return 1;
|
|
@@ -3317,7 +3317,7 @@ const Number$1 = /*#__PURE__*/ make$2((self, that) => {
|
|
|
3317
3317
|
* @category instances
|
|
3318
3318
|
* @since 4.0.0
|
|
3319
3319
|
*/
|
|
3320
|
-
const BigInt = /*#__PURE__*/ make$2((self, that) => self < that ? -1 : 1);
|
|
3320
|
+
const BigInt$1 = /*#__PURE__*/ make$2((self, that) => self < that ? -1 : 1);
|
|
3321
3321
|
/**
|
|
3322
3322
|
* Transforms an `Order` on type `A` into an `Order` on type `B` by providing a function that
|
|
3323
3323
|
* maps values of type `B` to values of type `A`.
|
|
@@ -3383,7 +3383,7 @@ const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$2((b1, b2) => self(f(b1
|
|
|
3383
3383
|
* @category instances
|
|
3384
3384
|
* @since 2.0.0
|
|
3385
3385
|
*/
|
|
3386
|
-
const Date$1 = /*#__PURE__*/ mapInput(Number$
|
|
3386
|
+
const Date$1 = /*#__PURE__*/ mapInput(Number$2, (date) => date.getTime());
|
|
3387
3387
|
/**
|
|
3388
3388
|
* Checks whether one value is strictly less than another according to the given order.
|
|
3389
3389
|
*
|
|
@@ -3656,7 +3656,7 @@ const isSome = isSome$1;
|
|
|
3656
3656
|
* @category pattern matching
|
|
3657
3657
|
* @since 2.0.0
|
|
3658
3658
|
*/
|
|
3659
|
-
const match$
|
|
3659
|
+
const match$4 = /*#__PURE__*/ dual(2, (self, { onNone, onSome }) => isNone(self) ? onNone() : onSome(self.value));
|
|
3660
3660
|
/**
|
|
3661
3661
|
* Extracts the value from a `Some`, or evaluates a fallback thunk on `None`.
|
|
3662
3662
|
*
|
|
@@ -4544,7 +4544,7 @@ const map$2 = /*#__PURE__*/ dual(2, (self, f) => isSuccess(self) ? succeed(f(sel
|
|
|
4544
4544
|
* @category pattern matching
|
|
4545
4545
|
* @since 2.0.0
|
|
4546
4546
|
*/
|
|
4547
|
-
const match$
|
|
4547
|
+
const match$3 = /*#__PURE__*/ dual(2, (self, { onFailure, onSuccess }) => isFailure(self) ? onFailure(self.failure) : onSuccess(self.success));
|
|
4548
4548
|
/**
|
|
4549
4549
|
* Extracts the success value or throws the raw failure value `E`.
|
|
4550
4550
|
*
|
|
@@ -5023,7 +5023,7 @@ const ensure = (self) => Array$1.isArray(self) ? self : [self];
|
|
|
5023
5023
|
* @category pattern matching
|
|
5024
5024
|
* @since 2.0.0
|
|
5025
5025
|
*/
|
|
5026
|
-
const match$
|
|
5026
|
+
const match$2 = /*#__PURE__*/ dual(2, (self, { onEmpty, onNonEmpty }) => isReadonlyArrayNonEmpty(self) ? onNonEmpty(self) : onEmpty());
|
|
5027
5027
|
/**
|
|
5028
5028
|
* Pattern-matches on an array from the right, providing all elements except the
|
|
5029
5029
|
* last and the last element separately.
|
|
@@ -5408,6 +5408,76 @@ const take$1 = /*#__PURE__*/ dual(2, (self, n) => {
|
|
|
5408
5408
|
return input.slice(0, clampCount(n, input.length));
|
|
5409
5409
|
});
|
|
5410
5410
|
/**
|
|
5411
|
+
* Takes elements from the start while the predicate holds, stopping at the
|
|
5412
|
+
* first element that fails.
|
|
5413
|
+
*
|
|
5414
|
+
* **When to use**
|
|
5415
|
+
*
|
|
5416
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
5417
|
+
* a predicate, returning the retained prefix as an array.
|
|
5418
|
+
*
|
|
5419
|
+
* **Details**
|
|
5420
|
+
*
|
|
5421
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
5422
|
+
* `(element, index)`.
|
|
5423
|
+
*
|
|
5424
|
+
* **Example** (Taking while condition holds)
|
|
5425
|
+
*
|
|
5426
|
+
* ```ts import.meta.vitest
|
|
5427
|
+
* import { Array } from "effect"
|
|
5428
|
+
*
|
|
5429
|
+
* Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4) // => [1, 3, 2]
|
|
5430
|
+
* ```
|
|
5431
|
+
*
|
|
5432
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
5433
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
5434
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
5435
|
+
*
|
|
5436
|
+
* @stability stable
|
|
5437
|
+
* @category getters
|
|
5438
|
+
* @since 2.0.0
|
|
5439
|
+
*/
|
|
5440
|
+
const takeWhile = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
5441
|
+
let i = 0;
|
|
5442
|
+
const out = [];
|
|
5443
|
+
for (const a of self) {
|
|
5444
|
+
if (!predicate(a, i)) break;
|
|
5445
|
+
out.push(a);
|
|
5446
|
+
i++;
|
|
5447
|
+
}
|
|
5448
|
+
return out;
|
|
5449
|
+
});
|
|
5450
|
+
/**
|
|
5451
|
+
* Removes the last `n` elements, creating a new array.
|
|
5452
|
+
*
|
|
5453
|
+
* **When to use**
|
|
5454
|
+
*
|
|
5455
|
+
* Use to remove the last `n` elements from an iterable.
|
|
5456
|
+
*
|
|
5457
|
+
* **Details**
|
|
5458
|
+
*
|
|
5459
|
+
* `n` is rounded down and clamped to `[0, length]`. `NaN` is treated as `0`.
|
|
5460
|
+
*
|
|
5461
|
+
* **Example** (Dropping from the end)
|
|
5462
|
+
*
|
|
5463
|
+
* ```ts import.meta.vitest
|
|
5464
|
+
* import { Array } from "effect"
|
|
5465
|
+
*
|
|
5466
|
+
* Array.dropRight([1, 2, 3, 4, 5], 2) // => [1, 2, 3]
|
|
5467
|
+
* ```
|
|
5468
|
+
*
|
|
5469
|
+
* @see {@link drop} — remove from the start
|
|
5470
|
+
* @see {@link takeRight} — keep from the end
|
|
5471
|
+
*
|
|
5472
|
+
* @stability stable
|
|
5473
|
+
* @category getters
|
|
5474
|
+
* @since 2.0.0
|
|
5475
|
+
*/
|
|
5476
|
+
const dropRight = /*#__PURE__*/ dual(2, (self, n) => {
|
|
5477
|
+
const input = fromIterable(self);
|
|
5478
|
+
return input.slice(0, input.length - clampCount(n, input.length));
|
|
5479
|
+
});
|
|
5480
|
+
/**
|
|
5411
5481
|
* Returns the index of the first element matching the predicate, wrapped in an
|
|
5412
5482
|
* `Option`.
|
|
5413
5483
|
*
|
|
@@ -6211,6 +6281,96 @@ const Error$1 = Error$2;
|
|
|
6211
6281
|
* @since 2.0.0
|
|
6212
6282
|
*/
|
|
6213
6283
|
const TaggedError = TaggedError$1;
|
|
6284
|
+
//#endregion
|
|
6285
|
+
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Number.js
|
|
6286
|
+
/**
|
|
6287
|
+
* Exposes the global number constructor.
|
|
6288
|
+
*
|
|
6289
|
+
* **When to use**
|
|
6290
|
+
*
|
|
6291
|
+
* Use to access native JavaScript numeric coercion from the Effect module
|
|
6292
|
+
* namespace.
|
|
6293
|
+
*
|
|
6294
|
+
* **Gotchas**
|
|
6295
|
+
*
|
|
6296
|
+
* This follows native `Number` coercion rules, including empty strings
|
|
6297
|
+
* becoming `0` and invalid numeric strings becoming `NaN`.
|
|
6298
|
+
*
|
|
6299
|
+
* @see {@link parse} for parsing strings into an `Option`
|
|
6300
|
+
*
|
|
6301
|
+
* **Example** (Coercing values to numbers)
|
|
6302
|
+
*
|
|
6303
|
+
* ```ts import.meta.vitest
|
|
6304
|
+
* import { Number as N } from "effect"
|
|
6305
|
+
*
|
|
6306
|
+
* N.Number("42") // => 42
|
|
6307
|
+
* N.Number("3.14") // => 3.14
|
|
6308
|
+
* ```
|
|
6309
|
+
*
|
|
6310
|
+
* @stability stable
|
|
6311
|
+
* @category constructors
|
|
6312
|
+
* @since 4.0.0
|
|
6313
|
+
*/
|
|
6314
|
+
const Number$1 = globalThis.Number;
|
|
6315
|
+
/**
|
|
6316
|
+
* Parses a `number` from a `string` safely using the `Number()` function.
|
|
6317
|
+
* The following special string values are supported: "NaN", "Infinity", "-Infinity".
|
|
6318
|
+
*
|
|
6319
|
+
* **When to use**
|
|
6320
|
+
*
|
|
6321
|
+
* Use to parse numeric text without throwing on invalid input.
|
|
6322
|
+
*
|
|
6323
|
+
* **Example** (Parsing numbers from strings)
|
|
6324
|
+
*
|
|
6325
|
+
* ```ts import.meta.vitest
|
|
6326
|
+
* import { Number, Option } from "effect"
|
|
6327
|
+
*
|
|
6328
|
+
* Number.parse("42") // => Option.some(42)
|
|
6329
|
+
* Number.parse("3.14") // => Option.some(3.14)
|
|
6330
|
+
* Number.parse("NaN") // => Option.some(NaN)
|
|
6331
|
+
* Number.parse("Infinity") // => Option.some(Infinity)
|
|
6332
|
+
* Number.parse("-Infinity") // => Option.some(-Infinity)
|
|
6333
|
+
* Number.parse("not a number") // => Option.none()
|
|
6334
|
+
* ```
|
|
6335
|
+
*
|
|
6336
|
+
* @see {@link Number} for native constructor coercion
|
|
6337
|
+
*
|
|
6338
|
+
* @stability stable
|
|
6339
|
+
* @category constructors
|
|
6340
|
+
* @since 2.0.0
|
|
6341
|
+
*/
|
|
6342
|
+
const parse = (s) => {
|
|
6343
|
+
if (s === "NaN") return some$1(NaN);
|
|
6344
|
+
if (s === "Infinity") return some$1(Infinity);
|
|
6345
|
+
if (s === "-Infinity") return some$1(-Infinity);
|
|
6346
|
+
if (s.trim() === "") return none();
|
|
6347
|
+
const n = Number$1(s);
|
|
6348
|
+
return Number$1.isNaN(n) ? none() : some$1(n);
|
|
6349
|
+
};
|
|
6350
|
+
/**
|
|
6351
|
+
* Returns the number rounded with the given precision.
|
|
6352
|
+
*
|
|
6353
|
+
* **When to use**
|
|
6354
|
+
*
|
|
6355
|
+
* Use to round a number to a fixed number of decimal places.
|
|
6356
|
+
*
|
|
6357
|
+
* **Example** (Rounding with precision)
|
|
6358
|
+
*
|
|
6359
|
+
* ```ts import.meta.vitest
|
|
6360
|
+
* import { Number } from "effect"
|
|
6361
|
+
*
|
|
6362
|
+
* Number.round(1.1234, 2) // => 1.12
|
|
6363
|
+
* Number.round(1.567, 2) // => 1.57
|
|
6364
|
+
* ```
|
|
6365
|
+
*
|
|
6366
|
+
* @stability stable
|
|
6367
|
+
* @category math
|
|
6368
|
+
* @since 3.8.0
|
|
6369
|
+
*/
|
|
6370
|
+
const round = /*#__PURE__*/ dual(2, (self, precision) => {
|
|
6371
|
+
const factor = Math.pow(10, precision);
|
|
6372
|
+
return Math.round(self * factor) / factor;
|
|
6373
|
+
});
|
|
6214
6374
|
globalThis.String;
|
|
6215
6375
|
/**
|
|
6216
6376
|
* Provides an `Order` instance for comparing strings using lexicographic
|
|
@@ -6232,6 +6392,45 @@ globalThis.String;
|
|
|
6232
6392
|
*/
|
|
6233
6393
|
const Order = String$2;
|
|
6234
6394
|
/**
|
|
6395
|
+
* Converts a string to uppercase.
|
|
6396
|
+
*
|
|
6397
|
+
* **Example** (Converting strings to uppercase)
|
|
6398
|
+
*
|
|
6399
|
+
* ```ts import.meta.vitest
|
|
6400
|
+
* import { pipe, String } from "effect"
|
|
6401
|
+
*
|
|
6402
|
+
* pipe("a", String.toUpperCase) // => "A"
|
|
6403
|
+
* String.toUpperCase("hello") // => "HELLO"
|
|
6404
|
+
* ```
|
|
6405
|
+
*
|
|
6406
|
+
* @stability stable
|
|
6407
|
+
* @category transforming
|
|
6408
|
+
* @since 2.0.0
|
|
6409
|
+
*/
|
|
6410
|
+
const toUpperCase = (self) => self.toUpperCase();
|
|
6411
|
+
/**
|
|
6412
|
+
* Replaces matches in a string using `String.prototype.replace`.
|
|
6413
|
+
*
|
|
6414
|
+
* **Details**
|
|
6415
|
+
*
|
|
6416
|
+
* String search values and non-global regular expressions replace the first
|
|
6417
|
+
* match; global regular expressions replace every match.
|
|
6418
|
+
*
|
|
6419
|
+
* **Example** (Replacing a substring)
|
|
6420
|
+
*
|
|
6421
|
+
* ```ts import.meta.vitest
|
|
6422
|
+
* import { pipe, String } from "effect"
|
|
6423
|
+
*
|
|
6424
|
+
* pipe("abc", String.replace("b", "d")) // => "adc"
|
|
6425
|
+
* pipe("hello world", String.replace("world", "Effect")) // => "hello Effect"
|
|
6426
|
+
* ```
|
|
6427
|
+
*
|
|
6428
|
+
* @stability stable
|
|
6429
|
+
* @category transforming
|
|
6430
|
+
* @since 2.0.0
|
|
6431
|
+
*/
|
|
6432
|
+
const replace = (searchValue, replaceValue) => (self) => self.replace(searchValue, replaceValue);
|
|
6433
|
+
/**
|
|
6235
6434
|
* Removes whitespace from both ends of a string.
|
|
6236
6435
|
*
|
|
6237
6436
|
* **Example** (Trimming whitespace)
|
|
@@ -6342,7 +6541,7 @@ const startsWith = (searchString, position) => (self) => self.startsWith(searchS
|
|
|
6342
6541
|
* @category searching
|
|
6343
6542
|
* @since 2.0.0
|
|
6344
6543
|
*/
|
|
6345
|
-
const match = (regExp) => (self) => fromNullOr(self.match(regExp));
|
|
6544
|
+
const match$1 = (regExp) => (self) => fromNullOr(self.match(regExp));
|
|
6346
6545
|
/**
|
|
6347
6546
|
* Replaces all occurrences of a substring or pattern in a string.
|
|
6348
6547
|
*
|
|
@@ -6360,6 +6559,30 @@ const match = (regExp) => (self) => fromNullOr(self.match(regExp));
|
|
|
6360
6559
|
* @since 2.0.0
|
|
6361
6560
|
*/
|
|
6362
6561
|
const replaceAll = (searchValue, replaceValue) => (self) => self.replaceAll(searchValue, replaceValue);
|
|
6562
|
+
globalThis.Boolean;
|
|
6563
|
+
/**
|
|
6564
|
+
* Chooses between two lazy branches based on a boolean value.
|
|
6565
|
+
*
|
|
6566
|
+
* **When to use**
|
|
6567
|
+
*
|
|
6568
|
+
* Use to choose between two lazy branches based on a boolean value.
|
|
6569
|
+
*
|
|
6570
|
+
* **Example** (Pattern matching on booleans)
|
|
6571
|
+
*
|
|
6572
|
+
* ```ts import.meta.vitest
|
|
6573
|
+
* import { Boolean } from "effect"
|
|
6574
|
+
*
|
|
6575
|
+
* Boolean.match(true, {
|
|
6576
|
+
* onFalse: () => "It's false!",
|
|
6577
|
+
* onTrue: () => "It's true!"
|
|
6578
|
+
* }) // => "It's true!"
|
|
6579
|
+
* ```
|
|
6580
|
+
*
|
|
6581
|
+
* @stability stable
|
|
6582
|
+
* @category pattern matching
|
|
6583
|
+
* @since 2.0.0
|
|
6584
|
+
*/
|
|
6585
|
+
const match = /*#__PURE__*/ dual(2, (value, options) => value ? options.onTrue() : options.onFalse());
|
|
6363
6586
|
//#endregion
|
|
6364
6587
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/MutableRef.js
|
|
6365
6588
|
const TypeId = "~effect/MutableRef";
|
|
@@ -6829,4 +7052,4 @@ const toArrayN = (self, n) => {
|
|
|
6829
7052
|
*/
|
|
6830
7053
|
const toArray = (self) => toArrayN(self, self.length);
|
|
6831
7054
|
//#endregion
|
|
6832
|
-
export {
|
|
7055
|
+
export { last as $, toStringUnknown as $n, pipeArguments as $r, isGreaterThanOrEqualTo as $t, dedupe as A, contE as An, isNullish as Ar, filter$1 as At, findLast as B, isEffect as Bn, isUnknown as Br, liftThrowable as Bt, Error$1 as C, causeDie as Cn, isBoolean as Cr, map$2 as Ct, appendAll as D, constEmptyAnnotations as Dn, isNotNull as Dr, all as Dt, append$1 as E, causeFromReasons as En, isIterable as Er, normalize as Et, every as F, exitFailCause as Fn, isReadonlyObject as Fr, fromUndefinedOr as Ft, get$1 as G, makePrimitiveProto as Gn, constant as Gr, some$1 as Gt, flatten as H, isFailReason as Hn, constTrue as Hr, match$4 as Ht, filter as I, exitSucceed as In, isRegExp as Ir, getOrElse as It, isArrayEmpty as J, internalCall as Jn, memoize as Jr, BigInt$1 as Jt, getSomes as K, withFiber as Kn, dual as Kr, toArray$1 as Kt, filterMap as L, isCause as Ln, isString as Lr, getOrUndefined as Lt, dropRight as M, evaluate as Mn, isObject as Mr, flatMap$2 as Mt, empty as N, exitDie as Nn, isObjectKeyword as Nr, flatten$1 as Nt, contains as O, contA as On, isNotNullish as Or, contains$1 as Ot, ensure as P, exitFail as Pn, isPropertyKey as Pr, fromNullishOr as Pt, join as Q, NodeInspectSymbol as Qn, Prototype as Qr, isGreaterThan as Qt, findFirst as R, isDieReason as Rn, isTagged as Rr, isNone as Rt, round as S, causeCombine as Sn, isBigInt as Sr, isSuccess as St, taggedEnum as T, causeFail as Tn, isFunction as Tr, succeed as Tt, forEach as U, isInterruptReason as Un, constUndefined as Ur, none as Ut, flatMap as V, isExit as Vn, constFalse as Vr, map$3 as Vt, fromIterable as W, makePrimitive as Wn, constVoid as Wr, orElse as Wt, isCanonicalArrayIndex as X, setStackTraceLimit as Xn, pipe as Xr, Number$2 as Xt, isArrayNonEmpty as Y, getStackTraceLimit as Yn, memoizeIdempotent as Yr, Date$1 as Yt, isReadonlyArrayNonEmpty as Z, BaseProto as Zn, Class$1 as Zr, String$2 as Zt, startsWith as _, TaggedError$1 as _n, string as _r, fail as _t, takeN as a, make$3 as an, currentFiberTypeId as ar, prepend as at, trimEnd as b, causeAddInterrupts as bn, symbol$1 as br, getOrThrow as bt, make$1 as c, Die as cn, asEquivalence as cr, sort as ct, Order as d, ExitTypeId as dn, symbol as dr, fromEntries as dt, isLessThan as en, format as er, makeEquivalence as et, includes as f, Fail as fn, array as fr, get$2 as ft, split as g, StackTraceKey as gn, optimize as gr, values as gt, replaceAll as h, ReasonBase as hn, number as hr, remove as ht, take as i, Tuple as in, formatPropertyKey as ir, of as it, dedupeWith as j, done as jn, isNumber as jr, firstSomeOf as jt, containsWith as k, contAll as kn, isNotUndefined as kr, exists as kt, update as l, Done as ln, byReferenceUnsafe as lr, take$1 as lt, replace as m, PipeInspectableProto as mn, hash as mr, map$1 as mt, clear as n, make$2 as nn, formatJson as nr, match$2 as nt, toArray as o, strictEqual as on, redact as or, reduce as ot, match$1 as p, InterruptorStackTrace as pn, combine as pr, makeEquivalence$1 as pt, head as q, assignProperty as qn, identity as qr, zipWith as qt, make as r, mapInput as rn, formatPath as rr, matchRight as rt, get as s, CauseImpl as sn, symbolRedactable as sr, some as st, append as t, isLessThanOrEqualTo as tn, formatDate as tr, map as tt, match as u, Error$2 as un, equals as ur, takeWhile as ut, toUpperCase as v, Yield as vn, structure as vr, flatMap$1 as vt, TaggedError as w, causeEmpty as wn, isError as wr, match$3 as wt, parse as x, causeAnnotate as xn, hasProperty as xr, isFailure as xt, trim as y, args as yn, structureKeys as yr, fromOption as yt, findFirstIndex as z, isDone as zn, isUndefined as zr, isSome as zt };
|