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

@tamagui/font-size

Package Overview
Dependencies
Maintainers
1
Versions
1076
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/font-size - npm Package Compare versions

Comparing version 1.111.8 to 1.111.9

49

dist/esm/getFontSize.native.js
import { getConfig, isVariable } from "@tamagui/core";
var getFontSize = function(inSize, opts) {
var res = getFontSizeVariable(inSize, opts);
return isVariable(res) ? +res.val : res ? +res : 16;
}, getFontSizeVariable = function(inSize, opts) {
var token = getFontSizeToken(inSize, opts);
if (!token)
return inSize;
var conf = getConfig();
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token];
}, getFontSizeToken = function(inSize, opts) {
if (typeof inSize == "number")
return null;
var relativeSize = opts?.relativeSize || 0, conf = getConfig(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size);
foundIndex === -1 && size.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size.replace(".5", ""))), process.env.NODE_ENV === "development" && foundIndex === -1 && console.warn("No font size found", size, opts, "in size tokens", sizeTokens);
var tokenIndex = Math.min(Math.max(0, foundIndex + relativeSize), sizeTokens.length - 1), _sizeTokens_tokenIndex;
return (_sizeTokens_tokenIndex = sizeTokens[tokenIndex]) !== null && _sizeTokens_tokenIndex !== void 0 ? _sizeTokens_tokenIndex : size;
};
export {
getFontSize,
getFontSizeToken,
getFontSizeVariable
};
//# sourceMappingURL=getFontSize.js.map
var getFontSize = function (inSize, opts) {
var res = getFontSizeVariable(inSize, opts);
return isVariable(res) ? +res.val : res ? +res : 16;
},
getFontSizeVariable = function (inSize, opts) {
var token = getFontSizeToken(inSize, opts);
if (!token) return inSize;
var conf = getConfig();
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token];
},
getFontSizeToken = function (inSize, opts) {
if (typeof inSize == "number") return null;
var relativeSize = opts?.relativeSize || 0,
conf = getConfig(),
fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size,
_ref,
size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4",
sizeTokens = Object.keys(fontSize),
foundIndex = sizeTokens.indexOf(size);
foundIndex === -1 && size.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size.replace(".5", ""))), process.env.NODE_ENV === "development" && foundIndex === -1 && console.warn("No font size found", size, opts, "in size tokens", sizeTokens);
var tokenIndex = Math.min(Math.max(0, foundIndex + relativeSize), sizeTokens.length - 1),
_sizeTokens_tokenIndex;
return (_sizeTokens_tokenIndex = sizeTokens[tokenIndex]) !== null && _sizeTokens_tokenIndex !== void 0 ? _sizeTokens_tokenIndex : size;
};
export { getFontSize, getFontSizeToken, getFontSizeVariable };
//# sourceMappingURL=getFontSize.native.js.map

@@ -1,2 +0,2 @@

export * from "./getFontSize";
//# sourceMappingURL=index.js.map
export * from "./getFontSize.native.js";
//# sourceMappingURL=index.native.js.map
{
"name": "@tamagui/font-size",
"version": "1.111.8",
"version": "1.111.9",
"sideEffects": false,

@@ -18,3 +18,3 @@ "source": "src/index.ts",

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

@@ -34,6 +34,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"

@@ -40,0 +40,0 @@ },

Sorry, the diff of this file is not supported yet

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