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

@ant-design/cssinjs

Package Overview
Dependencies
Maintainers
14
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ant-design/cssinjs - npm Package Compare versions

Comparing version 0.0.0-alpha.18 to 0.0.0-alpha.19

16

es/useCacheToken.js
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import * as React from 'react';
import hash from '@emotion/hash';

@@ -7,2 +8,3 @@ import { ATTR_TOKEN } from './StyleContext';

import { flattenToken, token2key } from './util';
var EMPTY_OVERRIDE = {};
var tokenKeys = new Map();

@@ -55,7 +57,13 @@

_option$override = option.override,
override = _option$override === void 0 ? {} : _option$override; // Basic
override = _option$override === void 0 ? EMPTY_OVERRIDE : _option$override; // Basic - We do basic cache here
var mergedToken = Object.assign.apply(Object, [{}].concat(_toConsumableArray(tokens)));
var tokenStr = flattenToken(mergedToken);
var overrideTokenStr = flattenToken(override);
var mergedToken = React.useMemo(function () {
return Object.assign.apply(Object, [{}].concat(_toConsumableArray(tokens)));
}, [tokens]);
var tokenStr = React.useMemo(function () {
return flattenToken(mergedToken);
}, [mergedToken]);
var overrideTokenStr = React.useMemo(function () {
return flattenToken(override);
}, [override]);
var cachedToken = useGlobalCache('token', [salt, tokenStr, overrideTokenStr], function () {

@@ -62,0 +70,0 @@ var derivativeToken = theme.getDerivativeToken(mergedToken); // Merge with override

"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

@@ -14,2 +16,4 @@

var React = _interopRequireWildcard(require("react"));
var _hash = _interopRequireDefault(require("@emotion/hash"));

@@ -23,2 +27,3 @@

var EMPTY_OVERRIDE = {};
var tokenKeys = new Map();

@@ -71,7 +76,13 @@

_option$override = option.override,
override = _option$override === void 0 ? {} : _option$override; // Basic
override = _option$override === void 0 ? EMPTY_OVERRIDE : _option$override; // Basic - We do basic cache here
var mergedToken = Object.assign.apply(Object, [{}].concat((0, _toConsumableArray2.default)(tokens)));
var tokenStr = (0, _util.flattenToken)(mergedToken);
var overrideTokenStr = (0, _util.flattenToken)(override);
var mergedToken = React.useMemo(function () {
return Object.assign.apply(Object, [{}].concat((0, _toConsumableArray2.default)(tokens)));
}, [tokens]);
var tokenStr = React.useMemo(function () {
return (0, _util.flattenToken)(mergedToken);
}, [mergedToken]);
var overrideTokenStr = React.useMemo(function () {
return (0, _util.flattenToken)(override);
}, [override]);
var cachedToken = (0, _useGlobalCache.default)('token', [salt, tokenStr, overrideTokenStr], function () {

@@ -78,0 +89,0 @@ var derivativeToken = theme.getDerivativeToken(mergedToken); // Merge with override

{
"name": "@ant-design/cssinjs",
"version": "0.0.0-alpha.18",
"version": "0.0.0-alpha.19",
"description": "Component level cssinjs resolution for antd",

@@ -5,0 +5,0 @@ "keywords": [

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