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

groq-js

Package Overview
Dependencies
Maintainers
33
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

groq-js - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "groq-js",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Sanity.io <hello@sanity.io>",

@@ -11,5 +11,6 @@ import {ExprNode} from '../nodeTypes'

case 'Parameter':
return true
case 'Pos':
case 'Neg':
return true
return canConstantEvaluate(node.base)
case 'OpCall':

@@ -23,3 +24,3 @@ switch (node.op) {

case '**':
return true
return canConstantEvaluate(node.left) && canConstantEvaluate(node.right)
default:

@@ -41,22 +42,11 @@ return false

class ConstantEvaluateError extends Error {
name = 'ConstantEvaluateError'
}
export function tryConstantEvaluate(node: ExprNode): Value | null {
try {
return constantEvaluate(node)
} catch (err) {
if (err instanceof ConstantEvaluateError) {
return null
}
throw err
if (!canConstantEvaluate(node)) {
return null
}
return constantEvaluate(node)
}
function constantEvaluate(node: ExprNode): Value {
if (!canConstantEvaluate(node)) {
throw new ConstantEvaluateError('cannot constant evaluate')
}
const value = evaluate(node, DUMMY_SCOPE, constantEvaluate)

@@ -63,0 +53,0 @@ if ('then' in value) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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