| // TODO need to find a better way to test the 32bit/64bit specific scenarios | ||
| var index = require('../index') | ||
| var should = require('should') | ||
| describe('regedit', function () { | ||
| var baseKey = 'HKCU\\software\\ironSource\\regedit\\issues-test\\' | ||
| var key | ||
| // this test fails with a timeout because putValue callback is never invoked | ||
| it('putValue with empty string for value fails silently #8', function (done) { | ||
| index.createKey(key, function (err) { | ||
| if (err) return done(err) | ||
| var values = {} | ||
| values[key] = { 'valName': { value: '', type: 'REG_SZ' }} | ||
| index.putValue(values, function (err) { | ||
| if (err) return done(err) | ||
| index.list(key, function(err, results) { | ||
| if (err) return done(err) | ||
| results.should.have.property(key) | ||
| .which.have.property('values') | ||
| .which.have.property('valName') | ||
| .which.have.property('value', '') | ||
| done() | ||
| }) | ||
| }) | ||
| }) | ||
| }) | ||
| beforeEach(function () { | ||
| key = baseKey + Date.now() | ||
| }) | ||
| }) |
+14
-7
@@ -51,3 +51,3 @@ var util = require('util') | ||
| if (typeof callback === 'function') { | ||
| if (typeof callback === 'function') { | ||
| execute(toCommandArgs('regList.wsf', architecture, keys), callback) | ||
@@ -122,4 +122,4 @@ } else { | ||
| var values = [] | ||
| for (var key in map) { | ||
| for (var key in map) { | ||
| var keyValues = map[key] | ||
@@ -247,3 +247,4 @@ | ||
| handleErrorsAndClose(child, callback) | ||
| handleErrorsAndClose(child, callback) | ||
| helper.writeArrayToStream(keys, child.stdin) | ||
@@ -300,2 +301,8 @@ }) | ||
| case 'REG_SZ': | ||
| if (value === '') { | ||
| return '\0' | ||
| } | ||
| return value | ||
| default: | ||
@@ -309,8 +316,8 @@ return value | ||
| var result = baseCommand(cmd, arch) | ||
| if (typeof keys === 'string') { | ||
| if (typeof keys === 'string') { | ||
| result.push(keys) | ||
| } else if (util.isArray(keys)) { | ||
| } else if (util.isArray(keys)) { | ||
| result = result.concat(keys) | ||
| } else { | ||
| debug('creating command without using keys %s', keys ? keys : '') | ||
| debug('creating command without using keys %s', keys ? keys : '') | ||
| } | ||
@@ -317,0 +324,0 @@ |
+3
-1
@@ -20,3 +20,3 @@ var debug = require('debug')('regedit') | ||
| function write(m) { | ||
| if (m) { | ||
| if (m !== undefined) { | ||
| var b = module.exports.encode(m) | ||
@@ -26,2 +26,4 @@ debug(b) | ||
| } | ||
| return false | ||
| } | ||
@@ -28,0 +30,0 @@ |
+1
-1
| { | ||
| "name": "regedit", | ||
| "version": "2.2.4", | ||
| "version": "2.2.5", | ||
| "description": "Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
| var should = require('should') | ||
| var index = require('../index') | ||
| describe('benchmark test', function (done) { | ||
| describe.skip('benchmark test', function (done) { | ||
| this.timeout(40000) | ||
@@ -12,3 +12,3 @@ | ||
| it.only('create', function (done) { | ||
| it('create', function (done) { | ||
@@ -15,0 +15,0 @@ console.time('start create') |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary 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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary 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
165847
0.65%34
3.03%2312
1.54%