UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

16 lines (13 loc) 512 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /* Regex to split e.g. "10px repeat(2, 1fr) 0.4em 10px" to array of strings: ["10px", "repeat(2, 1fr)", "0.4em", "10px"] */ var splitToWords = function splitToWords(value) { return value ? value.match(/\d+\.\d+\w+|\w+\((\w+\([^\\(]+\)|[,]|\s+|\d+|\w+(-?\w?)|\d+\.\d+\w+|\d+([\w]+|%))*\)|\w+\([^\\(]+\)|\d+([\w]+|%)|[\w\\-]+/g) : undefined; }; var _default = splitToWords; exports.default = _default;