@dbpath/utils
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -15,2 +15,3 @@ export type ErrorFn<From, To> = (value: From) => ErrorsAnd<To>; | ||
export declare function mapErrorsK<T, T1>(t: ErrorsAnd<T>, fn: (t: T) => Promise<ErrorsAnd<T1>>): Promise<ErrorsAnd<T1>>; | ||
export declare function prefixAnyErrors<T>(t: ErrorsAnd<T>, ...prefix: string[]): ErrorsAnd<T>; | ||
export declare function flattenErrors<T>(t: ErrorsAnd<ErrorsAnd<T>>): ErrorsAnd<T>; | ||
@@ -17,0 +18,0 @@ export declare function flatMapErrors<T, T1>(t: ErrorsAnd<T>, fn: (t: T) => ErrorsAnd<T1>): ErrorsAnd<T1>; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.composeErrorFnAndThen = exports.composeErrorFn = exports.foldErrorsK = exports.foldErrors = exports.flatMapErrorsK = exports.flatMapErrors = exports.flattenErrors = exports.mapErrorsK = exports.allValuesIn = exports.allErrorsIn = exports.mapAndforEachErrorFn = exports.mapErrors = exports.value = exports.errors = exports.ignoreErrorK = exports.ignoreError = exports.hasErrors = exports.reportErrors = exports.mapArrayOfErrorsAnd = void 0; | ||
exports.composeErrorFnAndThen = exports.composeErrorFn = exports.foldErrorsK = exports.foldErrors = exports.flatMapErrorsK = exports.flatMapErrors = exports.flattenErrors = exports.prefixAnyErrors = exports.mapErrorsK = exports.allValuesIn = exports.allErrorsIn = exports.mapAndforEachErrorFn = exports.mapErrors = exports.value = exports.errors = exports.ignoreErrorK = exports.ignoreError = exports.hasErrors = exports.reportErrors = exports.mapArrayOfErrorsAnd = void 0; | ||
const utils_1 = require("./utils"); | ||
@@ -86,2 +86,6 @@ function mapArrayOfErrorsAnd(ts, fn) { | ||
exports.mapErrorsK = mapErrorsK; | ||
function prefixAnyErrors(t, ...prefix) { | ||
return hasErrors(t) ? [...prefix, ...errors(t)] : t; | ||
} | ||
exports.prefixAnyErrors = prefixAnyErrors; | ||
function flattenErrors(t) { | ||
@@ -88,0 +92,0 @@ return hasErrors(t) ? (0, utils_1.flatten)(t) : t; |
{ | ||
"name": "@dbpath/utils", | ||
"description": "", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"main": "dist/index", | ||
@@ -6,0 +6,0 @@ "types": "dist/index", |
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
52357
1066