lightning-flow-scanner-core
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
import{DefaultRuleStore}from"../store/DefaultRuleStore.js";import{RuleLoader}from"./RuleLoader.js";import*as p from"path";export class DynamicRule{constructor(className){if(DefaultRuleStore[className]===undefined||DefaultRuleStore[className]===null){const customRule=RuleLoader.loadCustomRule(className,p.join(__dirname,`../rules/${className}`));if(customRule){return customRule}throw new Error(`Rule '${className}' does not exist in the store.`)}return new DefaultRuleStore[className]}} | ||
import{DefaultRuleStore}from"../store/DefaultRuleStore.js";import{RuleLoader}from"./RuleLoader.js";import*as p from"path";export class DynamicRule{constructor(className){if(DefaultRuleStore[className]===undefined||DefaultRuleStore[className]===null){const customRule=RuleLoader.loadCustomRule(className,p.join(new URL(".",import.meta.url).pathname,`../rules/${className}`));if(customRule){return customRule}throw new Error(`Rule '${className}' does not exist in the store.`)}return new DefaultRuleStore[className]}} |
@@ -1,1 +0,1 @@ | ||
import*as p from"path";export class RuleLoader{static loadCustomRule(ruleName,filePath){try{const absolutePath=p.resolve(process.cwd(),filePath);const module=require(absolutePath);if(module[ruleName]&&typeof module[ruleName]==="function"){const customRuleInstance=new module[ruleName];return customRuleInstance}else{console.error(`Error: ${filePath} does not export ${ruleName} class.`);return undefined}}catch(error){console.error(`Error importing ${filePath}:`,error);return undefined}}} | ||
import*as p from"path";import importSync from"import-sync";export class RuleLoader{static loadCustomRule(ruleName,filePath){try{const absolutePath=p.resolve(process.cwd(),filePath);const module=importSync(absolutePath);if(module[ruleName]&&typeof module[ruleName]==="function"){const customRuleInstance=new module[ruleName];return customRuleInstance}else{console.error(`Error: ${filePath} does not export ${ruleName} class.`);return undefined}}catch(error){console.error(`Error importing ${filePath}:`,error);return undefined}}} |
{ | ||
"name": "lightning-flow-scanner-core", | ||
"version": "4.24.1", | ||
"version": "4.24.2", | ||
"main": "index.js", | ||
@@ -20,7 +20,9 @@ "types": "index.d.ts", | ||
"swc:build": "swc src --out-dir out", | ||
"swc:build:link": "npm run swc:build && npm run swc:cp:types && npm run swc:cp:files && npm link ./out/src", | ||
"swc:build:link": "npm run swc:build && npm run swc:cp:files && npm link ./out/src", | ||
"swc:build:bak:link": "npm run swc:build && npm run swc:cp:types && npm run swc:cp:files && npm link ./out/src", | ||
"swc:gen:types": "tsc -p tsconfig.types.json --declaration --emitDeclarationOnly", | ||
"swc:cp:types": "npm run swc:gen:types && cp -R ./types/* ./out/src", | ||
"swc:cp:files": "cp ./readme.md ./package*.json ./out/src && cp -R ./media ./out/src", | ||
"swc:sim:pack": "npm run swc:build && npm run swc:cp:files && npm run swc:cp:types", | ||
"swc:sim:bak:pack": "npm run swc:build && npm run swc:cp:files && npm run swc:cp:types", | ||
"swc:sim:pack": "npm run swc:build && npm run swc:cp:files", | ||
"postversion": "cp package.json ../.. && cp package-lock.json ../..", | ||
@@ -60,4 +62,5 @@ "clean": "rm -rf out dist types", | ||
"dependencies": { | ||
"import-sync": "^2.2.3", | ||
"xmlbuilder2": "^3.1.1" | ||
} | ||
} |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
3
-25%129039
-10.43%2
100%57
-48.18%0
-100%3
200%+ Added
+ Added
+ Added