PromoCursed/node_modules/.cache/babel-loader/1aef4b4d88b5a34463376bb002f3dde1cef00d846e746da45ecf5b7315ede48b.json

1 line
5.7 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { warning } from 'rc-util';\nexport default function getComponentToken(component, token, defaultToken, options) {\n var customToken = _objectSpread({}, token[component]);\n if (options !== null && options !== void 0 && options.deprecatedTokens) {\n var deprecatedTokens = options.deprecatedTokens;\n deprecatedTokens.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n oldTokenKey = _ref2[0],\n newTokenKey = _ref2[1];\n if (process.env.NODE_ENV !== 'production') {\n warning(!(customToken !== null && customToken !== void 0 && customToken[oldTokenKey]), \"Component Token `\".concat(String(oldTokenKey), \"` of \").concat(String(component), \" is deprecated. Please use `\").concat(String(newTokenKey), \"` instead.\"));\n }\n\n // Should wrap with `if` clause, or there will be `undefined` in object.\n if (customToken !== null && customToken !== void 0 && customToken[oldTokenKey] || customToken !== null && customToken !== void 0 && customToken[newTokenKey]) {\n var _customToken$newToken;\n (_customToken$newToken = customToken[newTokenKey]) !== null && _customToken$newToken !== void 0 ? _customToken$newToken : customToken[newTokenKey] = customToken === null || customToken === void 0 ? void 0 : customToken[oldTokenKey];\n }\n });\n }\n var mergedToken = _objectSpread(_objectSpread({}, defaultToken), customToken);\n\n // Remove same value as global token to minimize size\n Object.keys(mergedToken).forEach(function (key) {\n if (mergedToken[key] === token[key]) {\n delete mergedToken[key];\n }\n });\n return mergedToken;\n}\n;","map":{"version":3,"names":["_slicedToArray","_objectSpread","warning","getComponentToken","component","token","defaultToken","options","customToken","deprecatedTokens","forEach","_ref","_ref2","oldTokenKey","newTokenKey","process","env","NODE_ENV","concat","String","_customToken$newToken","mergedToken","Object","keys","key"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/@ant-design/cssinjs-utils/es/util/getComponentToken.js"],"sourcesContent":["import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { warning } from 'rc-util';\nexport default function getComponentToken(component, token, defaultToken, options) {\n var customToken = _objectSpread({}, token[component]);\n if (options !== null && options !== void 0 && options.deprecatedTokens) {\n var deprecatedTokens = options.deprecatedTokens;\n deprecatedTokens.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n oldTokenKey = _ref2[0],\n newTokenKey = _ref2[1];\n if (process.env.NODE_ENV !== 'production') {\n warning(!(customToken !== null && customToken !== void 0 && customToken[oldTokenKey]), \"Component Token `\".concat(String(oldTokenKey), \"` of \").concat(String(component), \" is deprecated. Please use `\").concat(String(newTokenKey), \"` instead.\"));\n }\n\n // Should wrap with `if` clause, or there will be `undefined` in object.\n if (customToken !== null && customToken !== void 0 && customToken[oldTokenKey] || customToken !== null && customToken !== void 0 && customToken[newTokenKey]) {\n var _customToken$newToken;\n (_customToken$newToken = customToken[newTokenKey]) !== null && _customToken$newToken !== void 0 ? _customToken$newToken : customToken[newTokenKey] = customToken === null || customToken === void 0 ? void 0 : customToken[oldTokenKey];\n }\n });\n }\n var mergedToken = _objectSpread(_objectSpread({}, defaultToken), customToken);\n\n // Remove same value as global token to minimize size\n Object.keys(mergedToken).forEach(function (key) {\n if (mergedToken[key] === token[key]) {\n delete mergedToken[key];\n }\n });\n return mergedToken;\n}\n;"],