@bleedingdev/modern-js-code-tools 3.9.0-ultramodern.3 → 3.9.0-ultramodern.4
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.
|
@@ -260,6 +260,12 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
260
260
|
edge,
|
|
261
261
|
'effect'
|
|
262
262
|
];
|
|
263
|
+
const returned = (body)=>{
|
|
264
|
+
if (!types_namespaceObject.isBlockStatement(body)) return body;
|
|
265
|
+
const statements = body.body;
|
|
266
|
+
const last = statements.at(-1);
|
|
267
|
+
return statements.slice(0, -1).every((statement)=>types_namespaceObject.isVariableDeclaration(statement)) && types_namespaceObject.isReturnStatement(last) ? last.argument : void 0;
|
|
268
|
+
};
|
|
263
269
|
const pipe = (node, check)=>types_namespaceObject.isMemberExpression(node.callee) && !node.callee.computed && types_namespaceObject.isIdentifier(node.callee.property, {
|
|
264
270
|
name: 'pipe'
|
|
265
271
|
}) && check(node.callee.object) && node.arguments.every((argument)=>method(argument, 'Layer', 'orDie', layerSources) || types_namespaceObject.isCallExpression(argument) && method(argument.callee, 'Layer', 'provide', layerSources) && argument.arguments.length > 0);
|
|
@@ -268,7 +274,7 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
268
274
|
if (!types_namespaceObject.isArrowFunctionExpression(node) && !types_namespaceObject.isFunctionExpression(node)) return false;
|
|
269
275
|
const parameter = node.params[0];
|
|
270
276
|
if (!types_namespaceObject.isIdentifier(parameter)) return false;
|
|
271
|
-
const body =
|
|
277
|
+
const body = returned(node.body);
|
|
272
278
|
const chain = (value, count = 0)=>{
|
|
273
279
|
value = unwrap(value);
|
|
274
280
|
if (types_namespaceObject.isIdentifier(value)) return count > 0 && declaration(value) === parameter;
|
|
@@ -360,11 +366,9 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
360
366
|
}
|
|
361
367
|
const decl = declaration(node.callee);
|
|
362
368
|
const factory = decl && types_namespaceObject.isFunctionDeclaration(decl) ? decl : initialized(node.callee);
|
|
363
|
-
if (!factory || !types_namespaceObject.isFunctionDeclaration(factory) && !types_namespaceObject.isArrowFunctionExpression(factory) && !types_namespaceObject.isFunctionExpression(factory) ||
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
const last = statements.at(-1);
|
|
367
|
-
return statements.slice(0, -1).every((statement)=>types_namespaceObject.isVariableDeclaration(statement)) && !!last && types_namespaceObject.isReturnStatement(last) && !!last.argument && runtime(last.argument);
|
|
369
|
+
if (!factory || !types_namespaceObject.isFunctionDeclaration(factory) && !types_namespaceObject.isArrowFunctionExpression(factory) && !types_namespaceObject.isFunctionExpression(factory) || !factory.body) return false;
|
|
370
|
+
const result = returned(factory.body);
|
|
371
|
+
return !!result && runtime(result);
|
|
368
372
|
});
|
|
369
373
|
const root = entry.file.program.body.find((statement)=>types_namespaceObject.isExportDefaultDeclaration(statement));
|
|
370
374
|
return root && runtime(root.declaration) ? void 0 : failure;
|
|
@@ -215,6 +215,12 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
215
215
|
edge,
|
|
216
216
|
'effect'
|
|
217
217
|
];
|
|
218
|
+
const returned = (body)=>{
|
|
219
|
+
if (!__rspack_external__babel_types_6e8337dd.isBlockStatement(body)) return body;
|
|
220
|
+
const statements = body.body;
|
|
221
|
+
const last = statements.at(-1);
|
|
222
|
+
return statements.slice(0, -1).every((statement)=>__rspack_external__babel_types_6e8337dd.isVariableDeclaration(statement)) && __rspack_external__babel_types_6e8337dd.isReturnStatement(last) ? last.argument : void 0;
|
|
223
|
+
};
|
|
218
224
|
const pipe = (node, check)=>__rspack_external__babel_types_6e8337dd.isMemberExpression(node.callee) && !node.callee.computed && __rspack_external__babel_types_6e8337dd.isIdentifier(node.callee.property, {
|
|
219
225
|
name: 'pipe'
|
|
220
226
|
}) && check(node.callee.object) && node.arguments.every((argument)=>method(argument, 'Layer', 'orDie', layerSources) || __rspack_external__babel_types_6e8337dd.isCallExpression(argument) && method(argument.callee, 'Layer', 'provide', layerSources) && argument.arguments.length > 0);
|
|
@@ -223,7 +229,7 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
223
229
|
if (!__rspack_external__babel_types_6e8337dd.isArrowFunctionExpression(node) && !__rspack_external__babel_types_6e8337dd.isFunctionExpression(node)) return false;
|
|
224
230
|
const parameter = node.params[0];
|
|
225
231
|
if (!__rspack_external__babel_types_6e8337dd.isIdentifier(parameter)) return false;
|
|
226
|
-
const body =
|
|
232
|
+
const body = returned(node.body);
|
|
227
233
|
const chain = (value, count = 0)=>{
|
|
228
234
|
value = unwrap(value);
|
|
229
235
|
if (__rspack_external__babel_types_6e8337dd.isIdentifier(value)) return count > 0 && declaration(value) === parameter;
|
|
@@ -315,11 +321,9 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
315
321
|
}
|
|
316
322
|
const decl = declaration(node.callee);
|
|
317
323
|
const factory = decl && __rspack_external__babel_types_6e8337dd.isFunctionDeclaration(decl) ? decl : initialized(node.callee);
|
|
318
|
-
if (!factory || !__rspack_external__babel_types_6e8337dd.isFunctionDeclaration(factory) && !__rspack_external__babel_types_6e8337dd.isArrowFunctionExpression(factory) && !__rspack_external__babel_types_6e8337dd.isFunctionExpression(factory) ||
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const last = statements.at(-1);
|
|
322
|
-
return statements.slice(0, -1).every((statement)=>__rspack_external__babel_types_6e8337dd.isVariableDeclaration(statement)) && !!last && __rspack_external__babel_types_6e8337dd.isReturnStatement(last) && !!last.argument && runtime(last.argument);
|
|
324
|
+
if (!factory || !__rspack_external__babel_types_6e8337dd.isFunctionDeclaration(factory) && !__rspack_external__babel_types_6e8337dd.isArrowFunctionExpression(factory) && !__rspack_external__babel_types_6e8337dd.isFunctionExpression(factory) || !factory.body) return false;
|
|
325
|
+
const result = returned(factory.body);
|
|
326
|
+
return !!result && runtime(result);
|
|
323
327
|
});
|
|
324
328
|
const root = entry.file.program.body.find((statement)=>__rspack_external__babel_types_6e8337dd.isExportDefaultDeclaration(statement));
|
|
325
329
|
return root && runtime(root.declaration) ? void 0 : failure;
|
|
@@ -216,6 +216,12 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
216
216
|
edge,
|
|
217
217
|
'effect'
|
|
218
218
|
];
|
|
219
|
+
const returned = (body)=>{
|
|
220
|
+
if (!__rspack_external__babel_types_6e8337dd.isBlockStatement(body)) return body;
|
|
221
|
+
const statements = body.body;
|
|
222
|
+
const last = statements.at(-1);
|
|
223
|
+
return statements.slice(0, -1).every((statement)=>__rspack_external__babel_types_6e8337dd.isVariableDeclaration(statement)) && __rspack_external__babel_types_6e8337dd.isReturnStatement(last) ? last.argument : void 0;
|
|
224
|
+
};
|
|
219
225
|
const pipe = (node, check)=>__rspack_external__babel_types_6e8337dd.isMemberExpression(node.callee) && !node.callee.computed && __rspack_external__babel_types_6e8337dd.isIdentifier(node.callee.property, {
|
|
220
226
|
name: 'pipe'
|
|
221
227
|
}) && check(node.callee.object) && node.arguments.every((argument)=>method(argument, 'Layer', 'orDie', layerSources) || __rspack_external__babel_types_6e8337dd.isCallExpression(argument) && method(argument.callee, 'Layer', 'provide', layerSources) && argument.arguments.length > 0);
|
|
@@ -224,7 +230,7 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
224
230
|
if (!__rspack_external__babel_types_6e8337dd.isArrowFunctionExpression(node) && !__rspack_external__babel_types_6e8337dd.isFunctionExpression(node)) return false;
|
|
225
231
|
const parameter = node.params[0];
|
|
226
232
|
if (!__rspack_external__babel_types_6e8337dd.isIdentifier(parameter)) return false;
|
|
227
|
-
const body =
|
|
233
|
+
const body = returned(node.body);
|
|
228
234
|
const chain = (value, count = 0)=>{
|
|
229
235
|
value = unwrap(value);
|
|
230
236
|
if (__rspack_external__babel_types_6e8337dd.isIdentifier(value)) return count > 0 && declaration(value) === parameter;
|
|
@@ -316,11 +322,9 @@ function strictEffectRuntimeTopologyViolation(source, resolveImport) {
|
|
|
316
322
|
}
|
|
317
323
|
const decl = declaration(node.callee);
|
|
318
324
|
const factory = decl && __rspack_external__babel_types_6e8337dd.isFunctionDeclaration(decl) ? decl : initialized(node.callee);
|
|
319
|
-
if (!factory || !__rspack_external__babel_types_6e8337dd.isFunctionDeclaration(factory) && !__rspack_external__babel_types_6e8337dd.isArrowFunctionExpression(factory) && !__rspack_external__babel_types_6e8337dd.isFunctionExpression(factory) ||
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
const last = statements.at(-1);
|
|
323
|
-
return statements.slice(0, -1).every((statement)=>__rspack_external__babel_types_6e8337dd.isVariableDeclaration(statement)) && !!last && __rspack_external__babel_types_6e8337dd.isReturnStatement(last) && !!last.argument && runtime(last.argument);
|
|
325
|
+
if (!factory || !__rspack_external__babel_types_6e8337dd.isFunctionDeclaration(factory) && !__rspack_external__babel_types_6e8337dd.isArrowFunctionExpression(factory) && !__rspack_external__babel_types_6e8337dd.isFunctionExpression(factory) || !factory.body) return false;
|
|
326
|
+
const result = returned(factory.body);
|
|
327
|
+
return !!result && runtime(result);
|
|
324
328
|
});
|
|
325
329
|
const root = entry.file.program.body.find((statement)=>__rspack_external__babel_types_6e8337dd.isExportDefaultDeclaration(statement));
|
|
326
330
|
return root && runtime(root.declaration) ? void 0 : failure;
|