configparser
Advanced tools
+1
-1
| { | ||
| "name": "configparser", | ||
| "version": "0.3.9", | ||
| "version": "0.3.10", | ||
| "description": "A basic config parser language based off the Python ConfigParser module.", | ||
@@ -5,0 +5,0 @@ "main": "src/configparser.js", |
@@ -13,3 +13,3 @@ const util = require('util'); | ||
| */ | ||
| const SECTION = new RegExp(/\s*\[([^\]]+)]/); | ||
| const SECTION = new RegExp(/^\s*\[([^\]]+)]$/); | ||
@@ -21,3 +21,3 @@ /** | ||
| */ | ||
| const KEY = new RegExp(/\s*(.*?)\s*[=:]\s*(.*)/); | ||
| const KEY = new RegExp(/^\s*(.*?)\s*[=:]\s*(.*)$/); | ||
@@ -24,0 +24,0 @@ /** |
+11
-1
@@ -16,3 +16,4 @@ const expect = require('chai').expect; | ||
| 'permissive_section:headers%!?', | ||
| 'more_complex_interpolation' | ||
| 'more_complex_interpolation', | ||
| 'sec' | ||
| ]); | ||
@@ -24,2 +25,3 @@ }); | ||
| expect(config.hasSection('section4')).to.equal(false); | ||
| expect(config.hasSection('sec')).to.equal(true); | ||
| }); | ||
@@ -38,2 +40,3 @@ | ||
| expect(config.keys('im running out of ideas')).to.deep.equal(['anotherthing', 'otherthing']); | ||
| expect(config.keys('sec')).to.deep.equal(['key', 'test', '[wow]']); | ||
| }); | ||
@@ -46,2 +49,3 @@ | ||
| expect(config.hasKey('permissive_section:headers%!?', 'hello')).to.equal(true); | ||
| expect(config.hasKey('sec', 'key')).to.equal(true); | ||
| }); | ||
@@ -52,2 +56,3 @@ | ||
| expect(config.get('USER', 'username')).to.equal('user'); | ||
| expect(config.get('sec', 'key')).to.equal('[value]'); | ||
| }); | ||
@@ -74,2 +79,7 @@ | ||
| }); | ||
| expect(config.items('sec')).to.deep.equal({ | ||
| key: '[value]', | ||
| test: '[something 1234 hello]', | ||
| '[wow]': '[45]' | ||
| }); | ||
| }); | ||
@@ -76,0 +86,0 @@ |
@@ -38,2 +38,7 @@ [section1] | ||
| my_folder=documents | ||
| file=mytextfile.txt | ||
| file=mytextfile.txt | ||
| [sec] | ||
| key = [value] | ||
| test = [something 1234 hello] | ||
| [wow] = [45] |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
22956
2.33%483
2.11%