Skip to content

Commit

Permalink
Release 0.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
brentlintner committed Oct 26, 2017
1 parent 17d0cbf commit 6ad0b7b
Show file tree
Hide file tree
Showing 5 changed files with 13,342 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/cli/file_collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
var fs = require("fs");
var path = require("path");
var _ = require("lodash");
var chalk = require("chalk");
var walk_sync = require("walk-sync");
var chalk = require("chalk");
var all_files = function (target) {
if (fs.statSync(target).isDirectory()) {
var dirs = walk_sync(target, { directories: false });
Expand Down
9 changes: 5 additions & 4 deletions lib/similar/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ var tokenize = function (code) {
return normalize(esprima.tokenize(code));
};
var astify = function (code, opts) {
return esprima.parse(code, {
loc: true,
sourceType: _.get(opts, "estype", "module")
});
var parse_opts = { loc: true };
var method = _.get(opts, "estype", "module");
return method == "script" ?
esprima.parseScript(code, parse_opts) :
esprima.parseModule(code, parse_opts);
};
var ast_to_code = function (node) {
var opts = { format: { indent: { style: " " } } };
Expand Down
2 changes: 1 addition & 1 deletion lib/similar/print.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
var _ = require("lodash");
var chalk = require("chalk");
var cardinal = require("cardinal");
var chalk = require("chalk");
var print = function (group, nocolors) {
_.each(group, function (results, sim) {
_.each(results, function (result) {
Expand Down
Loading

0 comments on commit 6ad0b7b

Please sign in to comment.