@putout/plugin-esm 9.10.0 → 9.11.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.
|
@@ -13,24 +13,19 @@ export const report = (path) => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const match = () => ({
|
|
16
|
-
'import __imports from "__a"':
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
return __a.value.endsWith('.json');
|
|
21
|
-
},
|
|
22
|
-
'import(__a)': ({__a}) => {
|
|
23
|
-
if (!isStringLiteral(__a))
|
|
24
|
-
return false;
|
|
25
|
-
|
|
26
|
-
return __a.value.endsWith('.json');
|
|
27
|
-
},
|
|
16
|
+
'import __imports from "__a"': isJSONSource,
|
|
17
|
+
'export __exports from "__a"': isJSONSource,
|
|
18
|
+
'export * from "__a"': isJSONSource,
|
|
19
|
+
'import(__a)': isJSONSource,
|
|
28
20
|
});
|
|
29
21
|
|
|
30
22
|
export const replace = () => ({
|
|
31
23
|
'import __imports from "__a"': `import __imports from "__a" with {
|
|
32
24
|
type: 'json',
|
|
33
25
|
}`,
|
|
26
|
+
'export * from "__a"': `export * from "__a" with {
|
|
27
|
+
type: 'json',
|
|
28
|
+
}`,
|
|
34
29
|
'export __exports from "__a"': `export __exports from "__a" with {
|
|
35
30
|
type: 'json',
|
|
36
31
|
}`,
|
|
@@ -40,3 +35,10 @@ export const replace = () => ({
|
|
|
40
35
|
}
|
|
41
36
|
})`,
|
|
42
37
|
});
|
|
38
|
+
|
|
39
|
+
function isJSONSource({__a}) {
|
|
40
|
+
if (!isStringLiteral(__a))
|
|
41
|
+
return false;
|
|
42
|
+
|
|
43
|
+
return __a.value.endsWith('.json');
|
|
44
|
+
}
|
package/package.json
CHANGED