@nxtedition/lib 23.17.12 → 23.17.13
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/package.json
CHANGED
|
@@ -34,3 +34,19 @@ test('pipe short-circuit', async () => {
|
|
|
34
34
|
undefined,
|
|
35
35
|
)
|
|
36
36
|
})
|
|
37
|
+
|
|
38
|
+
test('return function', async () => {
|
|
39
|
+
const compiler = makeTemplateCompiler({
|
|
40
|
+
ds: {},
|
|
41
|
+
logger: console,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
assert.strictEqual(
|
|
45
|
+
(
|
|
46
|
+
await compiler.resolveTemplate(`{{#js (input) => fp.toUpper($.foo + input) }}`, {
|
|
47
|
+
foo: 'bar',
|
|
48
|
+
})
|
|
49
|
+
)('baz'),
|
|
50
|
+
'BARBAZ',
|
|
51
|
+
)
|
|
52
|
+
})
|
|
@@ -644,6 +644,15 @@ export default function ({ ds, proxify, compiler, logger, platform }) {
|
|
|
644
644
|
|
|
645
645
|
return value
|
|
646
646
|
};
|
|
647
|
+
|
|
648
|
+
const fp = globalThis.fp
|
|
649
|
+
const moment = globalThis.moment
|
|
650
|
+
const Timecode = globalThis.Timecode
|
|
651
|
+
const datefns = globalThis.datefns
|
|
652
|
+
const JSON5 = globalThis.JSON5
|
|
653
|
+
const $ = globalThis.$
|
|
654
|
+
const nxt = globalThis.nxt
|
|
655
|
+
|
|
647
656
|
_.asset = (type, state, suspend) => (name) => nxt._asset(name, type, state, suspend);
|
|
648
657
|
_.ds = (postfix, state, suspend) => (name) => nxt._ds(name, postfix, state, suspend);
|
|
649
658
|
_.get = (postfix, path, state, suspend) => (name) => nxt._get(name, postfix, path, state, suspend);
|