@daytona/lds-parser
Advanced tools
+24
-2
@@ -94,3 +94,25 @@ var path = require('path'); | ||
| }); | ||
| var componentData; | ||
| var componentConfig; | ||
| if (tree['index.json'] || tree['default.json']) { | ||
| try { | ||
| var json = tree['index.json'] || tree['default.json']; | ||
| componentData = JSON.parse(json); | ||
| } catch (err) { | ||
| console.error('Invalid JSON data in component', encodeURI(`/${options.group}/${name}`)); | ||
| throw err; | ||
| } | ||
| } | ||
| if (tree['config.json']) { | ||
| try { | ||
| var json = tree['config.json']; | ||
| componentConfig = JSON.parse(json); | ||
| } catch (err) { | ||
| console.error('Invalid JSON config in component', encodeURI(`/${options.group}/${name}`)); | ||
| throw err; | ||
| } | ||
| } | ||
| var LDSObject = { | ||
@@ -104,6 +126,6 @@ id: encodeURI(`/${options.group}/${name}`), | ||
| example: tree['example.' + options.config.engine.ext], | ||
| data: (tree['index.json'] && JSON.parse(tree['index.json'])) || (tree['default.json'] && JSON.parse(tree['default.json'])), | ||
| data: componentData, | ||
| styles: tree['index.css'] || tree['index.scss'] || tree['index.less'] || tree['index.styl'], | ||
| script: tree['index.js'] || tree['index.jsx'], | ||
| config: tree['config.json'] && JSON.parse(tree['config.json']), | ||
| config: componentConfig, | ||
| screen: (tree['screen.png'] && path.join(options.path, 'screen.png') || | ||
@@ -110,0 +132,0 @@ tree['screen.jpg'] && path.join(options.path, 'screen.jpg') || |
+1
-1
| { | ||
| "name": "@daytona/lds-parser", | ||
| "version": "0.3.0", | ||
| "version": "0.3.1", | ||
| "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
13524
3.62%320
6.67%