New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-jq

Package Overview
Dependencies
Maintainers
2
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-jq - npm Package Compare versions

Comparing version 2.3.5 to 3.0.0

src/__test__/fixtures/1.jsonl

3

lib/exec.js

@@ -20,3 +20,4 @@ "use strict";

maxBuffer: TEN_MEBIBYTE,
cwd: cwd
cwd: cwd,
env: {}
};

@@ -23,0 +24,0 @@ var process = _childProcess.default.spawn(command, args, spawnOptions);

@@ -17,3 +17,3 @@ "use strict";

var isJSONPath = function(path) {
return /\.json$/.test(path);
return /\.json|.jsonl$/.test(path);
};

@@ -20,0 +20,0 @@ exports.isJSONPath = isJSONPath;

{
"name": "node-jq",
"version": "2.3.5",
"version": "3.0.0",
"description": "Run jq in node",

@@ -25,3 +25,3 @@ "main": "lib/jq.js",

"engines": {
"npm": ">=6.0.0"
"node": ">=12"
},

@@ -28,0 +28,0 @@ "keywords": [

@@ -11,3 +11,3 @@ import childProcess from 'child_process'

const spawnOptions = { maxBuffer: TEN_MEBIBYTE, cwd }
const spawnOptions = { maxBuffer: TEN_MEBIBYTE, cwd, env: {} }

@@ -14,0 +14,0 @@ const process = childProcess.spawn(command, args, spawnOptions)

@@ -381,2 +381,21 @@ import { expect } from 'chai'

describe('inherited env var', () => {
it('process.env should not be sent in to jq execution', done => {
process.env.X_TEST_ENV_VAR = 'TEST_VALUE'
run('$ENV', PATH_JSON_FIXTURE, {
output: 'string'
})
.then(output => {
expect(output).to.be.a('string')
expect(output).to.not.contain('X_TEST_ENV_VAR')
done()
})
.catch(error => {
done(error)
}).finally(() => {
delete process.env.X_TEST_ENV_VAR
})
})
})
describe('raw: true', () => {

@@ -383,0 +402,0 @@ it('output should be able to output raw strings instead of JSON texts', done => {

@@ -9,3 +9,3 @@ import isPathValid from 'is-valid-path'

export const isJSONPath = (path) => {
return /\.json$/.test(path)
return /\.json|.jsonl$/.test(path)
}

@@ -12,0 +12,0 @@

@@ -8,2 +8,3 @@ import { expect } from 'chai'

const PATH_JS_FIXTURE = path.join(PATH_FIXTURES, '1.js')
const PATH_JSONL_FIXTURE = path.join(PATH_FIXTURES, '1.jsonl')

@@ -16,2 +17,6 @@ describe('utils', () => {

it('should return true when you give a json file', () => {
expect(isJSONPath(PATH_JSONL_FIXTURE)).to.equal(true)
})
it('should return false when you a non-json file', () => {

@@ -18,0 +23,0 @@ expect(isJSONPath(PATH_JS_FIXTURE)).to.equal(false)

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