@voxgig/struct 0.1.0 → 0.2.0

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.
@@ -48,9 +48,9 @@ declare function ismap(val: any): val is {
48
48
  declare function islist(val: any): val is any[];
49
49
  declare function iskey(key: any): key is PropKey;
50
50
  declare function isempty(val: any): boolean;
51
- declare function isfunc(val: any): val is Function;
51
+ declare function isfunc(val: any): val is (...args: any[]) => any;
52
52
  declare function size(val: any): number;
53
- declare function slice<V extends any>(val: V, start?: number, end?: number, mutate?: boolean): V;
53
+ declare function slice<V>(val: V, start?: number, end?: number, mutate?: boolean): V;
54
54
  declare function pad(str: any, padding?: number, padchar?: string): string;
55
55
  declare function typify(value: any): number;
56
56
  declare function getelem(val: any, key: any, alt?: any): any;
@@ -63,7 +63,13 @@ declare function items<T>(val: any, apply: (item: [string, any]) => T): T[];
63
63
  declare function flatten(list: any[], depth?: number): any[];
64
64
  declare function filter(val: any, check: (item: [string, any]) => boolean): any[];
65
65
  declare function escre(s: string): string;
66
+ declare function re_escape(s: string): string;
66
67
  declare function escurl(s: string): string;
68
+ declare function re_compile(pattern: string | RegExp, flags?: string): RegExp;
69
+ declare function re_find(pattern: string | RegExp, input: string): RegExpMatchArray | null;
70
+ declare function re_find_all(pattern: string | RegExp, input: string): RegExpMatchArray[];
71
+ declare function re_replace(pattern: string | RegExp, input: string, replacement: string | ((m: RegExpMatchArray) => string)): string;
72
+ declare function re_test(pattern: string | RegExp, input: string): boolean;
67
73
  declare function join(arr: any[], sep?: string, url?: boolean): string;
68
74
  declare function jsonify(val: any, flags?: {
69
75
  indent?: number;
@@ -183,5 +189,5 @@ declare class StructUtility {
183
189
  injectorArgs: typeof injectorArgs;
184
190
  injectChild: typeof injectChild;
185
191
  }
186
- export { StructUtility, clone, delprop, escre, escurl, filter, flatten, getdef, getelem, getpath, getprop, haskey, inject, isempty, isfunc, iskey, islist, ismap, isnode, items, join, jsonify, keysof, merge, pad, pathify, select, setpath, setprop, size, slice, strkey, stringify, transform, typify, typename, validate, walk, SKIP, DELETE, jm, jt, T_any, T_noval, T_boolean, T_decimal, T_integer, T_number, T_string, T_function, T_symbol, T_null, T_list, T_map, T_instance, T_scalar, T_node, M_KEYPRE, M_KEYPOST, M_VAL, MODENAME, checkPlacement, injectorArgs, injectChild, };
192
+ export { StructUtility, clone, delprop, escre, escurl, filter, flatten, getdef, getelem, getpath, getprop, haskey, inject, isempty, isfunc, iskey, islist, ismap, isnode, items, join, jsonify, keysof, merge, pad, pathify, select, setpath, setprop, size, slice, strkey, stringify, transform, typify, typename, validate, walk, re_compile, re_find, re_find_all, re_replace, re_test, re_escape, SKIP, DELETE, jm, jt, T_any, T_noval, T_boolean, T_decimal, T_integer, T_number, T_string, T_function, T_symbol, T_null, T_list, T_map, T_instance, T_scalar, T_node, M_KEYPRE, M_KEYPOST, M_VAL, MODENAME, checkPlacement, injectorArgs, injectChild, };
187
193
  export type { Injection, Injector, WalkApply };