@railway-ts/pipelines 0.1.11 → 0.1.12

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.
Files changed (2) hide show
  1. package/README.md +47 -43
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,6 +6,10 @@ Railway-oriented programming for TypeScript. Result and Option types that don't
6
6
 
7
7
  Small, focused API surface. Errors propagate automatically, you handle them once at the end.
8
8
 
9
+ Fully tree-shakable — import only what you need:
10
+
11
+ `option` 402 B · `result` 582 B · `composition` 233 B · `schema` ~3 kB — **~4.2 kB total** minified + brotli
12
+
9
13
  ## Install
10
14
 
11
15
  ```bash
@@ -99,15 +103,15 @@ match(name, {
99
103
  }); // Output: Alice
100
104
  ```
101
105
 
102
- | Category | Functions |
103
- |----------|-----------|
104
- | **Core** | `some`, `none`, `isSome`, `isNone` |
105
- | **Transform** | `map`, `flatMap`, `bimap`, `filter`, `tap` |
106
- | **Curried** | `mapWith`, `flatMapWith`, `filterWith`, `tapWith` |
107
- | **Unwrap** | `unwrap`, `unwrapOr`, `unwrapOrElse` |
108
- | **Combine** | `combine` |
109
- | **Convert** | `fromNullable`, `mapToResult` |
110
- | **Branch** | `match` |
106
+ | Category | Functions |
107
+ | ------------- | ------------------------------------------------- |
108
+ | **Core** | `some`, `none`, `isSome`, `isNone` |
109
+ | **Transform** | `map`, `flatMap`, `bimap`, `filter`, `tap` |
110
+ | **Curried** | `mapWith`, `flatMapWith`, `filterWith`, `tapWith` |
111
+ | **Unwrap** | `unwrap`, `unwrapOr`, `unwrapOrElse` |
112
+ | **Combine** | `combine` |
113
+ | **Convert** | `fromNullable`, `mapToResult` |
114
+ | **Branch** | `match` |
111
115
 
112
116
  ### Result
113
117
 
@@ -130,22 +134,22 @@ match(result, {
130
134
  }); // Output: 15
131
135
  ```
132
136
 
133
- | Category | Functions |
134
- |----------|-----------|
135
- | **Core** | `ok`, `err`, `isOk`, `isErr` |
136
- | **Transform** | `map`, `mapErr`, `flatMap`, `bimap`, `filter`, `tap`, `tapErr` |
137
- | **Curried** | `mapWith`, `flatMapWith`, `mapErrWith`, `filterWith`, `tapWith`, `tapErrWith` |
138
- | **Recovery** | `orElse`, `orElseWith` |
139
- | **Unwrap** | `unwrap`, `unwrapOr`, `unwrapOrElse` |
140
- | **Combine** | `combine`, `combineAll` |
141
- | **Convert** | `fromTry`, `fromTryWithError`, `fromPromise`, `fromPromiseWithError`, `toPromise`, `mapToOption` |
142
- | **Branch** | `match` |
137
+ | Category | Functions |
138
+ | ------------- | ------------------------------------------------------------------------------------------------ |
139
+ | **Core** | `ok`, `err`, `isOk`, `isErr` |
140
+ | **Transform** | `map`, `mapErr`, `flatMap`, `bimap`, `filter`, `tap`, `tapErr` |
141
+ | **Curried** | `mapWith`, `flatMapWith`, `mapErrWith`, `filterWith`, `tapWith`, `tapErrWith` |
142
+ | **Recovery** | `orElse`, `orElseWith` |
143
+ | **Unwrap** | `unwrap`, `unwrapOr`, `unwrapOrElse` |
144
+ | **Combine** | `combine`, `combineAll` |
145
+ | **Convert** | `fromTry`, `fromTryWithError`, `fromPromise`, `fromPromiseWithError`, `toPromise`, `mapToOption` |
146
+ | **Branch** | `match` |
143
147
 
144
148
  ### Schema
145
149
 
146
150
  Parse untrusted data into typed values. Accumulates all validation errors.
147
151
 
148
- > **Standard Schema v1 compliant** — use `toStandardSchema()` for interop with tRPC, TanStack Form, React Hook Form, and other Standard Schema consumers. See [Recipes → Standard Schema Interop](docs/RECIPES.md#standard-schema-interop).
152
+ > **Standard Schema v1 compliant** — use `toStandardSchema()` for interop with tRPC, TanStack Form, React Hook Form, and other Standard Schema consumers. See [Recipes -> Standard Schema Interop](docs/RECIPES.md#standard-schema-interop).
149
153
 
150
154
  ```typescript
