@drifted/raven 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -4,7 +4,7 @@ const fs = require('fs');
4
4
 
5
5
  const ivLength = 16;
6
6
 
7
- class JSONDataFile {
7
+ class RavenDataFile {
8
8
  constructor(options={}) {
9
9
  Object.assign(this, options)
10
10
  if (this.data != undefined && typeof this.data == 'string') {
@@ -58,6 +58,7 @@ class JSONDataFile {
58
58
  } catch(error) {
59
59
  //console.log(error);
60
60
  }
61
+
61
62
  times = times + 1;
62
63
  }
63
64
 
@@ -215,7 +216,7 @@ class JSONDataFile {
215
216
  }
216
217
 
217
218
 
218
- module.exports = JSONDataFile;
219
+ module.exports = RavenDataFile;
219
220
 
220
221
 
221
222
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drifted/raven",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/driftless-group/raven",
6
6
  "bin": {
package/test/cli.test.js CHANGED
@@ -2,7 +2,7 @@ const path = require('path');
2
2
  const assert = require('assert');
3
3
  const fs = require('fs');
4
4
 
5
- const JSONDataFile = require(path.join(__dirname, '..'));
5
+ const RavenDataFile = require(path.join(__dirname, '..'));
6
6
  var { exec } = require('child_process');
7
7
 
8
8
  const {
@@ -82,7 +82,7 @@ describe('raven', function() {
82
82
 
83
83
  describe('files', function() {
84
84
  it('conceal/expose', function(done) {
85
- var secret = JSONDataFile.secret();
85
+ var secret = RavenDataFile.secret();
86
86
  var file = path.join(__dirname, 'theraven.txt');
87
87
  var initial = fs.readFileSync(file).toString();
88
88
 
@@ -101,7 +101,7 @@ describe('raven', function() {
101
101
  })
102
102
 
103
103
  it('repeatedly concealing/exposing', function(done) {
104
- var secret = JSONDataFile.secret();
104
+ var secret = RavenDataFile.secret();
105
105
  var file = path.join(__dirname, 'theraven.txt');
106
106
  var initial = fs.readFileSync(file).toString();
107
107
  run('conceal', '-f', file, '-s', secret).then(() => {
@@ -2,7 +2,7 @@ const path = require('path');
2
2
  const assert = require('assert');
3
3
  process.env.NODE_ENV = 'test';
4
4
 
5
- const JSONDataFile = require(path.join(__dirname, '..'));
5
+ const RavenDataFile = require(path.join(__dirname, '..'));
6
6
 
7
7
  var defaults = {
8
8
  secret: 'ffdnZY17Fw+sup2+lhOOt6PW++/RkLTXRaLL3RJsjzE='
@@ -30,7 +30,7 @@ describe('raven', function() {
30
30
  it('eval', function(done) {
31
31
 
32
32
  // this seems to work. i should write a test to make sure that it works
33
- JSONDataFile.eval({
33
+ RavenDataFile.eval({
34
34
  secret: defaults.secret,
35
35
  iterations: 2,
36
36
  file: path.join(__dirname, 'workspace', 'example.json.encrypted')
@@ -45,7 +45,7 @@ describe('raven', function() {
45
45
  })
46
46
 
47
47
  it('encrypt/decrypt', function(done) {
48
- var jdf = new JSONDataFile({secret: defaults.secret, data: {test: true}});
48
+ var jdf = new RavenDataFile({secret: defaults.secret, data: {test: true}});
49
49
  var result = jdf.encrypt(JSON.stringify(jdf.data));
50
50
  result = JSON.parse(jdf.decrypt(result));
51
51
  assert.equal(result.test, true);