UNPKG

react-native-web-internals

Version:

React Native for Web

46 lines (45 loc) 2.34 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: !0 }); }, __copyProps = (to, from, except, desc) => { if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); var normalizeValueWithProperty_exports = {}; __export(normalizeValueWithProperty_exports, { default: () => normalizeValueWithProperty }); module.exports = __toCommonJS(normalizeValueWithProperty_exports); var import_unitlessNumbers = require("../../modules/unitlessNumbers/index"), import_normalizeColor = __toESM(require("./normalizeColor")), colorProps = { backgroundColor: !0, borderColor: !0, borderTopColor: !0, borderRightColor: !0, borderBottomColor: !0, borderLeftColor: !0, color: !0, shadowColor: !0, textDecorationColor: !0, textShadowColor: !0 }; function normalizeValueWithProperty(value, property) { var returnValue = value; return (property == null || !import_unitlessNumbers.unitlessNumbers[property]) && typeof value == "number" ? returnValue = `${value}px` : property != null && colorProps[property] && (returnValue = (0, import_normalizeColor.default)(value)), returnValue; } //# sourceMappingURL=normalizeValueWithProperty.js.map