@xata.io/client
Advanced tools
Comparing version 0.0.0-alpha.cacc255 to 0.0.0-alpha.d63e473
@@ -20,2 +20,3 @@ "use strict"; | ||
exports.XataError = exports.BaseClient = exports.RestRespositoryFactory = exports.RestRepository = exports.Repository = exports.Query = exports.includesAll = exports.includesPattern = exports.includesSubstring = exports.includes = exports.contains = exports.isNot = exports.is = exports.pattern = exports.endsWith = exports.startsWith = exports.notExists = exports.exists = exports.le = exports.lte = exports.lt = exports.gte = exports.ge = exports.gt = void 0; | ||
const getFetch_1 = require("./util/getFetch"); | ||
const gt = (value) => ({ $gt: value }); | ||
@@ -170,21 +171,3 @@ exports.gt = gt; | ||
const { fetch } = client.options; | ||
if (fetch) { | ||
this.fetch = fetch; | ||
} | ||
else if (typeof window === 'object') { | ||
this.fetch = window.fetch; | ||
} | ||
else if (typeof require === 'function') { | ||
try { | ||
this.fetch = require('node-fetch'); | ||
} | ||
catch (err) { | ||
try { | ||
this.fetch = require('cross-fetch'); | ||
} | ||
catch (err) { | ||
throw new Error('No fetch implementation found. Please provide one in the constructor'); | ||
} | ||
} | ||
} | ||
this.fetch = fetch || (0, getFetch_1.getFetch)(); | ||
Object.defineProperty(this, 'client', { enumerable: false }); | ||
@@ -191,0 +174,0 @@ Object.defineProperty(this, 'fetch', { enumerable: false }); |
{ | ||
"name": "@xata.io/client", | ||
"version": "0.0.0-alpha.cacc255", | ||
"version": "0.0.0-alpha.d63e473", | ||
"description": "Xata.io SDK for TypeScript and JavaScript", | ||
@@ -23,3 +23,3 @@ "main": "./dist/index.js", | ||
"homepage": "https://github.com/xataio/client-ts/blob/main/client/README.md", | ||
"gitHead": "cacc2556b432011ad5b1c0f83fc5e0e5811cd004" | ||
"gitHead": "d63e473f3d4f5896d1709b640d6d88aa13829174" | ||
} |
@@ -0,1 +1,3 @@ | ||
import { getFetch } from './util/getFetch'; | ||
export interface XataRecord { | ||
@@ -284,19 +286,4 @@ id: string; | ||
const { fetch } = client.options; | ||
this.fetch = fetch || getFetch(); | ||
if (fetch) { | ||
this.fetch = fetch; | ||
} else if (typeof window === 'object') { | ||
this.fetch = window.fetch; | ||
} else if (typeof require === 'function') { | ||
try { | ||
this.fetch = require('node-fetch'); | ||
} catch (err) { | ||
try { | ||
this.fetch = require('cross-fetch'); | ||
} catch (err) { | ||
throw new Error('No fetch implementation found. Please provide one in the constructor'); | ||
} | ||
} | ||
} | ||
Object.defineProperty(this, 'client', { enumerable: false }); | ||
@@ -303,0 +290,0 @@ Object.defineProperty(this, 'fetch', { enumerable: false }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77632
16
1671
22
2