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

exa-js

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exa-js - npm Package Compare versions

Comparing version 1.0.15-beta.2 to 1.1.0

6

dist/index.d.ts

@@ -0,1 +1,2 @@

declare const isBeta = false;
/**

@@ -63,2 +64,3 @@ * Search options for performing a search query.

* @property {boolean} [filterEmptyResults] - If true, filters out results with no contents. Default is true.
* @property {number} [livecrawlTimeout] - The timeout for livecrawling.
*/

@@ -70,4 +72,6 @@ type ContentsOptions = {

livecrawl?: LivecrawlOptions;
livecrawlTimeout?: number;
} & (typeof isBeta extends true ? {
filterEmptyResults?: boolean;
};
} : {});
/**

@@ -74,0 +78,0 @@ * Options for livecrawling contents

45

dist/index.js

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

"Content-Type": "application/json",
"User-Agent": "exa-node 1.0.27"
"User-Agent": "exa-node 1.1.0"
});

@@ -97,18 +97,13 @@ }

async searchAndContents(query, options) {
const {
text,
highlights,
summary,
livecrawl,
filterEmptyResults,
...rest
} = options || {};
const isBeta = process.env.NPM_CONFIG_TAG === "beta";
const { text, highlights, summary, ...rest } = options || {};
return await this.request("/search", "POST", {
query,
contents: !text && !highlights && !summary ? { text: true, ...isBeta ? { livecrawl, filterEmptyResults } : {} } : {
contents: !text && !highlights && !summary ? {
text: true,
...options
} : {
...text ? { text } : {},
...highlights ? { highlights } : {},
...summary ? { summary } : {},
...isBeta ? { livecrawl, filterEmptyResults } : {}
...options
},

@@ -134,18 +129,17 @@ ...rest

async findSimilarAndContents(url, options) {
const {
text,
highlights,
summary,
livecrawl,
filterEmptyResults,
...rest
} = options || {};
const isBeta = process.env.NPM_CONFIG_TAG === "beta";
const { text, highlights, summary, ...rest } = options || {};
return await this.request("/findSimilar", "POST", {
url,
contents: !text && !highlights && !summary ? { text: true, ...isBeta ? { livecrawl, filterEmptyResults } : {} } : {
contents: !text && !highlights && !summary ? {
text: true,
livecrawl: options?.livecrawl,
livecrawlTimeout: options?.livecrawlTimeout,
...options
} : {
livecrawl: options?.livecrawl,
livecrawlTimeout: options?.livecrawlTimeout,
...text ? { text } : {},
...highlights ? { highlights } : {},
...summary ? { summary } : {},
...isBeta ? { livecrawl, filterEmptyResults } : {}
...options
},

@@ -162,4 +156,2 @@ ...rest

async getContents(ids, options) {
const { livecrawl, filterEmptyResults, ...rest } = options || {};
const isBeta = process.env.NPM_CONFIG_TAG === "beta";
if (ids.length === 0) {

@@ -178,4 +170,3 @@ throw new Error("Must provide at least one ID");

ids: requestIds,
...isBeta ? { livecrawl, filterEmptyResults } : {},
...rest
...options
});

@@ -182,0 +173,0 @@ }

{
"name": "exa-js",
"version": "1.0.15-beta.2",
"version": "1.1.0",
"description": "Exa SDK for Node.js and the browser",

@@ -5,0 +5,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

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