@trustme24/flext 1.3.4 → 1.4.1
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/LICENSE +1 -1
- package/dist/index.cjs +275 -304
- package/dist/index.d.ts +2 -0
- package/dist/index.js +24 -22
- package/dist/lib.d.ts +7 -0
- package/dist/modules/cond/index.d.ts +0 -2
- package/dist/modules/put/index.d.ts +1 -0
- package/package.json +14 -9
- package/dist/modules/logic/index.d.ts +0 -6
package/dist/lib.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AST } from '@handlebars/parser';
|
|
2
2
|
import { Theme as Wind4Theme } from '@unocss/preset-wind4';
|
|
3
3
|
import { Obj, Macro, MacroParam, DataModelNode, DataModel } from './types';
|
|
4
|
+
import striptags from 'striptags';
|
|
4
5
|
import Handlebars, { TemplateDelegate } from 'handlebars';
|
|
5
6
|
export declare const uno: Promise<import("unocss").UnoGenerator<Wind4Theme>>;
|
|
6
7
|
export type CollectorFilterHandler<T = any> = (val?: T) => boolean;
|
|
7
8
|
export declare const DEFAULT_MODEL_DEPTH = 10;
|
|
9
|
+
export declare const stripHtml: typeof striptags;
|
|
8
10
|
export declare class HandlebarsCollector<T = any> extends Handlebars.Visitor {
|
|
9
11
|
data: T[];
|
|
10
12
|
match: CollectorFilterHandler<T>;
|
|
@@ -32,7 +34,10 @@ export declare function getDataModel(ast: AST.Program): DataModel;
|
|
|
32
34
|
export declare function getMacroParam(val: string): MacroParam | null;
|
|
33
35
|
export declare function getMacroParams(val: string, doWarn?: boolean): MacroParam[];
|
|
34
36
|
export declare function getMacros(ast: AST.Program, doWarn?: boolean): Macro[];
|
|
37
|
+
export declare function getHtmlH1(ast: AST.Program, doWarn?: boolean): string[];
|
|
35
38
|
export declare function ensureDate(val: Date | string | number): Date;
|
|
39
|
+
export declare function ensureTitle(val: string | number): string;
|
|
40
|
+
export declare function filter(regex: RegExp, val: string | number): boolean;
|
|
36
41
|
export declare class RegexHelper {
|
|
37
42
|
static dbDateStr: RegExp;
|
|
38
43
|
static macro: RegExp;
|
|
@@ -40,7 +45,9 @@ export declare class RegexHelper {
|
|
|
40
45
|
static macroParam: RegExp;
|
|
41
46
|
static macroNamedParam: RegExp;
|
|
42
47
|
static macroSimpleParam: RegExp;
|
|
48
|
+
static htmlH1Somewhere: RegExp;
|
|
43
49
|
}
|
|
44
50
|
export declare class FilterHelper {
|
|
45
51
|
static macro(val: string): boolean;
|
|
52
|
+
static htmlH1Somewhere(val: string): boolean;
|
|
46
53
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export declare function op(state: any): boolean;
|
|
2
2
|
export declare function equal(state: any): boolean;
|
|
3
|
-
export declare function softEqual(state: any): boolean;
|
|
4
3
|
export declare function notEqual(state: any): boolean;
|
|
5
|
-
export declare function softNotEqual(state: any): boolean;
|
|
6
4
|
export declare function and(state: any): boolean;
|
|
7
5
|
export declare function or(state: any): boolean;
|
|
8
6
|
export declare function greater(state: any): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustme24/flext",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "A Powerful Templating Engine",
|
|
5
5
|
"keywords": ["templates", "templating engine", "modular templates", "handlebars"],
|
|
6
6
|
"type": "module",
|
|
@@ -15,11 +15,14 @@
|
|
|
15
15
|
"./index.css": "./dist/index.css"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
+
"start:test-app": "cd test/app && npm run test-app",
|
|
18
19
|
"build:types": "tsc && tsc-alias",
|
|
19
20
|
"build:css": "tailwindcss -i ./src/index.tail.css -o ./dist/index.css --minify",
|
|
20
|
-
"build": "bin/build.mjs && npm run build:types && npm run build:css",
|
|
21
|
-
"
|
|
22
|
-
"test
|
|
21
|
+
"build-only": "bin/build.mjs && npm run build:types && npm run build:css",
|
|
22
|
+
"build": "bun run build-only && vitest run",
|
|
23
|
+
"test:app": "npm run build && cd test/app && npm i && npm run test-app",
|
|
24
|
+
"test-only": "vitest run",
|
|
25
|
+
"test": "bun run bun run build-only && bun run test-only",
|
|
23
26
|
"prepare": "npm run build"
|
|
24
27
|
},
|
|
25
28
|
"files": [
|
|
@@ -34,17 +37,19 @@
|
|
|
34
37
|
"@babel/preset-typescript": "^7.27.1",
|
|
35
38
|
"@handlebars/parser": "^2.2.1",
|
|
36
39
|
"@tailwindcss/cli": "^4.1.14",
|
|
37
|
-
"@types/node": "^24.7.
|
|
38
|
-
"esbuild": "^0.25.
|
|
40
|
+
"@types/node": "^24.7.2",
|
|
41
|
+
"esbuild": "^0.25.11",
|
|
39
42
|
"esbuild-plugin-import-glob": "^0.1.1",
|
|
40
43
|
"tailwindcss": "^4.1.14",
|
|
41
44
|
"tsc-alias": "^1.8.16",
|
|
42
|
-
"typescript": "^5.9.3"
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"vitest": "^3.2.4"
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
45
|
-
"@unocss/preset-wind4": "^66.5.
|
|
49
|
+
"@unocss/preset-wind4": "^66.5.4",
|
|
46
50
|
"handlebars": "^4.7.8",
|
|
47
51
|
"luxon": "^3.7.2",
|
|
48
|
-
"
|
|
52
|
+
"striptags": "^3.2.0",
|
|
53
|
+
"unocss": "^66.5.4"
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function op(state: any): boolean;
|
|
2
|
-
export declare function switchHelper(state: any): any;
|
|
3
|
-
export declare function caseHelper(state: any): any;
|
|
4
|
-
export declare function defaultHelper(state: any): any;
|
|
5
|
-
declare const _default: any;
|
|
6
|
-
export default _default;
|