@staticbolt/core 1.0.0-beta.5 → 1.0.0-beta.6
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/lib/plugins/index.mjs
CHANGED
|
@@ -5390,12 +5390,8 @@ function coreMarkdownPlugin(options = {}) {
|
|
|
5390
5390
|
|
|
5391
5391
|
//#endregion
|
|
5392
5392
|
//#region src/ast-utilities/babel-utils/parse-script-srouces.ts
|
|
5393
|
-
function parseScriptSources({ ast
|
|
5393
|
+
function parseScriptSources({ ast }) {
|
|
5394
5394
|
const result = [];
|
|
5395
|
-
const printFmtError = PrintFormattedError.create({
|
|
5396
|
-
function: parseScriptSources,
|
|
5397
|
-
filePath
|
|
5398
|
-
});
|
|
5399
5395
|
t.traverseFast(ast, (node) => {
|
|
5400
5396
|
if (t.isImportDeclaration(node)) {
|
|
5401
5397
|
if (!t.isStringLiteral(node.source)) return;
|
|
@@ -5469,10 +5465,7 @@ function parseScriptSources({ ast, filePath }) {
|
|
|
5469
5465
|
if (t.isNewExpression(node)) {
|
|
5470
5466
|
if (!t.isIdentifier(node.callee, { name: "URL" })) return;
|
|
5471
5467
|
const firstArgument = node.arguments[0];
|
|
5472
|
-
if (!t.isStringLiteral(firstArgument))
|
|
5473
|
-
printFmtError("The first argument of `URL` should be a string", { node });
|
|
5474
|
-
return;
|
|
5475
|
-
}
|
|
5468
|
+
if (!t.isStringLiteral(firstArgument)) return;
|
|
5476
5469
|
const setSource = (newValue) => {
|
|
5477
5470
|
node.arguments[0] = t.stringLiteral(newValue);
|
|
5478
5471
|
};
|