@filecoin-saturn/js-client
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "@filecoin-saturn/js-client", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Filecoin Saturn Client", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/filecoin-saturn/js-client", |
@@ -8,2 +8,3 @@ import { CID } from 'multiformats' | ||
import { getJWT } from './utils/jwt.js' | ||
import { isBrowserContext } from './utils/runtime.js' | ||
@@ -38,4 +39,4 @@ export class Saturn { | ||
this.reportingLogs = process?.env?.NODE_ENV !== 'development' | ||
this.hasPerformanceAPI = typeof window !== 'undefined' && window?.performance | ||
this.isBrowser = typeof window !== 'undefined' | ||
this.hasPerformanceAPI = isBrowserContext && self?.performance | ||
if (this.reportingLogs && this.hasPerformanceAPI) { | ||
@@ -74,3 +75,3 @@ this._monitorPerformanceBuffer() | ||
if (!this.isBrowser) { | ||
if (!isBrowserContext) { | ||
options.headers = { | ||
@@ -179,3 +180,3 @@ ...(options.headers || {}), | ||
if (this.isBrowser) { | ||
if (isBrowserContext) { | ||
url.searchParams.set('jwt', opts.jwt) | ||
@@ -182,0 +183,0 @@ } |
@@ -14,3 +14,3 @@ // @ts-check | ||
export function indexedDbStorage () { | ||
const indexedDbExists = (typeof window !== 'undefined') && window?.indexedDB | ||
const indexedDbExists = (typeof self !== 'undefined') && self?.indexedDB | ||
let dbPromise | ||
@@ -17,0 +17,0 @@ if (indexedDbExists) { |
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
435386
21
538
2
3
7