Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grasp

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grasp - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

33

lib/index.js
// Generated by LiveScript 1.2.0
(function(){
var path, clc, acorn, squery, equery, async, ref$, min, sortWith, lines, chars, split, join, map, Obj, format, formatResult, formatName, formatCount, replace, getOptions, help, _console, VERSION, run, getQueryEngine, slice$ = [].slice, toString$ = {}.toString;
var path, acorn, squery, equery, async, ref$, min, sortWith, lines, chars, split, join, map, Obj, format, formatResult, formatName, formatCount, replace, getOptions, help, _console, VERSION, run, getQueryEngine, slice$ = [].slice, toString$ = {}.toString;
path = require('path');
clc = require('cli-color');
acorn = require('acorn');

@@ -16,5 +15,5 @@ squery = require('grasp-squery');

_console = console;
VERSION = '0.2.0';
VERSION = '0.2.1';
run = function(arg$){
var ref$, args, error, ref1$, callback, exit, data, stdin, fs, input, console, options, positional, generateHelp, generateHelpForOption, e, debug, versionString, getHelp, helpString, queryEngine, parser, parserOptions, that, selector, targets, targetsLen, replacement, isDir, color, bold, textFormatFuncs, resultsData, resultsFormat, callCallback, out, parsedSelector, resultsSortFunc, search, processResults, getToMap, end, extTestRegex, testExt, targetPaths, searchTarget, cwd;
var ref$, args, error, ref1$, callback, exit, data, stdin, fs, textFormat, input, console, options, positional, generateHelp, generateHelpForOption, e, debug, versionString, getHelp, helpString, queryEngine, parser, parserOptions, that, selector, targets, targetsLen, replacement, isDir, color, bold, textFormatFuncs, resultsData, resultsFormat, callCallback, out, parsedSelector, resultsSortFunc, search, processResults, getToMap, end, exts, testExt, targetPaths, searchTarget, cwd;
ref$ = arg$ != null

@@ -32,3 +31,5 @@ ? arg$

? ref1$
: require('fs'), input = ref$.input, console = (ref1$ = ref$.console) != null ? ref1$ : _console;
: require('fs'), textFormat = (ref1$ = ref$.textFormat) != null
? ref1$
: require('cli-color'), input = ref$.input, console = (ref1$ = ref$.console) != null ? ref1$ : _console;
if (args == null) {

@@ -153,8 +154,8 @@ error('Error: Must specify arguments.');

}, {
green: clc.green,
cyan: clc.cyan,
magenta: clc.magenta,
red: clc.red
green: textFormat.green,
cyan: textFormat.cyan,
magenta: textFormat.magenta,
red: textFormat.red
});
bold = clc.bold;
bold = textFormat.bold;
textFormatFuncs = {

@@ -334,6 +335,10 @@ color: color,

};
extTestRegex = RegExp('(?:' + options.extensions.join('|') + ')$');
testExt = function(filename){
return filename.match(extTestRegex);
};
exts = options.extensions;
testExt = exts.length === 0 || exts.length === 1 && exts[0] === '.'
? function(){
return true;
}
: function(it){
return it.match(RegExp('\\.(?:' + exts.join('|') + ')$'));
};
targetPaths = [];

@@ -340,0 +345,0 @@ searchTarget = function(basePath, upPath){

@@ -12,2 +12,3 @@ // Generated by LiveScript 1.2.0

: node.key != null && node.value != null ? input.slice(node.key.start, node.value.end) : '';
node.raw = raw;
return (node.rawPrepend || '') + "" + raw + (node.rawAppend || '');

@@ -165,3 +166,5 @@ };

processReplacement = function(replacement, input, node, queryEngine){
return replacement.replace(/\\n/g, '\n').replace(/{{}}/g, getRaw(input, node)).replace(/{{((?:[^}]|}[^}])+)}}/g, replacer(input, node, queryEngine));
return replacement.replace(/\\n/g, '\n').replace(/{{}}/g, function(){
return getRaw(input, node);
}).replace(/{{((?:[^}]|}[^}])+)}}/g, replacer(input, node, queryEngine));
};

@@ -200,7 +203,7 @@ replace = function(replacement, input, nodes, queryEngine){

lineOffset += replaceLines.length - numberOfLines;
colOffset = endLen - endCol;
colOffset += endLen - endCol;
lastLine = endLineNum + lineOffset;
prevNode = node;
}
return unlines(inputLines).replace(/\n$/, '');
return unlines(inputLines);
};

@@ -207,0 +210,0 @@ module.exports = {

{
"name": "grasp",
"author": "George Zahariev",
"version": "0.2.0",
"version": "0.2.1",
"homepage": "http://graspjs.com",

@@ -49,3 +49,3 @@ "description": "JavaScript structural search, replace, and refactor",

"optionator": "~0.1.1",
"grasp-squery": "~0.2.0",
"grasp-squery": "~0.2.1",
"grasp-equery": "~0.2.0",

@@ -52,0 +52,0 @@ "grasp-syntax-javascript": "~0.1.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc