@effect/io
Advanced tools
Comparing version 0.37.0 to 0.37.1
@@ -108,2 +108,9 @@ /** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
export interface Options { | ||
pathDelim: string; | ||
} | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
@@ -121,3 +128,3 @@ */ | ||
*/ | ||
export declare const MissingData: (path: Array<string>, message: string) => ConfigError; | ||
export declare const MissingData: (path: Array<string>, message: string, options?: Options) => ConfigError; | ||
/** | ||
@@ -127,3 +134,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const InvalidData: (path: Array<string>, message: string) => ConfigError; | ||
export declare const InvalidData: (path: Array<string>, message: string, options?: Options) => ConfigError; | ||
/** | ||
@@ -133,3 +140,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const SourceUnavailable: (path: Array<string>, message: string, cause: Cause.Cause<unknown>) => ConfigError; | ||
export declare const SourceUnavailable: (path: Array<string>, message: string, cause: Cause.Cause<unknown>, options?: Options) => ConfigError; | ||
/** | ||
@@ -139,3 +146,3 @@ * @since 1.0.0 | ||
*/ | ||
export declare const Unsupported: (path: Array<string>, message: string) => ConfigError; | ||
export declare const Unsupported: (path: Array<string>, message: string, options?: Options) => ConfigError; | ||
/** | ||
@@ -142,0 +149,0 @@ * Returns `true` if the specified value is a `ConfigError`, `false` otherwise. |
@@ -54,3 +54,5 @@ "use strict"; | ||
exports.Or = Or; | ||
const InvalidData = (path, message) => { | ||
const InvalidData = (path, message, options = { | ||
pathDelim: "." | ||
}) => { | ||
const error = Object.create(proto); | ||
@@ -63,3 +65,3 @@ error._tag = OpCodes.OP_INVALID_DATA; | ||
value() { | ||
const path = RA.join(".")(this.path); | ||
const path = RA.join(options.pathDelim)(this.path); | ||
return `(Invalid data at ${path}: "${this.message}")`; | ||
@@ -72,3 +74,5 @@ } | ||
exports.InvalidData = InvalidData; | ||
const MissingData = (path, message) => { | ||
const MissingData = (path, message, options = { | ||
pathDelim: "." | ||
}) => { | ||
const error = Object.create(proto); | ||
@@ -81,3 +85,3 @@ error._tag = OpCodes.OP_MISSING_DATA; | ||
value() { | ||
const path = RA.join(".")(this.path); | ||
const path = RA.join(options.pathDelim)(this.path); | ||
return `(Missing data at ${path}: "${this.message}")`; | ||
@@ -90,3 +94,5 @@ } | ||
exports.MissingData = MissingData; | ||
const SourceUnavailable = (path, message, cause) => { | ||
const SourceUnavailable = (path, message, cause, options = { | ||
pathDelim: "." | ||
}) => { | ||
const error = Object.create(proto); | ||
@@ -100,3 +106,3 @@ error._tag = OpCodes.OP_SOURCE_UNAVAILABLE; | ||
value() { | ||
const path = RA.join(".")(this.path); | ||
const path = RA.join(options.pathDelim)(this.path); | ||
return `(Source unavailable at ${path}: "${this.message}")`; | ||
@@ -109,3 +115,5 @@ } | ||
exports.SourceUnavailable = SourceUnavailable; | ||
const Unsupported = (path, message) => { | ||
const Unsupported = (path, message, options = { | ||
pathDelim: "." | ||
}) => { | ||
const error = Object.create(proto); | ||
@@ -118,3 +126,3 @@ error._tag = OpCodes.OP_UNSUPPORTED; | ||
value() { | ||
const path = RA.join(".")(this.path); | ||
const path = RA.join(options.pathDelim)(this.path); | ||
return `(Unsupported operation at ${path}: "${this.message}")`; | ||
@@ -121,0 +129,0 @@ } |
{ | ||
"name": "@effect/io", | ||
"version": "0.37.0", | ||
"version": "0.37.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -133,2 +133,10 @@ /** | ||
* @since 1.0.0 | ||
* @category models | ||
*/ | ||
export interface Options { | ||
pathDelim: string | ||
} | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
@@ -148,3 +156,4 @@ */ | ||
*/ | ||
export const MissingData: (path: Array<string>, message: string) => ConfigError = internal.MissingData | ||
export const MissingData: (path: Array<string>, message: string, options?: Options) => ConfigError = | ||
internal.MissingData | ||
@@ -155,3 +164,4 @@ /** | ||
*/ | ||
export const InvalidData: (path: Array<string>, message: string) => ConfigError = internal.InvalidData | ||
export const InvalidData: (path: Array<string>, message: string, options?: Options) => ConfigError = | ||
internal.InvalidData | ||
@@ -162,4 +172,8 @@ /** | ||
*/ | ||
export const SourceUnavailable: (path: Array<string>, message: string, cause: Cause.Cause<unknown>) => ConfigError = | ||
internal.SourceUnavailable | ||
export const SourceUnavailable: ( | ||
path: Array<string>, | ||
message: string, | ||
cause: Cause.Cause<unknown>, | ||
options?: Options | ||
) => ConfigError = internal.SourceUnavailable | ||
@@ -170,3 +184,4 @@ /** | ||
*/ | ||
export const Unsupported: (path: Array<string>, message: string) => ConfigError = internal.Unsupported | ||
export const Unsupported: (path: Array<string>, message: string, options?: Options) => ConfigError = | ||
internal.Unsupported | ||
@@ -173,0 +188,0 @@ /** |
@@ -52,3 +52,7 @@ import * as Either from "@effect/data/Either" | ||
/** @internal */ | ||
export const InvalidData = (path: ReadonlyArray<string>, message: string): ConfigError.ConfigError => { | ||
export const InvalidData = ( | ||
path: ReadonlyArray<string>, | ||
message: string, | ||
options: ConfigError.Options = { pathDelim: "." } | ||
): ConfigError.ConfigError => { | ||
const error = Object.create(proto) | ||
@@ -61,3 +65,3 @@ error._tag = OpCodes.OP_INVALID_DATA | ||
value(this: ConfigError.InvalidData) { | ||
const path = pipe(this.path, RA.join(".")) | ||
const path = pipe(this.path, RA.join(options.pathDelim)) | ||
return `(Invalid data at ${path}: "${this.message}")` | ||
@@ -70,3 +74,7 @@ } | ||
/** @internal */ | ||
export const MissingData = (path: ReadonlyArray<string>, message: string): ConfigError.ConfigError => { | ||
export const MissingData = ( | ||
path: ReadonlyArray<string>, | ||
message: string, | ||
options: ConfigError.Options = { pathDelim: "." } | ||
): ConfigError.ConfigError => { | ||
const error = Object.create(proto) | ||
@@ -79,3 +87,3 @@ error._tag = OpCodes.OP_MISSING_DATA | ||
value(this: ConfigError.MissingData) { | ||
const path = pipe(this.path, RA.join(".")) | ||
const path = pipe(this.path, RA.join(options.pathDelim)) | ||
return `(Missing data at ${path}: "${this.message}")` | ||
@@ -91,3 +99,4 @@ } | ||
message: string, | ||
cause: Cause.Cause<unknown> | ||
cause: Cause.Cause<unknown>, | ||
options: ConfigError.Options = { pathDelim: "." } | ||
): ConfigError.ConfigError => { | ||
@@ -102,3 +111,3 @@ const error = Object.create(proto) | ||
value(this: ConfigError.SourceUnavailable) { | ||
const path = pipe(this.path, RA.join(".")) | ||
const path = pipe(this.path, RA.join(options.pathDelim)) | ||
return `(Source unavailable at ${path}: "${this.message}")` | ||
@@ -111,3 +120,7 @@ } | ||
/** @internal */ | ||
export const Unsupported = (path: ReadonlyArray<string>, message: string): ConfigError.ConfigError => { | ||
export const Unsupported = ( | ||
path: ReadonlyArray<string>, | ||
message: string, | ||
options: ConfigError.Options = { pathDelim: "." } | ||
): ConfigError.ConfigError => { | ||
const error = Object.create(proto) | ||
@@ -120,3 +133,3 @@ error._tag = OpCodes.OP_UNSUPPORTED | ||
value(this: ConfigError.Unsupported) { | ||
const path = pipe(this.path, RA.join(".")) | ||
const path = pipe(this.path, RA.join(options.pathDelim)) | ||
return `(Unsupported operation at ${path}: "${this.message}")` | ||
@@ -123,0 +136,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6438154
114941