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

@tamagui/get-font-sized

Package Overview
Dependencies
Maintainers
1
Versions
919
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/get-font-sized - npm Package Compare versions

Comparing version 1.111.8 to 1.111.9

60

dist/esm/index.native.js
import { getTokens } from "@tamagui/core";
var getFontSized = function() {
var sizeTokenIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true", { font, fontFamily, props } = arguments.length > 1 ? arguments[1] : void 0, _font_lineHeight, _font_weight, _font_letterSpacing, _font_transform, _font_style, _font_color;
if (!font)
return {
var getFontSized = function () {
var sizeTokenIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true",
{
font,
fontFamily,
props
} = arguments.length > 1 ? arguments[1] : void 0,
_font_lineHeight,
_font_weight,
_font_letterSpacing,
_font_transform,
_font_style,
_font_color;
if (!font) return {
fontSize: sizeTokenIn
};
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, style = {}, fontSize = font.size[sizeToken], lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken], fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken], letterSpacing = (_font_letterSpacing = font.letterSpacing) === null || _font_letterSpacing === void 0 ? void 0 : _font_letterSpacing[sizeToken], textTransform = (_font_transform = font.transform) === null || _font_transform === void 0 ? void 0 : _font_transform[sizeToken], _props_fontStyle, fontStyle = (_props_fontStyle = props.fontStyle) !== null && _props_fontStyle !== void 0 ? _props_fontStyle : (_font_style = font.style) === null || _font_style === void 0 ? void 0 : _font_style[sizeToken], _props_color, color = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : (_font_color = font.color) === null || _font_color === void 0 ? void 0 : _font_color[sizeToken];
return fontStyle && (style.fontStyle = fontStyle), textTransform && (style.textTransform = textTransform), fontFamily && (style.fontFamily = fontFamily), fontWeight && (style.fontWeight = fontWeight), letterSpacing && (style.letterSpacing = letterSpacing), fontSize && (style.fontSize = fontSize), lineHeight && (style.lineHeight = lineHeight), color && (style.color = color), process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), console.info({
style,
props,
font
}), console.groupEnd()), style;
}, cache = /* @__PURE__ */ new WeakMap();
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn,
style = {},
fontSize = font.size[sizeToken],
lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken],
fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken],
letterSpacing = (_font_letterSpacing = font.letterSpacing) === null || _font_letterSpacing === void 0 ? void 0 : _font_letterSpacing[sizeToken],
textTransform = (_font_transform = font.transform) === null || _font_transform === void 0 ? void 0 : _font_transform[sizeToken],
_props_fontStyle,
fontStyle = (_props_fontStyle = props.fontStyle) !== null && _props_fontStyle !== void 0 ? _props_fontStyle : (_font_style = font.style) === null || _font_style === void 0 ? void 0 : _font_style[sizeToken],
_props_color,
color = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : (_font_color = font.color) === null || _font_color === void 0 ? void 0 : _font_color[sizeToken];
return fontStyle && (style.fontStyle = fontStyle), textTransform && (style.textTransform = textTransform), fontFamily && (style.fontFamily = fontFamily), fontWeight && (style.fontWeight = fontWeight), letterSpacing && (style.letterSpacing = letterSpacing), fontSize && (style.fontSize = fontSize), lineHeight && (style.lineHeight = lineHeight), color && (style.color = color), process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), console.info({
style,
props,
font
}), console.groupEnd()), style;
},
cache = /* @__PURE__ */new WeakMap();
function getDefaultSizeToken(font) {
if (typeof font == "object" && cache.has(font))
return cache.get(font);
var sizeTokens = "$true" in font.size ? font.size : getTokens().size, sizeDefault = sizeTokens.$true, sizeDefaultSpecific = sizeDefault ? Object.keys(sizeTokens).find(function(x) {
return x !== "$true" && sizeTokens[x].val === sizeDefault.val;
}) : null;
if (typeof font == "object" && cache.has(font)) return cache.get(font);
var sizeTokens = "$true" in font.size ? font.size : getTokens().size,
sizeDefault = sizeTokens.$true,
sizeDefaultSpecific = sizeDefault ? Object.keys(sizeTokens).find(function (x) {
return x !== "$true" && sizeTokens[x].val === sizeDefault.val;
}) : null;
return !sizeDefault || !sizeDefaultSpecific ? (process.env.NODE_ENV === "development" && console.warn(`No default size is set in your tokens for the "true" key, fonts will be inconsistent.

@@ -26,5 +48,3 @@

}
export {
getFontSized
};
//# sourceMappingURL=index.js.map
export { getFontSized };
//# sourceMappingURL=index.native.js.map
{
"name": "@tamagui/get-font-sized",
"version": "1.111.8",
"version": "1.111.9",
"types": "./types/index.d.ts",

@@ -23,3 +23,3 @@ "main": "dist/cjs",

".": {
"react-native-import": "./dist/esm/index.native.mjs",
"react-native-import": "./dist/esm/index.native.js",
"react-native": "./dist/cjs/index.native.js",

@@ -32,6 +32,6 @@ "types": "./types/index.d.ts",

"dependencies": {
"@tamagui/core": "1.111.8"
"@tamagui/core": "1.111.9"
},
"devDependencies": {
"@tamagui/build": "1.111.8",
"@tamagui/build": "1.111.9",
"react": "^18.2.0 || ^19.0.0"

@@ -38,0 +38,0 @@ },

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