@shwfed/nuxt 0.1.59 → 0.1.60
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/module.json
CHANGED
|
@@ -4,11 +4,6 @@ declare const _default: import("#app").Plugin<{
|
|
|
4
4
|
check: (template: {
|
|
5
5
|
raw: readonly string[] | ArrayLike<string>;
|
|
6
6
|
}, ...substitutions: any[]) => import("@marcbachmann/cel-js").TypeCheckResult;
|
|
7
|
-
/**
|
|
8
|
-
* Synchronous evaluation for render-time usage (e.g. table accessors).
|
|
9
|
-
*
|
|
10
|
-
* Will throw `TypeError` / `EvaluationError` on failure.
|
|
11
|
-
*/
|
|
12
7
|
evaluate: <T>(template: {
|
|
13
8
|
raw: readonly string[] | ArrayLike<string>;
|
|
14
9
|
}, ...substitutions: any[]) => (context?: Context) => T;
|
|
@@ -18,11 +13,6 @@ declare const _default: import("#app").Plugin<{
|
|
|
18
13
|
check: (template: {
|
|
19
14
|
raw: readonly string[] | ArrayLike<string>;
|
|
20
15
|
}, ...substitutions: any[]) => import("@marcbachmann/cel-js").TypeCheckResult;
|
|
21
|
-
/**
|
|
22
|
-
* Synchronous evaluation for render-time usage (e.g. table accessors).
|
|
23
|
-
*
|
|
24
|
-
* Will throw `TypeError` / `EvaluationError` on failure.
|
|
25
|
-
*/
|
|
26
16
|
evaluate: <T>(template: {
|
|
27
17
|
raw: readonly string[] | ArrayLike<string>;
|
|
28
18
|
}, ...substitutions: any[]) => (context?: Context) => T;
|
|
@@ -10,24 +10,30 @@ export default defineNuxtPlugin({
|
|
|
10
10
|
...config.ci,
|
|
11
11
|
build: config.ci.build !== void 0 ? BigInt(config.ci.build) : void 0
|
|
12
12
|
}).registerConstant("apis", "map<string, string>", config.apis);
|
|
13
|
+
const evaluate = (...args) => (context) => {
|
|
14
|
+
return env.evaluate(String.raw(...args), defu({}, getGlobalDslContext(), context, {
|
|
15
|
+
now: /* @__PURE__ */ new Date(),
|
|
16
|
+
today: /* @__PURE__ */ new Date(),
|
|
17
|
+
location: new URL(location.href)
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
if (import.meta.client) {
|
|
21
|
+
Object.assign(
|
|
22
|
+
window,
|
|
23
|
+
{
|
|
24
|
+
cel: {
|
|
25
|
+
evaluate
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
13
30
|
return {
|
|
14
31
|
provide: {
|
|
15
32
|
dsl: {
|
|
16
33
|
check: (...args) => {
|
|
17
34
|
return env.check(String.raw(...args));
|
|
18
35
|
},
|
|
19
|
-
|
|
20
|
-
* Synchronous evaluation for render-time usage (e.g. table accessors).
|
|
21
|
-
*
|
|
22
|
-
* Will throw `TypeError` / `EvaluationError` on failure.
|
|
23
|
-
*/
|
|
24
|
-
evaluate: (...args) => (context) => {
|
|
25
|
-
return env.evaluate(String.raw(...args), defu({}, getGlobalDslContext(), context, {
|
|
26
|
-
now: /* @__PURE__ */ new Date(),
|
|
27
|
-
today: /* @__PURE__ */ new Date(),
|
|
28
|
-
location: new URL(location.href)
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
36
|
+
evaluate
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
};
|