UNPKG

react-native-web-internals

Version:

React Native for Web

69 lines (68 loc) 2.54 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); var validate_exports = {}; __export(validate_exports, { validate: () => validate }); module.exports = __toCommonJS(validate_exports); var invalidShortforms = { background: !0, borderBottom: !0, borderLeft: !0, borderRight: !0, borderTop: !0, font: !0, grid: !0, outline: !0, textDecoration: !0 }, invalidMultiValueShortforms = { flex: !0, margin: !0, padding: !0, borderColor: !0, borderRadius: !0, borderStyle: !0, borderWidth: !0, marginHorizontal: !0, marginVertical: !0, paddingHorizontal: !0, paddingVertical: !0, overflow: !0, overscrollBehavior: !0, backgroundPosition: !0 }; function error(message) { console.error(message); } function validate(obj) { for (var k in obj) { var prop = k.trim(), value = obj[prop], isInvalid = !1; if (value !== null) { if (typeof value == "string" && value.indexOf("!important") > -1) error(`Invalid style declaration "${prop}:${value}". Values cannot include "!important"`), isInvalid = !0; else { var suggestion = ""; prop === "animation" || prop === "animationName" ? (suggestion = 'Did you mean "animationKeyframes"?', isInvalid = !0) : prop === "direction" ? (suggestion = 'Did you mean "writingDirection"?', isInvalid = !0) : prop === "verticalAlign" ? (suggestion = 'Did you mean "textAlignVertical"?', isInvalid = !0) : invalidShortforms[prop] ? (suggestion = "Please use long-form properties.", isInvalid = !0) : invalidMultiValueShortforms[prop], suggestion !== "" && error(`Invalid style property of "${prop}". ${suggestion}`); } isInvalid && delete obj[k]; } } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { validate }); //# sourceMappingURL=validate.js.map