@saykit/transform-js 0.9.1 → 0.10.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/parser.d.mts +11 -15
- package/package.json +2 -2
package/dist/parser.d.mts
CHANGED
|
@@ -10,10 +10,9 @@ declare function processExpression(expression: t.Node): [t.Expression, t.ObjectE
|
|
|
10
10
|
* value alone, so the wrapper never reaches the output: `${{ total: sum() }}`
|
|
11
11
|
* is `{total}` rather than `{0}`.
|
|
12
12
|
*
|
|
13
|
-
* An inline one-key object is the only shape this claims, and it
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* returned untouched and named the way it always was.
|
|
13
|
+
* An inline one-key object is the only shape this claims, and it could not mean
|
|
14
|
+
* anything else: interpolating an object stringifies it to `[object Object]`.
|
|
15
|
+
* Anything else is returned untouched.
|
|
17
16
|
*/
|
|
18
17
|
declare function unwrapPlaceholder(expression: t.Expression): [string | typeof AUTO_INCREMENT_IDENTIFIER, t.Expression];
|
|
19
18
|
/**
|
|
@@ -22,27 +21,24 @@ declare function unwrapPlaceholder(expression: t.Expression): [string | typeof A
|
|
|
22
21
|
*
|
|
23
22
|
* A value is compared whole: the same variable interpolated twice is one value,
|
|
24
23
|
* while `${name}` beside `${{ name: author.name }}` is two things claiming one
|
|
25
|
-
* name. An element is compared on its opening element alone
|
|
26
|
-
*
|
|
27
|
-
* translation rather than the source.
|
|
24
|
+
* name. An element is compared on its opening element alone, since its children
|
|
25
|
+
* come from the translation rather than the source.
|
|
28
26
|
*/
|
|
29
27
|
declare function isEquivalentPlaceholder(a: any, b: any): boolean;
|
|
30
28
|
declare function parseExpression(expression: t.Expression, fallback?: false): CompositeMessage | null;
|
|
31
29
|
declare function parseExpression(expression: t.Expression, fallback: true): CompositeMessage | ArgumentMessage;
|
|
32
30
|
/**
|
|
33
|
-
* The notes a translator is meant to read, taken from the comments
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* and stays there.
|
|
31
|
+
* The notes a translator is meant to read, taken from the comments above a
|
|
32
|
+
* message: `// TRANSLATORS: keep this under 20 characters`. A comment without
|
|
33
|
+
* the marker is a note to whoever is reading the code, and stays there.
|
|
37
34
|
*/
|
|
38
35
|
declare function getTranslatorComments(comments: readonly t.Comment[] | null | undefined): string[];
|
|
39
36
|
/**
|
|
40
37
|
* The comments written in front of a message, in the order they were written.
|
|
41
38
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* to the statement gathers them from wherever they landed.
|
|
39
|
+
* Babel attaches a comment on its own line to whatever node begins at it, so a
|
|
40
|
+
* message is rarely the node holding its own notes. Walking out to the
|
|
41
|
+
* statement gathers them from wherever they landed.
|
|
46
42
|
*/
|
|
47
43
|
declare function collectLeadingComments(path: NodePath<t.Node>): t.Comment[];
|
|
48
44
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saykit/transform-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "JavaScript and TypeScript transformer for SayKit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/parser": "^7.29.7",
|
|
48
48
|
"@babel/traverse": "^7.29.7",
|
|
49
49
|
"@babel/types": "^7.29.7",
|
|
50
|
-
"@saykit/config": "^0.
|
|
50
|
+
"@saykit/config": "^0.10.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/core": "^7.29.7",
|