crosslightning-server-base
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -25,7 +25,7 @@ import * as BN from "bn.js"; | ||
}>; | ||
export declare function dictionaryParserWithKeys<K extends string, T>(parser: ConfigParser<T>, keys: K[], validator?: (data: { | ||
[key in K]: T; | ||
export declare function dictionaryParserWithKeys<K extends string[], T>(parser: ConfigParser<T>, keys: K, validator?: (data: { | ||
[key in K[number]]: T; | ||
}) => void, optional?: boolean): ConfigParser<{ | ||
[key in K]: T; | ||
[key in K[number]]: T; | ||
}>; | ||
export declare function parseConfig<V, T extends ConfigTemplate<V>>(data: any, template: T): ParsedConfig<V, T>; |
{ | ||
"name": "crosslightning-server-base", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Base for server-side crosslightning, features command & config parser", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -107,3 +107,3 @@ import * as BN from "bn.js"; | ||
export function objectParser<T, V extends ConfigTemplate<T>>(template: V, validator?: (data: ParsedConfig<T, V>) => void, optional?: boolean): ConfigParser<ParsedConfig<T, V>>{ | ||
export function objectParser<T, V extends ConfigTemplate<T>>(template: V, validator?: (data: ParsedConfig<T, V>) => void, optional?: boolean): ConfigParser<ParsedConfig<T, V>> { | ||
return (data: any) => { | ||
@@ -172,3 +172,3 @@ if(data==null) { | ||
export function dictionaryParserWithKeys<K extends string, T>(parser: ConfigParser<T>, keys: K[], validator?: (data: {[key in K]: T}) => void, optional?: boolean): ConfigParser<{[key in K]: T}>{ | ||
export function dictionaryParserWithKeys<K extends string[], T>(parser: ConfigParser<T>, keys: K, validator?: (data: {[key in K[number]]: T}) => void, optional?: boolean): ConfigParser<{[key in K[number]]: T}>{ | ||
return (data: any) => { | ||
@@ -175,0 +175,0 @@ if(data==null) { |
53343