Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-emotion

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-emotion - npm Package Compare versions

Comparing version 10.0.9 to 10.0.10

48

dist/jest-emotion.browser.cjs.js

@@ -9,3 +9,19 @@ 'use strict';

var css = require('css');
var _objectAssign = _interopDefault(require('object-assign'));
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function defaultClassNameReplacer(className, index) {

@@ -77,2 +93,8 @@ return "emotion-" + index;

}
function isEmotionCssPropElementType(val) {
return val.$$typeof === Symbol.for('react.element') && val.type.$$typeof === Symbol.for('react.forward_ref') && val.type.displayName === 'EmotionCssPropInternal';
}
function isEmotionCssPropEnzymeElement(val) {
return val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal';
}
var domElementPattern = /^((HTML|SVG)\w*)?Element$/;

@@ -335,2 +357,17 @@ function isDOMElement(val) {

function filterEmotionProps(props) {
if (props === void 0) {
props = {};
}
var _props = props,
css$$1 = _props.css,
__EMOTION_TYPE_PLEASE_DO_NOT_USE__ = _props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,
__EMOTION_LABEL_PLEASE_DO_NOT_USE__ = _props.__EMOTION_LABEL_PLEASE_DO_NOT_USE__,
rest = _objectWithoutPropertiesLoose(_props, ["css", "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", "__EMOTION_LABEL_PLEASE_DO_NOT_USE__"]);
rest.css = 'unknown styles';
return rest;
}
function createSerializer(_temp) {

@@ -345,6 +382,13 @@ var _ref2 = _temp === void 0 ? {} : _temp,

function print(val, printer) {
if (val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal') {
if (isEmotionCssPropEnzymeElement(val)) {
return val.children.map(printer).join('\n');
}
if (isEmotionCssPropElementType(val)) {
return printer(_objectAssign({}, val, {
props: filterEmotionProps(val.props),
type: val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
}));
}
var nodes = getNodes(val);

@@ -362,3 +406,3 @@ var classNames = getClassNamesFromNodes(nodes);

function test(val) {
return val && (!cache.has(val) && (isReactElement(val) || DOMElements && isDOMElement(val)) || val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal');
return val && (!cache.has(val) && (isReactElement(val) || DOMElements && isDOMElement(val)) || isEmotionCssPropEnzymeElement(val) || isEmotionCssPropElementType(val));
}

@@ -365,0 +409,0 @@

import chalk from 'chalk';
import { stringify, parse } from 'css';
import _objectAssign from 'object-assign';
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function defaultClassNameReplacer(className, index) {

@@ -70,2 +86,8 @@ return "emotion-" + index;

}
function isEmotionCssPropElementType(val) {
return val.$$typeof === Symbol.for('react.element') && val.type.$$typeof === Symbol.for('react.forward_ref') && val.type.displayName === 'EmotionCssPropInternal';
}
function isEmotionCssPropEnzymeElement(val) {
return val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal';
}
var domElementPattern = /^((HTML|SVG)\w*)?Element$/;

@@ -328,2 +350,17 @@ function isDOMElement(val) {

function filterEmotionProps(props) {
if (props === void 0) {
props = {};
}
var _props = props,
css = _props.css,
__EMOTION_TYPE_PLEASE_DO_NOT_USE__ = _props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,
__EMOTION_LABEL_PLEASE_DO_NOT_USE__ = _props.__EMOTION_LABEL_PLEASE_DO_NOT_USE__,
rest = _objectWithoutPropertiesLoose(_props, ["css", "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", "__EMOTION_LABEL_PLEASE_DO_NOT_USE__"]);
rest.css = 'unknown styles';
return rest;
}
function createSerializer(_temp) {

@@ -338,6 +375,13 @@ var _ref2 = _temp === void 0 ? {} : _temp,

function print(val, printer) {
if (val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal') {
if (isEmotionCssPropEnzymeElement(val)) {
return val.children.map(printer).join('\n');
}
if (isEmotionCssPropElementType(val)) {
return printer(_objectAssign({}, val, {
props: filterEmotionProps(val.props),
type: val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
}));
}
var nodes = getNodes(val);

@@ -355,3 +399,3 @@ var classNames = getClassNamesFromNodes(nodes);

function test(val) {
return val && (!cache.has(val) && (isReactElement(val) || DOMElements && isDOMElement(val)) || val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal');
return val && (!cache.has(val) && (isReactElement(val) || DOMElements && isDOMElement(val)) || isEmotionCssPropEnzymeElement(val) || isEmotionCssPropElementType(val));
}

@@ -358,0 +402,0 @@

@@ -9,3 +9,19 @@ 'use strict';

var css = require('css');
var _objectAssign = _interopDefault(require('object-assign'));
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function defaultClassNameReplacer(className, index) {

@@ -77,2 +93,8 @@ return "emotion-" + index;

}
function isEmotionCssPropElementType(val) {
return val.$$typeof === Symbol.for('react.element') && val.type.$$typeof === Symbol.for('react.forward_ref') && val.type.displayName === 'EmotionCssPropInternal';
}
function isEmotionCssPropEnzymeElement(val) {
return val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal';
}
var domElementPattern = /^((HTML|SVG)\w*)?Element$/;

@@ -335,2 +357,17 @@ function isDOMElement(val) {

function filterEmotionProps(props) {
if (props === void 0) {
props = {};
}
var _props = props,
css$$1 = _props.css,
__EMOTION_TYPE_PLEASE_DO_NOT_USE__ = _props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,
__EMOTION_LABEL_PLEASE_DO_NOT_USE__ = _props.__EMOTION_LABEL_PLEASE_DO_NOT_USE__,
rest = _objectWithoutPropertiesLoose(_props, ["css", "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", "__EMOTION_LABEL_PLEASE_DO_NOT_USE__"]);
rest.css = 'unknown styles';
return rest;
}
function createSerializer(_temp) {

@@ -345,6 +382,13 @@ var _ref2 = _temp === void 0 ? {} : _temp,

function print(val, printer) {
if (val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal') {
if (isEmotionCssPropEnzymeElement(val)) {
return val.children.map(printer).join('\n');
}
if (isEmotionCssPropElementType(val)) {
return printer(_objectAssign({}, val, {
props: filterEmotionProps(val.props),
type: val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
}));
}
var nodes = getNodes(val);

@@ -362,3 +406,3 @@ var classNames = getClassNamesFromNodes(nodes);

function test(val) {
return val && (!cache.has(val) && (isReactElement(val) || DOMElements && isDOMElement(val)) || val.$$typeof === Symbol.for('react.test.json') && val.type === 'EmotionCssPropInternal');
return val && (!cache.has(val) && (isReactElement(val) || DOMElements && isDOMElement(val)) || isEmotionCssPropEnzymeElement(val) || isEmotionCssPropElementType(val));
}

@@ -365,0 +409,0 @@

@@ -7,3 +7,15 @@ "use strict";

var chalk = _interopDefault(require("chalk")),
css = require("css");
css = require("css"),
_objectAssign = _interopDefault(require("object-assign"));
function _objectWithoutPropertiesLoose(source, excluded) {
if (null == source) return {};
var key,
i,
target = {},
sourceKeys = Object.keys(source);
for (i = 0; i < sourceKeys.length; i++)
(key = sourceKeys[i]),
0 <= excluded.indexOf(key) || (target[key] = source[key]);
return target;
}
function defaultClassNameReplacer(className, index) {

@@ -71,2 +83,15 @@ return "emotion-" + index;

}
function isEmotionCssPropElementType(val) {
return (
val.$$typeof === Symbol.for("react.element") &&
val.type.$$typeof === Symbol.for("react.forward_ref") &&
"EmotionCssPropInternal" === val.type.displayName
);
}
function isEmotionCssPropEnzymeElement(val) {
return (
val.$$typeof === Symbol.for("react.test.json") &&
"EmotionCssPropInternal" === val.type
);
}
var domElementPattern = /^((HTML|SVG)\w*)?Element$/;

@@ -268,2 +293,15 @@ function isDOMElement(val) {

}
function filterEmotionProps(props) {
void 0 === props && (props = {});
var _props = props,
rest = (_props.css,
_props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,
_props.__EMOTION_LABEL_PLEASE_DO_NOT_USE__,
_objectWithoutPropertiesLoose(_props, [
"css",
"__EMOTION_TYPE_PLEASE_DO_NOT_USE__",
"__EMOTION_LABEL_PLEASE_DO_NOT_USE__"
]));
return (rest.css = "unknown styles"), rest;
}
function createSerializer(_temp) {

@@ -281,12 +319,16 @@ var _ref2 = void 0 === _temp ? {} : _temp,

(isReactElement(val) || (DOMElements && isDOMElement(val)))) ||
(val.$$typeof === Symbol.for("react.test.json") &&
"EmotionCssPropInternal" === val.type))
isEmotionCssPropEnzymeElement(val) ||
isEmotionCssPropElementType(val))
);
},
print: function(val, printer) {
if (
val.$$typeof === Symbol.for("react.test.json") &&
"EmotionCssPropInternal" === val.type
)
if (isEmotionCssPropEnzymeElement(val))
return val.children.map(printer).join("\n");
if (isEmotionCssPropElementType(val))
return printer(
_objectAssign({}, val, {
props: filterEmotionProps(val.props),
type: val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
})
);
var nodes = getNodes(val),

@@ -293,0 +335,0 @@ classNames = getClassNamesFromNodes(nodes),

4

package.json
{
"name": "jest-emotion",
"version": "10.0.9",
"version": "10.0.10",
"description": "Jest utilities for emotion",

@@ -23,3 +23,3 @@ "main": "dist/jest-emotion.cjs.js",

"devDependencies": {
"@emotion/core": "^10.0.9",
"@emotion/core": "^10.0.10",
"dtslint": "^0.3.0",

@@ -26,0 +26,0 @@ "emotion": "^10.0.9",

@@ -7,2 +7,4 @@ // @flow

isReactElement,
isEmotionCssPropElementType,
isEmotionCssPropEnzymeElement,
isDOMElement,

@@ -51,2 +53,15 @@ getStylesFromClassNames,

function filterEmotionProps(props = {}) {
const {
css,
__EMOTION_TYPE_PLEASE_DO_NOT_USE__,
__EMOTION_LABEL_PLEASE_DO_NOT_USE__,
...rest
} = props
rest.css = 'unknown styles'
return rest
}
export function createSerializer({

@@ -58,8 +73,12 @@ classNameReplacer,

function print(val: *, printer: Function) {
if (
val.$$typeof === Symbol.for('react.test.json') &&
val.type === 'EmotionCssPropInternal'
) {
if (isEmotionCssPropEnzymeElement(val)) {
return val.children.map(printer).join('\n')
}
if (isEmotionCssPropElementType(val)) {
return printer({
...val,
props: filterEmotionProps(val.props),
type: val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
})
}
const nodes = getNodes(val)

@@ -87,4 +106,4 @@ const classNames = getClassNamesFromNodes(nodes)

(isReactElement(val) || (DOMElements && isDOMElement(val)))) ||
(val.$$typeof === Symbol.for('react.test.json') &&
val.type === 'EmotionCssPropInternal'))
isEmotionCssPropEnzymeElement(val) ||
isEmotionCssPropElementType(val))
)

@@ -91,0 +110,0 @@ }

@@ -47,2 +47,16 @@ // @flow

export function isEmotionCssPropElementType(val: any): boolean {
return (
val.$$typeof === Symbol.for('react.element') &&
val.type.$$typeof === Symbol.for('react.forward_ref') &&
val.type.displayName === 'EmotionCssPropInternal'
)
}
export function isEmotionCssPropEnzymeElement(val: any): boolean {
return (
val.$$typeof === Symbol.for('react.test.json') &&
val.type === 'EmotionCssPropInternal'
)
}
const domElementPattern = /^((HTML|SVG)\w*)?Element$/

@@ -49,0 +63,0 @@

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