151
155
  import {
@@ -174,24 +178,24 @@ const result = validate(input, userSchema);
174
178
  // Result<User, ValidationError[]>
175
179
  ```
176
180
 
177
- | Category | Functions |
178
- |----------|-----------|
179
- | **Primitives** | `string`, `number`, `boolean`, `date`, `bigint` |
180
- | **Parsers** | `parseNumber`, `parseString`, `parseBool`, `parseBigInt`, `parseDate`, `parseISODate`, `parseJSON`, `parseURL`, `parseEnum` |
181
- | **Structures** | `object`, `array`, `tuple`, `tupleOf` |
182
- | **Unions** | `union`, `discriminatedUnion`, `literal` |
183
- | **Modifiers** | `required`, `optional`, `nullable`, `emptyAsOptional` |
184
- | **String Constraints** | `minLength`, `maxLength`, `pattern`, `nonEmpty`, `email`, `phoneNumber` |
185
- | **Number Constraints** | `min`, `max`, `integer`, `finite`, `between`, `positive`, `negative`, `nonZero`, `divisibleBy`, `precision` |
186
- | **Date Constraints** | `dateRange`, `pastDate`, `futureDate`, `todayOrFuture` |
187
- | **Enums** | `stringEnum`, `enumValue`, `oneOf` |
188
- | **Boolean Constraints** | `matches` |
189
- | **Array Constraints** | `minItems`, `maxItems`, `notEmpty`, `unique` |
190
- | **Combinators** | `chain`, `transform`, `refine` |
191
- | **Cross-field** | `refineAt`, `refineAtAsync` |
192
- | **Async** | `chainAsync`, `refineAsync`, `refineAtAsync` |
193
- | **Utilities** | `validate`, `validateAndFormatResult`, `formatErrors`, `toStandardSchema`, `ROOT_ERROR_KEY` |
194
- | **Types** | `Validator`, `AsyncValidator`, `MaybeAsyncValidator`, `Schema`, `SyncSchema`, `InferSchemaType`, `ValidatorMapOutput`, `ValidationError`, `ValidationResult`, `StandardSchemaV1` |
181
+ | Category | Functions |
182
+ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
183
+ | **Primitives** | `string`, `number`, `boolean`, `date`, `bigint` |
184
+ | **Parsers** | `parseNumber`, `parseString`, `parseBool`, `parseBigInt`, `parseDate`, `parseISODate`, `parseJSON`, `parseURL`, `parseEnum` |
185
+ | **Structures** | `object`, `array`, `tuple`, `tupleOf` |
186
+ | **Unions** | `union`, `discriminatedUnion`, `literal` |
187
+ | **Modifiers** | `required`, `optional`, `nullable`, `emptyAsOptional` |
188
+ | **String Constraints** | `minLength`, `maxLength`, `pattern`, `nonEmpty`, `email`, `phoneNumber` |
189
+ | **Number Constraints** | `min`, `max`, `integer`, `finite`, `between`, `positive`, `negative`, `nonZero`, `divisibleBy`, `precision` |
190
+ | **Date Constraints** | `dateRange`, `pastDate`, `futureDate`, `todayOrFuture` |
191
+ | **Enums** | `stringEnum`, `enumValue`, `oneOf` |
192
+ | **Boolean Constraints** | `matches` |
193
+ | **Array Constraints** | `minItems`, `maxItems`, `notEmpty`, `unique` |
194
+ | **Combinators** | `chain`, `transform`, `refine` |
195
+ | **Cross-field** | `refineAt`, `refineAtAsync` |
196
+ | **Async** | `chainAsync`, `refineAsync`, `refineAtAsync` |
197
+ | **Utilities** | `validate`, `validateAndFormatResult`, `formatErrors`, `toStandardSchema`, `ROOT_ERROR_KEY` |
198
+ | **Types** | `Validator`, `AsyncValidator`, `MaybeAsyncValidator`, `Schema`, `SyncSchema`, `InferSchemaType`, `ValidatorMapOutput`, `ValidationError`, `ValidationResult`, `StandardSchemaV1` |
195
199
 
196
200
  ### Composition
197
201
 
@@ -222,11 +226,11 @@ const processOrder = flowAsync(validateOrder, chargePayment, createShipment);
222
226
  await processOrder(orderInput);
223
227
  ```
224
228
 
225
- | Category | Functions |
226
- |----------|-----------|
227
- | **Sync** | `pipe`, `flow`, `curry`, `uncurry`, `tupled`, `untupled` |
228
- | **Async** | `pipeAsync`, `flowAsync` |
229
- | **Types** | `MaybeAsync` |
229
+ | Category | Functions |
230
+ | --------- | -------------------------------------------------------- |
231
+ | **Sync** | `pipe`, `flow`, `curry`, `uncurry`, `tupled`, `untupled` |
232
+ | **Async** | `pipeAsync`, `flowAsync` |
233
+ | **Types** | `MaybeAsync` |
230
234
 
231
235
  ## Examples
232
236
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railway-ts/pipelines",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Railway-oriented pipelines for TypeScript: a lightweight fp-style Result/Option and schema layer for handling errors and validating boundaries.",
5
5
  "type": "module",
6
6
  "exports": {