errore 0.7.0 → 0.7.1

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 CHANGED
@@ -161,10 +161,10 @@ if (errore.isError(result)) {
161
161
  import * as errore from 'errore'
162
162
 
163
163
  // Sync - wraps exceptions in UnhandledError
164
- const parsed = errore.tryFn(() => JSON.parse(input))
164
+ const parsed = errore.try(() => JSON.parse(input))
165
165
 
166
166
  // Sync - with custom error type
167
- const parsed = errore.tryFn({
167
+ const parsed = errore.try({
168
168
  try: () => JSON.parse(input),
169
169
  catch: e => new ParseError({ cause: e })
170
170
  })
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  partition: () => partition,
37
37
  tap: () => tap,
38
38
  tapAsync: () => tapAsync,
39
+ try: () => tryFn,
39
40
  tryAsync: () => tryAsync,
40
41
  tryFn: () => tryFn,
41
42
  unwrap: () => unwrap,
@@ -254,6 +255,7 @@ function flatten(value) {
254
255
  partition,
255
256
  tap,
256
257
  tapAsync,
258
+ try: null,
257
259
  tryAsync,
258
260
  tryFn,
259
261
  unwrap,
package/dist/index.d.cts CHANGED
@@ -321,4 +321,4 @@ declare function partition<V>(values: V[]): [Exclude<V, Error>[], Extract<V, Err
321
321
  */
322
322
  declare function flatten<V>(value: V): V;
323
323
 
324
- export { type EnsureNotError, type Errore, type InferError, type InferValue, TaggedError, type TaggedErrorClass, type TaggedErrorInstance, UnhandledError, andThen, andThenAsync, flatten, isError, isOk, isTaggedError, map, mapError, match, matchError, matchErrorPartial, partition, tap, tapAsync, tryAsync, tryFn, unwrap, unwrapOr };
324
+ export { type EnsureNotError, type Errore, type InferError, type InferValue, TaggedError, type TaggedErrorClass, type TaggedErrorInstance, UnhandledError, andThen, andThenAsync, flatten, isError, isOk, isTaggedError, map, mapError, match, matchError, matchErrorPartial, partition, tap, tapAsync, tryFn as try, tryAsync, tryFn, unwrap, unwrapOr };
package/dist/index.d.ts CHANGED
@@ -321,4 +321,4 @@ declare function partition<V>(values: V[]): [Exclude<V, Error>[], Extract<V, Err
321
321
  */
322
322
  declare function flatten<V>(value: V): V;
323
323
 
324
- export { type EnsureNotError, type Errore, type InferError, type InferValue, TaggedError, type TaggedErrorClass, type TaggedErrorInstance, UnhandledError, andThen, andThenAsync, flatten, isError, isOk, isTaggedError, map, mapError, match, matchError, matchErrorPartial, partition, tap, tapAsync, tryAsync, tryFn, unwrap, unwrapOr };
324
+ export { type EnsureNotError, type Errore, type InferError, type InferValue, TaggedError, type TaggedErrorClass, type TaggedErrorInstance, UnhandledError, andThen, andThenAsync, flatten, isError, isOk, isTaggedError, map, mapError, match, matchError, matchErrorPartial, partition, tap, tapAsync, tryFn as try, tryAsync, tryFn, unwrap, unwrapOr };
package/dist/index.js CHANGED
@@ -208,6 +208,7 @@ export {
208
208
  partition,
209
209
  tap,
210
210
  tapAsync,
211
+ tryFn as try,
211
212
  tryAsync,
212
213
  tryFn,
213
214
  unwrap,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errore",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "description": "Type-safe errors as values for TypeScript. Like Go, but with full type inference.",
6
6
  "repository": {