From 44c6819c6200ae6e077620c8a4d4d41b24ffc054 Mon Sep 17 00:00:00 2001 From: "J. Harshbarger" Date: Fri, 23 Oct 2015 11:36:44 +0900 Subject: [PATCH] Option to output tsv file --- index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a012a44..24cea40 100755 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ var doc = [ '', 'Usage:', ' source-map-explorer []', -' source-map-explorer [--json | --html] [] [--replace=BEFORE --with=AFTER]... [--noroot]', +' source-map-explorer [--json | --html | --tsv] [] [--replace=BEFORE --with=AFTER]... [--noroot]', ' source-map-explorer -h | --help | --version', '', 'If the script file has an inline source map, you may omit the map parameter.', @@ -16,6 +16,8 @@ var doc = [ '', ' --json Output JSON (on stdout) instead of generating HTML', ' and opening the browser.', +' --tsv Output TSV (on stdout) instead of generating HTML', +' and opening the browser.', ' --html Output HTML (on stdout) rather than opening a browser.', '', ' --noroot To simplify the visualization, source-map-explorer', @@ -29,7 +31,6 @@ var doc = [ ' --with=AFTER See --replace.', ].join('\n'); - var fs = require('fs'), path = require('path'), sourcemap = require('source-map'), @@ -110,7 +111,7 @@ function loadSourceMap(jsFile, mapFile) { // See http://stackoverflow.com/a/1917041/388951 function commonPathPrefix(array){ if (array.length == 0) return ''; - var A= array.concat().sort(), + var A= array.concat().sort(), a1= A[0].split(/(\/)/), a2= A[A.length-1].split(/(\/)/), L= a1.length, i= 0; while(i