@daytona/lds-parser
Advanced tools
+17
-17
@@ -68,6 +68,6 @@ var path = require('path'); | ||
| function parseComponent(name, tree, options) { | ||
| let isComponent = false; | ||
| const isTemplate = new RegExp(`\.${options.config.engine.ext}$`); | ||
| const children = {}; | ||
| const templates = []; | ||
| var isComponent = false; | ||
| var isTemplate = new RegExp(`\.${options.config.engine.ext}$`); | ||
| var children = {}; | ||
| var templates = []; | ||
@@ -77,3 +77,3 @@ Object.keys(tree).forEach((fileName) => { | ||
| if (typeof tree[fileName] === 'object') { | ||
| let child = parseComponent(fileName, tree[fileName], Object.assign({}, options, { | ||
| var child = parseComponent(fileName, tree[fileName], Object.assign({}, options, { | ||
| partialName: `${options.category}:${name}/${fileName}`, | ||
@@ -132,12 +132,12 @@ group: `${options.group}/${name}`, | ||
| const directoryComponents = {}; | ||
| const componentsTree = trace(directory); | ||
| var directoryComponents = {}; | ||
| var componentsTree = trace(directory); | ||
| Object.keys(componentsTree).forEach((name) => { | ||
| let fileStat = fs.statSync(path.join(directory, name)); | ||
| var fileStat = fs.statSync(path.join(directory, name)); | ||
| if (fileStat.isFile()) { | ||
| return false; | ||
| } | ||
| const tree = componentsTree[name]; | ||
| const component = parseComponent(name, tree, Object.assign(options, {path: path.join(directory, name)})); | ||
| var tree = componentsTree[name]; | ||
| var component = parseComponent(name, tree, Object.assign(options, {path: path.join(directory, name)})); | ||
| if (component) { | ||
@@ -187,10 +187,10 @@ directoryComponents[name] = component; | ||
| function parseCSS(component, structure) { | ||
| const variables = {}; | ||
| const modifiers = []; | ||
| var variables = {}; | ||
| var modifiers = []; | ||
| postcss.parse(component.styles) | ||
| .nodes.forEach((node) => { | ||
| const isModifier = node.type === 'rule' && node.selector.match(new RegExp(`${component.name}--([^ :]*)`, 'i')); | ||
| const isRoot = node.selector === ':root' && typeof node.nodes === 'object'; | ||
| const isImport = node.type === 'atrule' && node.name === 'import'; | ||
| var isModifier = node.type === 'rule' && node.selector.match(new RegExp(`${component.name}--([^ :]*)`, 'i')); | ||
| var isRoot = node.selector === ':root' && typeof node.nodes === 'object'; | ||
| var isImport = node.type === 'atrule' && node.name === 'import'; | ||
@@ -225,4 +225,4 @@ if (isRoot) { | ||
| function parseJS(component, structure) { | ||
| const dependencies = []; | ||
| const varStatements = component.script.match(/import ([^ ]* from )?["']([^"']*)["']/g); | ||
| var dependencies = []; | ||
| var varStatements = component.script.match(/import ([^ ]* from )?["']([^"']*)["']/g); | ||
@@ -229,0 +229,0 @@ if (varStatements) { |
+1
-1
| { | ||
| "name": "@daytona/lds-parser", | ||
| "version": "0.1.4", | ||
| "version": "0.2.0", | ||
| "description": "Parse LDS structure and return indexable object", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
13052
-0.21%