@systemfsoftware/effect-schema-law 0.3.0 → 0.3.2

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.
@@ -0,0 +1,20 @@
1
+ import { Schema } from 'effect';
2
+
3
+ export declare const boundedUnion: <Base extends readonly [Schema.Schema.Any, ...ReadonlyArray<Schema.Schema.Any>], Recur extends readonly [Schema.Schema.Any, ...ReadonlyArray<Schema.Schema.Any>]>(identifier: string, options: {
4
+ readonly base: Base;
5
+ readonly recur: Recur;
6
+ readonly maxDepth?: number;
7
+ }) => Schema.Schema<Schema.Schema.Type<Base[number] | Recur[number]>, Schema.Schema.Encoded<Base[number] | Recur[number]>, Schema.Schema.Context<Base[number] | Recur[number]>>;
8
+
9
+ /**
10
+ * Property-test the round-trip and encode-stability laws of any Effect Schema.
11
+ *
12
+ * Registers two fast-check properties with `@effect/vitest`:
13
+ * 1. `∀x. enc(dec(enc(x))) === enc(x)` — encode stability across decode.
14
+ * 2. `∀x. dec(enc(x)) === x` — round-trip identity.
15
+ *
16
+ * Use inside a `describe` block to scope the generated tests.
17
+ */
18
+ export declare const ruleOfSchemas: <A, I>(name: string, schema: Schema.Schema<A, I, never>) => void;
19
+
20
+ export { }
package/dist/index.d.ts CHANGED
@@ -7,6 +7,15 @@ declare const boundedUnion: <Base extends readonly [Schema.Schema.Any, ...Readon
7
7
  }) => Schema.Schema<Schema.Schema.Type<Base[number] | Recur[number]>, Schema.Schema.Encoded<Base[number] | Recur[number]>, Schema.Schema.Context<Base[number] | Recur[number]>>;
8
8
  //#endregion
9
9
  //#region src/schema.d.ts
10
+ /**
11
+ * Property-test the round-trip and encode-stability laws of any Effect Schema.
12
+ *
13
+ * Registers two fast-check properties with `@effect/vitest`:
14
+ * 1. `∀x. enc(dec(enc(x))) === enc(x)` — encode stability across decode.
15
+ * 2. `∀x. dec(enc(x)) === x` — round-trip identity.
16
+ *
17
+ * Use inside a `describe` block to scope the generated tests.
18
+ */
10
19
  declare const ruleOfSchemas: <A, I>(name: string, schema: Schema.Schema<A, I, never>) => void;
11
20
  //#endregion
12
21
  export { boundedUnion, ruleOfSchemas };
package/dist/index.mjs CHANGED
@@ -15,6 +15,15 @@ const boundedUnion = (identifier, options) => {
15
15
  };
16
16
  //#endregion
17
17
  //#region src/schema.ts
18
+ /**
19
+ * Property-test the round-trip and encode-stability laws of any Effect Schema.
20
+ *
21
+ * Registers two fast-check properties with `@effect/vitest`:
22
+ * 1. `∀x. enc(dec(enc(x))) === enc(x)` — encode stability across decode.
23
+ * 2. `∀x. dec(enc(x)) === x` — round-trip identity.
24
+ *
25
+ * Use inside a `describe` block to scope the generated tests.
26
+ */
18
27
  const ruleOfSchemas = (name, schema) => {
19
28
  const decodeEither = Schema.decodeEither(schema);
20
29
  const encodeSync = Schema.encodeSync(schema);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@systemfsoftware/effect-schema-law",
3
3
  "license": "MIT",
4
- "version": "0.3.0",
4
+ "version": "0.3.2",
5
5
  "author": "Ryan Lee <drdgvhbh@gmail.com>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "scripts": {
59
59
  "clean": "rimraf dist",
60
- "build": "tsdown",
60
+ "build": "tsdown && api-extractor run --local",
61
61
  "typecheck": "tsc --noEmit --incremental",
62
62
  "test": "vitest run",
63
63
  "test:run": "vitest run",