Socket
Socket
Sign inDemoInstall

@tanstack/query-core

Package Overview
Dependencies
Maintainers
2
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/query-core - npm Package Compare versions

Comparing version 5.24.1 to 5.24.2

4

build/legacy/query.js

@@ -236,3 +236,3 @@ import {

var _a2, _b2, _c2, _d2;
if (typeof data === "undefined") {
if (data === void 0) {
if (process.env.NODE_ENV !== "production") {

@@ -374,3 +374,3 @@ console.error(

const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
const hasData = typeof data !== "undefined";
const hasData = data !== void 0;
const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;

@@ -377,0 +377,0 @@ return {

@@ -95,3 +95,3 @@ import {

const data = functionalUpdate(updater, prevData);
if (typeof data === "undefined") {
if (data === void 0) {
return void 0;

@@ -175,3 +175,3 @@ }

const defaultedOptions = this.defaultQueryOptions(options);
if (typeof defaultedOptions.retry === "undefined") {
if (defaultedOptions.retry === void 0) {
defaultedOptions.retry = false;

@@ -255,9 +255,9 @@ }

}
if (typeof defaultedOptions.refetchOnReconnect === "undefined") {
if (defaultedOptions.refetchOnReconnect === void 0) {
defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
}
if (typeof defaultedOptions.throwOnError === "undefined") {
if (defaultedOptions.throwOnError === void 0) {
defaultedOptions.throwOnError = !!defaultedOptions.suspense;
}
if (typeof defaultedOptions.networkMode === "undefined" && defaultedOptions.persister) {
if (!defaultedOptions.networkMode && defaultedOptions.persister) {
defaultedOptions.networkMode = "offlineFirst";

@@ -264,0 +264,0 @@ }

@@ -99,3 +99,3 @@ import {

this.options = __privateGet(this, _client).defaultQueryOptions(options);
if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") {
if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean") {
throw new Error("Expected enabled to be a boolean");

@@ -206,3 +206,3 @@ }

}
if (options.select && typeof state.data !== "undefined") {
if (options.select && state.data !== void 0) {
if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) {

@@ -224,3 +224,3 @@ data = __privateGet(this, _selectResult);

}
if (typeof options.placeholderData !== "undefined" && typeof data === "undefined" && status === "pending") {
if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
let placeholderData;

@@ -234,3 +234,3 @@ if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {

) : options.placeholderData;
if (options.select && typeof placeholderData !== "undefined") {
if (options.select && placeholderData !== void 0) {
try {

@@ -244,3 +244,3 @@ placeholderData = options.select(placeholderData);

}
if (typeof placeholderData !== "undefined") {
if (placeholderData !== void 0) {
status = "success";

@@ -247,0 +247,0 @@ data = replaceData(

@@ -47,3 +47,3 @@ import "./chunk-2HYBKCYP.js";

}
if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) {
if (fetchStatus && fetchStatus !== query.state.fetchStatus) {
return false;

@@ -150,3 +150,3 @@ }

const ctor = o.constructor;
if (typeof ctor === "undefined") {
if (ctor === void 0) {
return true;

@@ -153,0 +153,0 @@ }

@@ -222,3 +222,3 @@ // src/query.ts

onSuccess: (data) => {
if (typeof data === "undefined") {
if (data === void 0) {
if (process.env.NODE_ENV !== "production") {

@@ -345,3 +345,3 @@ console.error(

const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
const hasData = typeof data !== "undefined";
const hasData = data !== void 0;
const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;

@@ -348,0 +348,0 @@ return {

@@ -85,3 +85,3 @@ // src/queryClient.ts

const data = functionalUpdate(updater, prevData);
if (typeof data === "undefined") {
if (data === void 0) {
return void 0;

@@ -164,3 +164,3 @@ }

const defaultedOptions = this.defaultQueryOptions(options);
if (typeof defaultedOptions.retry === "undefined") {
if (defaultedOptions.retry === void 0) {
defaultedOptions.retry = false;

@@ -244,9 +244,9 @@ }

}
if (typeof defaultedOptions.refetchOnReconnect === "undefined") {
if (defaultedOptions.refetchOnReconnect === void 0) {
defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
}
if (typeof defaultedOptions.throwOnError === "undefined") {
if (defaultedOptions.throwOnError === void 0) {
defaultedOptions.throwOnError = !!defaultedOptions.suspense;
}
if (typeof defaultedOptions.networkMode === "undefined" && defaultedOptions.persister) {
if (!defaultedOptions.networkMode && defaultedOptions.persister) {
defaultedOptions.networkMode = "offlineFirst";

@@ -253,0 +253,0 @@ }

@@ -82,3 +82,3 @@ // src/queryObserver.ts

this.options = this.#client.defaultQueryOptions(options);
if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") {
if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean") {
throw new Error("Expected enabled to be a boolean");

@@ -246,3 +246,3 @@ }

}
if (options.select && typeof state.data !== "undefined") {
if (options.select && state.data !== void 0) {
if (prevResult && state.data === prevResultState?.data && options.select === this.#selectFn) {

@@ -264,3 +264,3 @@ data = this.#selectResult;

}
if (typeof options.placeholderData !== "undefined" && typeof data === "undefined" && status === "pending") {
if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
let placeholderData;

@@ -274,3 +274,3 @@ if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {

) : options.placeholderData;
if (options.select && typeof placeholderData !== "undefined") {
if (options.select && placeholderData !== void 0) {
try {

@@ -284,3 +284,3 @@ placeholderData = options.select(placeholderData);

}
if (typeof placeholderData !== "undefined") {
if (placeholderData !== void 0) {
status = "success";

@@ -287,0 +287,0 @@ data = replaceData(

@@ -45,3 +45,3 @@ // src/utils.ts

}
if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) {
if (fetchStatus && fetchStatus !== query.state.fetchStatus) {
return false;

@@ -148,3 +148,3 @@ }

const ctor = o.constructor;
if (typeof ctor === "undefined") {
if (ctor === void 0) {
return true;

@@ -151,0 +151,0 @@ }

{
"name": "@tanstack/query-core",
"version": "5.24.1",
"version": "5.24.2",
"description": "The framework agnostic core that powers TanStack Query",

@@ -5,0 +5,0 @@ "author": "tannerlinsley",

@@ -473,3 +473,3 @@ import { noop, replaceData, timeUntilStale } from './utils'

onSuccess: (data) => {
if (typeof data === 'undefined') {
if (data === undefined) {
if (process.env.NODE_ENV !== 'production') {

@@ -625,3 +625,3 @@ console.error(

const hasData = typeof data !== 'undefined'
const hasData = data !== undefined

@@ -628,0 +628,0 @@ const initialDataUpdatedAt = hasData

@@ -183,3 +183,3 @@ import {

if (typeof data === 'undefined') {
if (data === undefined) {
return undefined

@@ -319,3 +319,3 @@ }

// https://github.com/tannerlinsley/react-query/issues/652
if (typeof defaultedOptions.retry === 'undefined') {
if (defaultedOptions.retry === undefined) {
defaultedOptions.retry = false

@@ -516,14 +516,11 @@ }

// dependent default values
if (typeof defaultedOptions.refetchOnReconnect === 'undefined') {
if (defaultedOptions.refetchOnReconnect === undefined) {
defaultedOptions.refetchOnReconnect =
defaultedOptions.networkMode !== 'always'
}
if (typeof defaultedOptions.throwOnError === 'undefined') {
if (defaultedOptions.throwOnError === undefined) {
defaultedOptions.throwOnError = !!defaultedOptions.suspense
}
if (
typeof defaultedOptions.networkMode === 'undefined' &&
defaultedOptions.persister
) {
if (!defaultedOptions.networkMode && defaultedOptions.persister) {
defaultedOptions.networkMode = 'offlineFirst'

@@ -530,0 +527,0 @@ }

@@ -150,3 +150,3 @@ import {

if (
typeof this.options.enabled !== 'undefined' &&
this.options.enabled !== undefined &&
typeof this.options.enabled !== 'boolean'

@@ -458,3 +458,3 @@ ) {

// Select data if needed
if (options.select && typeof state.data !== 'undefined') {
if (options.select && state.data !== undefined) {
// Memoize select result

@@ -486,4 +486,4 @@ if (

if (
typeof options.placeholderData !== 'undefined' &&
typeof data === 'undefined' &&
options.placeholderData !== undefined &&
data === undefined &&
status === 'pending'

@@ -509,3 +509,3 @@ ) {

: options.placeholderData
if (options.select && typeof placeholderData !== 'undefined') {
if (options.select && placeholderData !== undefined) {
try {

@@ -520,3 +520,3 @@ placeholderData = options.select(placeholderData)

if (typeof placeholderData !== 'undefined') {
if (placeholderData !== undefined) {
status = 'success'

@@ -523,0 +523,0 @@ data = replaceData(

@@ -125,6 +125,3 @@ import type { Mutation } from './mutation'

if (
typeof fetchStatus !== 'undefined' &&
fetchStatus !== query.state.fetchStatus
) {
if (fetchStatus && fetchStatus !== query.state.fetchStatus) {
return false

@@ -292,3 +289,3 @@ }

const ctor = o.constructor
if (typeof ctor === 'undefined') {
if (ctor === undefined) {
return true

@@ -295,0 +292,0 @@ }

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

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

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

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

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

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

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

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