@faast/ts-common
Advanced tools
Comparing version 0.5.6 to 0.6.0
import * as t from 'io-ts'; | ||
import BigNumber from 'bignumber.js'; | ||
declare class BigNumberType extends t.Type<BigNumber> { | ||
declare class BigNumberType extends t.Type<BigNumber, string> { | ||
readonly _tag: 'BigNumberType'; | ||
@@ -5,0 +5,0 @@ constructor(); |
@@ -24,3 +24,3 @@ import * as t from 'io-ts'; | ||
} | ||
}, t.identity); | ||
}, u => u.toString()); | ||
this._tag = 'BigNumberType'; | ||
@@ -27,0 +27,0 @@ } |
import BigNumber from 'bignumber.js'; | ||
import { Numeric } from '../types'; | ||
export declare function isMatchingError(e: Error, partialMessages: string[]): boolean; | ||
export declare function toBigNumber(value: Numeric): BigNumber; | ||
@@ -4,0 +5,0 @@ export declare function toBigNumber(value: Numeric | null): BigNumber | null; |
import BigNumber from 'bignumber.js'; | ||
import { isNil } from '../guards'; | ||
export function isMatchingError(e, partialMessages) { | ||
const messageLower = e.toString().toLowerCase(); | ||
return partialMessages.some(pm => messageLower.includes(pm.toLowerCase())); | ||
} | ||
export function toBigNumber(value) { | ||
@@ -4,0 +8,0 @@ if (isNil(value)) { |
@@ -5,4 +5,4 @@ import { ValidationError, Type } from 'io-ts'; | ||
export declare const SimpleReporter: Reporter<Array<string>>; | ||
export declare function assertType<T>(typeCodec: Type<T>, value: unknown, description?: string, ErrorType?: { | ||
export declare function assertType<T>(typeCodec: Type<T, any, unknown>, value: unknown, description?: string, ErrorType?: { | ||
new (message: string): Error; | ||
}): T; |
{ | ||
"name": "@faast/ts-common", | ||
"version": "0.5.6", | ||
"version": "0.6.0", | ||
"description": "Common typescript types and utils used by faast", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import * as t from 'io-ts' | ||
import BigNumber from 'bignumber.js' | ||
class BigNumberType extends t.Type<BigNumber> { | ||
class BigNumberType extends t.Type<BigNumber, string> { | ||
readonly _tag: 'BigNumberType' = 'BigNumberType' | ||
@@ -26,3 +26,3 @@ constructor() { | ||
}, | ||
t.identity, | ||
u => u.toString(), | ||
) | ||
@@ -29,0 +29,0 @@ } |
@@ -5,2 +5,7 @@ import BigNumber from 'bignumber.js' | ||
export function isMatchingError(e: Error, partialMessages: string[]) { | ||
const messageLower = e.toString().toLowerCase() | ||
return partialMessages.some(pm => messageLower.includes(pm.toLowerCase())) | ||
} | ||
export function toBigNumber(value: Numeric): BigNumber | ||
@@ -7,0 +12,0 @@ export function toBigNumber(value: Numeric | null): BigNumber | null |
@@ -66,3 +66,3 @@ import { Context, ValidationError, UnionType, IntersectionType, Type, PartialType, Decoder } from 'io-ts' | ||
export function assertType<T>( | ||
typeCodec: Type<T>, | ||
typeCodec: Type<T, any, unknown>, | ||
value: unknown, | ||
@@ -69,0 +69,0 @@ description: string = 'type', |
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 too big to display
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
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
875489
10523