@vitest/pretty-format
Advanced tools
Comparing version 2.2.0-beta.1 to 2.2.0-beta.2
import styles from 'tinyrainbow'; | ||
function _mergeNamespaces(n, m) { | ||
m.forEach(function (e) { | ||
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { | ||
if (k !== 'default' && !(k in n)) { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { return e[k]; } | ||
}); | ||
} | ||
}); | ||
}); | ||
return Object.freeze(n); | ||
} | ||
function getKeysOfEnumerableProperties(object, compareKeys) { | ||
@@ -467,4 +482,8 @@ const rawKeys = Object.keys(object); | ||
var reactIs = {exports: {}}; | ||
function getDefaultExportFromCjs (x) { | ||
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; | ||
} | ||
var reactIs$1 = {exports: {}}; | ||
var reactIs_production_min = {}; | ||
@@ -495,3 +514,3 @@ | ||
var reactIs_development = {}; | ||
var reactIs_development$1 = {}; | ||
@@ -508,7 +527,7 @@ /** | ||
var hasRequiredReactIs_development; | ||
var hasRequiredReactIs_development$1; | ||
function requireReactIs_development () { | ||
if (hasRequiredReactIs_development) return reactIs_development; | ||
hasRequiredReactIs_development = 1; | ||
function requireReactIs_development$1 () { | ||
if (hasRequiredReactIs_development$1) return reactIs_development$1; | ||
hasRequiredReactIs_development$1 = 1; | ||
@@ -693,32 +712,335 @@ if (process.env.NODE_ENV !== "production") { | ||
reactIs_development.ContextConsumer = ContextConsumer; | ||
reactIs_development.ContextProvider = ContextProvider; | ||
reactIs_development.Element = Element; | ||
reactIs_development.ForwardRef = ForwardRef; | ||
reactIs_development.Fragment = Fragment; | ||
reactIs_development.Lazy = Lazy; | ||
reactIs_development.Memo = Memo; | ||
reactIs_development.Portal = Portal; | ||
reactIs_development.Profiler = Profiler; | ||
reactIs_development.StrictMode = StrictMode; | ||
reactIs_development.Suspense = Suspense; | ||
reactIs_development.SuspenseList = SuspenseList; | ||
reactIs_development.isAsyncMode = isAsyncMode; | ||
reactIs_development.isConcurrentMode = isConcurrentMode; | ||
reactIs_development.isContextConsumer = isContextConsumer; | ||
reactIs_development.isContextProvider = isContextProvider; | ||
reactIs_development.isElement = isElement; | ||
reactIs_development.isForwardRef = isForwardRef; | ||
reactIs_development.isFragment = isFragment; | ||
reactIs_development.isLazy = isLazy; | ||
reactIs_development.isMemo = isMemo; | ||
reactIs_development.isPortal = isPortal; | ||
reactIs_development.isProfiler = isProfiler; | ||
reactIs_development.isStrictMode = isStrictMode; | ||
reactIs_development.isSuspense = isSuspense; | ||
reactIs_development.isSuspenseList = isSuspenseList; | ||
reactIs_development.isValidElementType = isValidElementType; | ||
reactIs_development.typeOf = typeOf; | ||
reactIs_development$1.ContextConsumer = ContextConsumer; | ||
reactIs_development$1.ContextProvider = ContextProvider; | ||
reactIs_development$1.Element = Element; | ||
reactIs_development$1.ForwardRef = ForwardRef; | ||
reactIs_development$1.Fragment = Fragment; | ||
reactIs_development$1.Lazy = Lazy; | ||
reactIs_development$1.Memo = Memo; | ||
reactIs_development$1.Portal = Portal; | ||
reactIs_development$1.Profiler = Profiler; | ||
reactIs_development$1.StrictMode = StrictMode; | ||
reactIs_development$1.Suspense = Suspense; | ||
reactIs_development$1.SuspenseList = SuspenseList; | ||
reactIs_development$1.isAsyncMode = isAsyncMode; | ||
reactIs_development$1.isConcurrentMode = isConcurrentMode; | ||
reactIs_development$1.isContextConsumer = isContextConsumer; | ||
reactIs_development$1.isContextProvider = isContextProvider; | ||
reactIs_development$1.isElement = isElement; | ||
reactIs_development$1.isForwardRef = isForwardRef; | ||
reactIs_development$1.isFragment = isFragment; | ||
reactIs_development$1.isLazy = isLazy; | ||
reactIs_development$1.isMemo = isMemo; | ||
reactIs_development$1.isPortal = isPortal; | ||
reactIs_development$1.isProfiler = isProfiler; | ||
reactIs_development$1.isStrictMode = isStrictMode; | ||
reactIs_development$1.isSuspense = isSuspense; | ||
reactIs_development$1.isSuspenseList = isSuspenseList; | ||
reactIs_development$1.isValidElementType = isValidElementType; | ||
reactIs_development$1.typeOf = typeOf; | ||
})(); | ||
} | ||
return reactIs_development$1; | ||
} | ||
var hasRequiredReactIs$1; | ||
function requireReactIs$1 () { | ||
if (hasRequiredReactIs$1) return reactIs$1.exports; | ||
hasRequiredReactIs$1 = 1; | ||
if (process.env.NODE_ENV === 'production') { | ||
reactIs$1.exports = requireReactIs_production_min(); | ||
} else { | ||
reactIs$1.exports = requireReactIs_development$1(); | ||
} | ||
return reactIs$1.exports; | ||
} | ||
var reactIsExports$1 = requireReactIs$1(); | ||
var index$1 = /*@__PURE__*/getDefaultExportFromCjs(reactIsExports$1); | ||
var ReactIs18 = /*#__PURE__*/_mergeNamespaces({ | ||
__proto__: null, | ||
default: index$1 | ||
}, [reactIsExports$1]); | ||
var reactIs = {exports: {}}; | ||
var reactIs_production = {}; | ||
/** | ||
* @license React | ||
* react-is.production.js | ||
* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
var hasRequiredReactIs_production; | ||
function requireReactIs_production () { | ||
if (hasRequiredReactIs_production) return reactIs_production; | ||
hasRequiredReactIs_production = 1; | ||
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), | ||
REACT_PORTAL_TYPE = Symbol.for("react.portal"), | ||
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), | ||
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), | ||
REACT_PROFILER_TYPE = Symbol.for("react.profiler"); | ||
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), | ||
REACT_CONTEXT_TYPE = Symbol.for("react.context"), | ||
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), | ||
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), | ||
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), | ||
REACT_MEMO_TYPE = Symbol.for("react.memo"), | ||
REACT_LAZY_TYPE = Symbol.for("react.lazy"), | ||
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), | ||
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); | ||
function typeOf(object) { | ||
if ("object" === typeof object && null !== object) { | ||
var $$typeof = object.$$typeof; | ||
switch ($$typeof) { | ||
case REACT_ELEMENT_TYPE: | ||
switch (((object = object.type), object)) { | ||
case REACT_FRAGMENT_TYPE: | ||
case REACT_PROFILER_TYPE: | ||
case REACT_STRICT_MODE_TYPE: | ||
case REACT_SUSPENSE_TYPE: | ||
case REACT_SUSPENSE_LIST_TYPE: | ||
return object; | ||
default: | ||
switch (((object = object && object.$$typeof), object)) { | ||
case REACT_CONTEXT_TYPE: | ||
case REACT_FORWARD_REF_TYPE: | ||
case REACT_LAZY_TYPE: | ||
case REACT_MEMO_TYPE: | ||
return object; | ||
case REACT_CONSUMER_TYPE: | ||
return object; | ||
default: | ||
return $$typeof; | ||
} | ||
} | ||
case REACT_PORTAL_TYPE: | ||
return $$typeof; | ||
} | ||
} | ||
} | ||
reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE; | ||
reactIs_production.ContextProvider = REACT_CONTEXT_TYPE; | ||
reactIs_production.Element = REACT_ELEMENT_TYPE; | ||
reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE; | ||
reactIs_production.Fragment = REACT_FRAGMENT_TYPE; | ||
reactIs_production.Lazy = REACT_LAZY_TYPE; | ||
reactIs_production.Memo = REACT_MEMO_TYPE; | ||
reactIs_production.Portal = REACT_PORTAL_TYPE; | ||
reactIs_production.Profiler = REACT_PROFILER_TYPE; | ||
reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE; | ||
reactIs_production.Suspense = REACT_SUSPENSE_TYPE; | ||
reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE; | ||
reactIs_production.isContextConsumer = function (object) { | ||
return typeOf(object) === REACT_CONSUMER_TYPE; | ||
}; | ||
reactIs_production.isContextProvider = function (object) { | ||
return typeOf(object) === REACT_CONTEXT_TYPE; | ||
}; | ||
reactIs_production.isElement = function (object) { | ||
return ( | ||
"object" === typeof object && | ||
null !== object && | ||
object.$$typeof === REACT_ELEMENT_TYPE | ||
); | ||
}; | ||
reactIs_production.isForwardRef = function (object) { | ||
return typeOf(object) === REACT_FORWARD_REF_TYPE; | ||
}; | ||
reactIs_production.isFragment = function (object) { | ||
return typeOf(object) === REACT_FRAGMENT_TYPE; | ||
}; | ||
reactIs_production.isLazy = function (object) { | ||
return typeOf(object) === REACT_LAZY_TYPE; | ||
}; | ||
reactIs_production.isMemo = function (object) { | ||
return typeOf(object) === REACT_MEMO_TYPE; | ||
}; | ||
reactIs_production.isPortal = function (object) { | ||
return typeOf(object) === REACT_PORTAL_TYPE; | ||
}; | ||
reactIs_production.isProfiler = function (object) { | ||
return typeOf(object) === REACT_PROFILER_TYPE; | ||
}; | ||
reactIs_production.isStrictMode = function (object) { | ||
return typeOf(object) === REACT_STRICT_MODE_TYPE; | ||
}; | ||
reactIs_production.isSuspense = function (object) { | ||
return typeOf(object) === REACT_SUSPENSE_TYPE; | ||
}; | ||
reactIs_production.isSuspenseList = function (object) { | ||
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; | ||
}; | ||
reactIs_production.isValidElementType = function (type) { | ||
return "string" === typeof type || | ||
"function" === typeof type || | ||
type === REACT_FRAGMENT_TYPE || | ||
type === REACT_PROFILER_TYPE || | ||
type === REACT_STRICT_MODE_TYPE || | ||
type === REACT_SUSPENSE_TYPE || | ||
type === REACT_SUSPENSE_LIST_TYPE || | ||
type === REACT_OFFSCREEN_TYPE || | ||
("object" === typeof type && | ||
null !== type && | ||
(type.$$typeof === REACT_LAZY_TYPE || | ||
type.$$typeof === REACT_MEMO_TYPE || | ||
type.$$typeof === REACT_CONTEXT_TYPE || | ||
type.$$typeof === REACT_CONSUMER_TYPE || | ||
type.$$typeof === REACT_FORWARD_REF_TYPE || | ||
type.$$typeof === REACT_CLIENT_REFERENCE || | ||
void 0 !== type.getModuleId)) | ||
? !0 | ||
: !1; | ||
}; | ||
reactIs_production.typeOf = typeOf; | ||
return reactIs_production; | ||
} | ||
var reactIs_development = {}; | ||
/** | ||
* @license React | ||
* react-is.development.js | ||
* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
var hasRequiredReactIs_development; | ||
function requireReactIs_development () { | ||
if (hasRequiredReactIs_development) return reactIs_development; | ||
hasRequiredReactIs_development = 1; | ||
"production" !== process.env.NODE_ENV && | ||
(function () { | ||
function typeOf(object) { | ||
if ("object" === typeof object && null !== object) { | ||
var $$typeof = object.$$typeof; | ||
switch ($$typeof) { | ||
case REACT_ELEMENT_TYPE: | ||
switch (((object = object.type), object)) { | ||
case REACT_FRAGMENT_TYPE: | ||
case REACT_PROFILER_TYPE: | ||
case REACT_STRICT_MODE_TYPE: | ||
case REACT_SUSPENSE_TYPE: | ||
case REACT_SUSPENSE_LIST_TYPE: | ||
return object; | ||
default: | ||
switch (((object = object && object.$$typeof), object)) { | ||
case REACT_CONTEXT_TYPE: | ||
case REACT_FORWARD_REF_TYPE: | ||
case REACT_LAZY_TYPE: | ||
case REACT_MEMO_TYPE: | ||
return object; | ||
case REACT_CONSUMER_TYPE: | ||
return object; | ||
default: | ||
return $$typeof; | ||
} | ||
} | ||
case REACT_PORTAL_TYPE: | ||
return $$typeof; | ||
} | ||
} | ||
} | ||
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), | ||
REACT_PORTAL_TYPE = Symbol.for("react.portal"), | ||
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), | ||
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), | ||
REACT_PROFILER_TYPE = Symbol.for("react.profiler"); | ||
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), | ||
REACT_CONTEXT_TYPE = Symbol.for("react.context"), | ||
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), | ||
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), | ||
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), | ||
REACT_MEMO_TYPE = Symbol.for("react.memo"), | ||
REACT_LAZY_TYPE = Symbol.for("react.lazy"), | ||
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), | ||
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); | ||
reactIs_development.ContextConsumer = REACT_CONSUMER_TYPE; | ||
reactIs_development.ContextProvider = REACT_CONTEXT_TYPE; | ||
reactIs_development.Element = REACT_ELEMENT_TYPE; | ||
reactIs_development.ForwardRef = REACT_FORWARD_REF_TYPE; | ||
reactIs_development.Fragment = REACT_FRAGMENT_TYPE; | ||
reactIs_development.Lazy = REACT_LAZY_TYPE; | ||
reactIs_development.Memo = REACT_MEMO_TYPE; | ||
reactIs_development.Portal = REACT_PORTAL_TYPE; | ||
reactIs_development.Profiler = REACT_PROFILER_TYPE; | ||
reactIs_development.StrictMode = REACT_STRICT_MODE_TYPE; | ||
reactIs_development.Suspense = REACT_SUSPENSE_TYPE; | ||
reactIs_development.SuspenseList = REACT_SUSPENSE_LIST_TYPE; | ||
reactIs_development.isContextConsumer = function (object) { | ||
return typeOf(object) === REACT_CONSUMER_TYPE; | ||
}; | ||
reactIs_development.isContextProvider = function (object) { | ||
return typeOf(object) === REACT_CONTEXT_TYPE; | ||
}; | ||
reactIs_development.isElement = function (object) { | ||
return ( | ||
"object" === typeof object && | ||
null !== object && | ||
object.$$typeof === REACT_ELEMENT_TYPE | ||
); | ||
}; | ||
reactIs_development.isForwardRef = function (object) { | ||
return typeOf(object) === REACT_FORWARD_REF_TYPE; | ||
}; | ||
reactIs_development.isFragment = function (object) { | ||
return typeOf(object) === REACT_FRAGMENT_TYPE; | ||
}; | ||
reactIs_development.isLazy = function (object) { | ||
return typeOf(object) === REACT_LAZY_TYPE; | ||
}; | ||
reactIs_development.isMemo = function (object) { | ||
return typeOf(object) === REACT_MEMO_TYPE; | ||
}; | ||
reactIs_development.isPortal = function (object) { | ||
return typeOf(object) === REACT_PORTAL_TYPE; | ||
}; | ||
reactIs_development.isProfiler = function (object) { | ||
return typeOf(object) === REACT_PROFILER_TYPE; | ||
}; | ||
reactIs_development.isStrictMode = function (object) { | ||
return typeOf(object) === REACT_STRICT_MODE_TYPE; | ||
}; | ||
reactIs_development.isSuspense = function (object) { | ||
return typeOf(object) === REACT_SUSPENSE_TYPE; | ||
}; | ||
reactIs_development.isSuspenseList = function (object) { | ||
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; | ||
}; | ||
reactIs_development.isValidElementType = function (type) { | ||
return "string" === typeof type || | ||
"function" === typeof type || | ||
type === REACT_FRAGMENT_TYPE || | ||
type === REACT_PROFILER_TYPE || | ||
type === REACT_STRICT_MODE_TYPE || | ||
type === REACT_SUSPENSE_TYPE || | ||
type === REACT_SUSPENSE_LIST_TYPE || | ||
type === REACT_OFFSCREEN_TYPE || | ||
("object" === typeof type && | ||
null !== type && | ||
(type.$$typeof === REACT_LAZY_TYPE || | ||
type.$$typeof === REACT_MEMO_TYPE || | ||
type.$$typeof === REACT_CONTEXT_TYPE || | ||
type.$$typeof === REACT_CONSUMER_TYPE || | ||
type.$$typeof === REACT_FORWARD_REF_TYPE || | ||
type.$$typeof === REACT_CLIENT_REFERENCE || | ||
void 0 !== type.getModuleId)) | ||
? !0 | ||
: !1; | ||
}; | ||
reactIs_development.typeOf = typeOf; | ||
})(); | ||
return reactIs_development; | ||
@@ -734,3 +1056,3 @@ } | ||
if (process.env.NODE_ENV === 'production') { | ||
reactIs.exports = requireReactIs_production_min(); | ||
reactIs.exports = requireReactIs_production(); | ||
} else { | ||
@@ -742,4 +1064,30 @@ reactIs.exports = requireReactIs_development(); | ||
var reactIsExports = requireReactIs(); | ||
var reactIsExports = /*@__PURE__*/ requireReactIs(); | ||
var index = /*@__PURE__*/getDefaultExportFromCjs(reactIsExports); | ||
var ReactIs19 = /*#__PURE__*/_mergeNamespaces({ | ||
__proto__: null, | ||
default: index | ||
}, [reactIsExports]); | ||
const reactIsMethods = [ | ||
"isAsyncMode", | ||
"isConcurrentMode", | ||
"isContextConsumer", | ||
"isContextProvider", | ||
"isElement", | ||
"isForwardRef", | ||
"isFragment", | ||
"isLazy", | ||
"isMemo", | ||
"isPortal", | ||
"isProfiler", | ||
"isStrictMode", | ||
"isSuspense", | ||
"isSuspenseList", | ||
"isValidElementType" | ||
]; | ||
const ReactIs = Object.fromEntries( | ||
reactIsMethods.map((m) => [m, (v) => ReactIs18[m](v) || ReactIs19[m](v)]) | ||
); | ||
function getChildren(arg, children = []) { | ||
@@ -763,16 +1111,16 @@ if (Array.isArray(arg)) { | ||
} | ||
if (reactIsExports.isFragment(element)) { | ||
if (ReactIs.isFragment(element)) { | ||
return "React.Fragment"; | ||
} | ||
if (reactIsExports.isSuspense(element)) { | ||
if (ReactIs.isSuspense(element)) { | ||
return "React.Suspense"; | ||
} | ||
if (typeof type === "object" && type !== null) { | ||
if (reactIsExports.isContextProvider(element)) { | ||
if (ReactIs.isContextProvider(element)) { | ||
return "Context.Provider"; | ||
} | ||
if (reactIsExports.isContextConsumer(element)) { | ||
if (ReactIs.isContextConsumer(element)) { | ||
return "Context.Consumer"; | ||
} | ||
if (reactIsExports.isForwardRef(element)) { | ||
if (ReactIs.isForwardRef(element)) { | ||
if (type.displayName) { | ||
@@ -784,3 +1132,3 @@ return type.displayName; | ||
} | ||
if (reactIsExports.isMemo(element)) { | ||
if (ReactIs.isMemo(element)) { | ||
const functionName = type.displayName || type.type.displayName || type.type.name || ""; | ||
@@ -818,3 +1166,3 @@ return functionName === "" ? "Memo" : `Memo(${functionName})`; | ||
); | ||
const test$1 = (val) => val != null && reactIsExports.isElement(val); | ||
const test$1 = (val) => val != null && ReactIs.isElement(val); | ||
const plugin$1 = { serialize: serialize$1, test: test$1 }; | ||
@@ -821,0 +1169,0 @@ |
{ | ||
"name": "@vitest/pretty-format", | ||
"type": "module", | ||
"version": "2.2.0-beta.1", | ||
"version": "2.2.0-beta.2", | ||
"description": "Fork of pretty-format with support for ESM", | ||
@@ -37,3 +37,4 @@ "license": "MIT", | ||
"@types/react-is": "^18.3.0", | ||
"react-is": "^18.3.1" | ||
"react-is": "^18.3.1", | ||
"react-is-19": "npm:react-is@19.0.0-rc-b01722d5-20241114" | ||
}, | ||
@@ -40,0 +41,0 @@ "scripts": { |
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
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
58033
1581
3
4