funcity 1.2.0 → 1.3.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/README.md +9 -1
- package/dist/index.cjs +481 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +88 -8
- package/dist/index.mjs +481 -147
- package/dist/index.mjs.map +1 -1
- package/dist/node.cjs +2 -2
- package/dist/node.d.ts +108 -3
- package/dist/node.mjs +2 -2
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -63,7 +63,11 @@ const script = "Today is {{cond weather.sunny ‘nice’ 'bad'}} weather.";
|
|
|
63
63
|
// Run the interpreter
|
|
64
64
|
const variables = buildCandidateVariables();
|
|
65
65
|
const logs: FunCityLogEntry[] = [];
|
|
66
|
-
const text = await runScriptOnceToText(script,
|
|
66
|
+
const text = await runScriptOnceToText(script, {
|
|
67
|
+
variables,
|
|
68
|
+
logs,
|
|
69
|
+
sourceId: 'hello.fc',
|
|
70
|
+
});
|
|
67
71
|
|
|
68
72
|
// Display the result text
|
|
69
73
|
console.log(text);
|
|
@@ -94,6 +98,8 @@ In other words, funcity is a processing system that brings the power of function
|
|
|
94
98
|
String literals can be wrapped in single quotes `'`, double quotes `"`, or backticks `` ` ``.
|
|
95
99
|
The opening and closing quote must match. Other quote characters can be used inside a string without escaping.
|
|
96
100
|
To use the same quote as the opener (or `\`) inside a string, escape it with a backslash.
|
|
101
|
+
You can also embed template blocks with `{{...}}` inside a quoted string.
|
|
102
|
+
Use `\{` and `\}` to output literal braces.
|
|
97
103
|
|
|
98
104
|
Supported escape sequences:
|
|
99
105
|
|
|
@@ -106,6 +112,8 @@ Supported escape sequences:
|
|
|
106
112
|
- `\'` single quote
|
|
107
113
|
- `\"` double quote
|
|
108
114
|
- ``\``` backtick
|
|
115
|
+
- `\{` left brace
|
|
116
|
+
- `\}` right brace
|
|
109
117
|
- `\\` backslash
|
|
110
118
|
|
|
111
119
|
---
|