file-obj-queue 0.0.3 → 1.0.1

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/README.md CHANGED
@@ -2,8 +2,10 @@ An array of objects containing file path information. One use is for dynamically
2
2
 
3
3
  Installation
4
4
  ---------
5
+ [![npm Package](https://img.shields.io/npm/v/file-obj-queue.svg)](https://www.npmjs.org/package/file-obj-queue)
6
+ [![License](https://img.shields.io/npm/l/file-obj-queue.svg)](https://github.com/jman717/file-obj-queue/blob/master/LICENSE)
5
7
 
6
- [![NPM](https://nodei.co/npm/file-queue.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/file-queue/)
8
+ [![NPM](https://nodei.co/npm/file-obj-queue.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/file-obj-queue/)
7
9
 
8
10
  Mocha Test
9
11
  ---------
package/app.js CHANGED
@@ -5,7 +5,8 @@
5
5
 
6
6
  var colors = require('colors'),
7
7
  queue = require("queuejson"),
8
- fs = require('fs');
8
+ fs = require('fs'),
9
+ validPath = require('valid-path')
9
10
 
10
11
  class file_obj {
11
12
  constructor(props) {
@@ -28,11 +29,18 @@ class file_obj {
28
29
  }
29
30
 
30
31
  do_checks() {
31
- let t = this,
32
+ let t = this, path_to_check,
32
33
  last_item = t.absolute_path.split("\\").pop(),
33
34
  check_file = t.absolute_path.split(last_item)[0], check_path = t.path.split('/')
34
35
 
35
36
  check_file = check_file.replace(/\\/g, "/");
37
+ path_to_check = validPath(t.path);
38
+
39
+ if (!path_to_check.valid) {
40
+ t.errors = true
41
+ t.error_msg = `id = ${t.id} name(${t.name}) Error in ${path_to_check.data.input}: ${path_to_check.error})`
42
+ }
43
+
36
44
  check_path.map((dat, i) => {
37
45
  if (/^[a-zA-Z._]+$/.test(dat)) {
38
46
  if (dat != '.')
@@ -64,9 +72,6 @@ exports = module.exports = class FilesQueue {
64
72
  constructor() {
65
73
  try {
66
74
  var t = this
67
- // t.id = 0
68
- // t.appenders_dir = './lib/appenders/'
69
- // t.props = {}
70
75
  t.logMsg = t.logMsg.bind(t)
71
76
  t.init = t.init.bind(t)
72
77
  t.getFileObject = t.getFileObject.bind(t)
package/package.json CHANGED
@@ -2,15 +2,16 @@
2
2
  "author": {
3
3
  "name": "Jim Manton"
4
4
  },
5
- "version": "0.0.3",
6
- "bundleDependencies": false,
5
+ "version": "1.0.1",
6
+ "bundleDependencies": [],
7
7
  "dependencies": {
8
8
  "chai": "^4.3.7",
9
- "node-console-colors": "^1.1.4",
10
- "queuejson": "^8.3.1",
11
9
  "diffler": "^2.0.4",
12
10
  "fs": "^0.0.1-security",
13
- "mocha": "^10.2.0"
11
+ "mocha": "^10.2.0",
12
+ "node-console-colors": "^1.1.4",
13
+ "queuejson": "^8.3.1",
14
+ "valid-path": "^2.1.0"
14
15
  },
15
16
  "scripts": {
16
17
  "start": "node app.ts",
package/test/app.js CHANGED
@@ -23,7 +23,6 @@ describe('app', function () {
23
23
 
24
24
  describe('require', function () {
25
25
 
26
-
27
26
  it('colors app', function () {
28
27
  assert(require('colors'))
29
28
  })
@@ -35,4 +34,8 @@ describe('require', function () {
35
34
  it('fs', function () {
36
35
  assert(require('fs'))
37
36
  })
37
+
38
+ it('valid-path', function () {
39
+ assert(require('valid-path'))
40
+ })
38
41
  })
package/test/package.js CHANGED
@@ -6,15 +6,16 @@ const packageMock = {
6
6
  "author": {
7
7
  "name": "Jim Manton"
8
8
  },
9
- "version": "0.0.3",
10
- "bundleDependencies": false,
9
+ "version": "1.0.1",
10
+ "bundleDependencies": [],
11
11
  "dependencies": {
12
12
  "chai": "^4.3.7",
13
- "node-console-colors": "^1.1.4",
14
- "queuejson": "^8.3.1",
15
13
  "diffler": "^2.0.4",
16
14
  "fs": "^0.0.1-security",
17
- "mocha": "^10.2.0"
15
+ "mocha": "^10.2.0",
16
+ "node-console-colors": "^1.1.4",
17
+ "queuejson": "^8.3.1",
18
+ "valid-path": "^2.1.0"
18
19
  },
19
20
  "scripts": {
20
21
  "start": "node app.ts",