cli-table-2-json
Advanced tools
Comparing version 1.0.5 to 1.0.7
@@ -11,6 +11,6 @@ "use strict"; | ||
result2[title] = { | ||
start: headerline.indexOf(title), | ||
end: next_index < column_headers.length ? | ||
headerline.indexOf(column_headers[next_index++]) | ||
: headerline.indexOf(title) + 1000 | ||
: headerline.indexOf(title) + 1000, | ||
start: headerline.indexOf(title), | ||
}; | ||
@@ -17,0 +17,0 @@ return result2; |
"use strict"; | ||
var test = require('blue-tape'); | ||
var index_1 = require('./index'); | ||
var pkg = require('../package.json'); | ||
test('cli-table-2-json', function (t) { | ||
@@ -12,3 +11,23 @@ t.test('convert array of strings to array of objects', function (t) { | ||
'']; | ||
var expected = [{ active: '-', driver: 'amazonec2', name: 'consul1', state: 'Running', swarm: '', url: 'tcp://54.175.200.212:2376' }, { active: '-', driver: 'amazonec2', name: 'consul2', state: 'Running', swarm: '', url: 'tcp://52.23.236.38:2376' }, { active: '-', driver: 'amazonec2', name: 'consul3', state: 'Running', swarm: '', url: 'tcp://54.85.111.241:2376' }]; | ||
var expected = [{ | ||
active: '-', driver: 'amazonec2', | ||
name: 'consul1', | ||
state: 'Running', | ||
swarm: '', | ||
url: 'tcp://54.175.200.212:2376', | ||
}, { | ||
active: '-', | ||
driver: 'amazonec2', | ||
name: 'consul2', | ||
state: 'Running', | ||
swarm: '', | ||
url: 'tcp://52.23.236.38:2376', | ||
}, { | ||
active: '-', | ||
driver: 'amazonec2', | ||
name: 'consul3', | ||
state: 'Running', | ||
swarm: '', | ||
url: 'tcp://54.85.111.241:2376', | ||
}]; | ||
var result = index_1.cliTable2Json(lines); | ||
@@ -15,0 +34,0 @@ t.equal(result.length, expected.length); |
{ | ||
"name": "cli-table-2-json", | ||
"version": "1.0.5", | ||
"version": "1.0.7", | ||
"description": "Convert command line table output into json object", | ||
@@ -12,7 +12,8 @@ "main": "dist/index.ts", | ||
"scripts": { | ||
"lint": "tslint 'src/**/*.ts'", | ||
"lint": "tslint src/**/*.ts", | ||
"dependency-check": "dependency-check package.json", | ||
"build": "rimraf dist/ && tsc", | ||
"test-spec": "ts-node node_modules/blue-tape/bin/blue-tape.js \"src/**/*.spec.ts\" | tap-diff", | ||
"test": "npm run lint && npm run build && npm run dependency-check && npm run test-spec", | ||
"test": "npm run lint && npm run build && npm run test-spec", | ||
"testall": "npm run lint && npm run build && npm run dependency-check && npm run test-spec", | ||
"bootstrap": "npm install shelljs && node scripts/bootstrap.js" | ||
@@ -41,4 +42,3 @@ }, | ||
"ts-node": "^0.7.3", | ||
"tslint": "^3.10.2", | ||
"tslint-config-standard": "^1.2.1", | ||
"tslint": "^3.10.2", | ||
"typescript": "^1.8.10", | ||
@@ -45,0 +45,0 @@ "typings": "^1.0.4" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9268
10
80