@trustme24/flext 1.7.3 → 1.8.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.
package/dist/lib.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AST } from '@handlebars/parser';
2
2
  import { Theme as Wind4Theme } from '@unocss/preset-wind4';
3
- import { Obj, Macro, MacroParam, DataModelNode, DataModel } from './types';
3
+ import { Obj, Macro, MacroParam, DataModelNode, DataModel, Isset, Inarr } from './types';
4
4
  import striptags from 'striptags';
5
5
  import Handlebars, { TemplateDelegate } from 'handlebars';
6
6
  export declare const uno: Promise<import("unocss").UnoGenerator<Wind4Theme>>;
@@ -19,7 +19,8 @@ export declare class HandlebarsCollector<T = any> extends Handlebars.Visitor {
19
19
  export declare function isNumber(val: any): boolean;
20
20
  export declare function isObject(val: any): boolean;
21
21
  export declare function has(obj: Obj, key: string): boolean;
22
- export declare function inarr(val: any, ...arr: any): boolean;
22
+ export declare function inarr<T extends any, A extends any[]>(val: T, ...arr: A): Inarr<T, A>;
23
+ export declare function isset<T extends any>(val: T): Isset<T>;
23
24
  export declare function audit(val: any): string;
24
25
  export declare function defineModule(options?: any): any;
25
26
  export declare function unique<T = any>(arr: T[]): T[];
@@ -40,6 +41,7 @@ export declare function ensureDate(val: Date | string | number): Date;
40
41
  export declare function ensureTitle(val: string | number): string;
41
42
  export declare function ensureFieldName(val: string): string;
42
43
  export declare function filter(regex: RegExp, val: string | number): boolean;
44
+ export declare function compare(a: number | null | undefined, b: number | null | undefined): number;
43
45
  export declare class RegexHelper {
44
46
  static dbDateStr: RegExp;
45
47
  static macro: RegExp;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export type Obj<T = any> = Record<string, T>;
1
+ export type Obj<T extends any = any> = Record<string, T>;
2
+ export type Inarr<T extends any, A extends any[]> = T extends A[any] ? true : false;
3
+ export type Isset<T extends any> = T extends null | undefined ? false : true;
2
4
  export type DataModelNode = {
3
5
  name: string;
4
6
  $?: DataModelNode[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustme24/flext",
3
- "version": "1.7.3",
3
+ "version": "1.8.0",
4
4
  "description": "A Powerful Templating Engine",
5
5
  "keywords": ["templates", "templating engine", "modular templates", "handlebars"],
6
6
  "type": "module",