* Stylis * * @param {string} selector * @param {string} input * @return {*}
(selector, input)
| 23619 | * @return {*} |
| 23620 | */ |
| 23621 | function stylis (selector, input) { |
| 23622 | if (this !== void 0 && this.constructor === stylis) { |
| 23623 | return factory(selector) |
| 23624 | } |
| 23625 | |
| 23626 | // setup |
| 23627 | var ns = selector |
| 23628 | var code = ns.charCodeAt(0) |
| 23629 | |
| 23630 | // trim leading whitespace |
| 23631 | if (code < 33) { |
| 23632 | code = (ns = ns.trim()).charCodeAt(0) |
| 23633 | } |
| 23634 | |
| 23635 | // keyframe/animation namespace |
| 23636 | if (keyed > 0) { |
| 23637 | key = ns.replace(invalidptn, code === OPENBRACKET ? '' : '-') |
| 23638 | } |
| 23639 | |
| 23640 | // reset, used to assert if a plugin is moneky-patching the return value |
| 23641 | code = 1 |
| 23642 | |
| 23643 | // cascade/isolate |
| 23644 | if (cascade === 1) { |
| 23645 | nscope = ns |
| 23646 | } else { |
| 23647 | nscopealt = ns |
| 23648 | } |
| 23649 | |
| 23650 | var selectors = [nscope] |
| 23651 | var result |
| 23652 | |
| 23653 | // execute plugins, pre-process context |
| 23654 | if (plugged > 0) { |
| 23655 | result = proxy(PREPS, input, selectors, selectors, line, column, 0, 0, 0, 0) |
| 23656 | |
| 23657 | if (result !== void 0 && typeof result === 'string') { |
| 23658 | input = result |
| 23659 | } |
| 23660 | } |
| 23661 | |
| 23662 | // build |
| 23663 | var output = compile(array, selectors, input, 0, 0) |
| 23664 | |
| 23665 | // execute plugins, post-process context |
| 23666 | if (plugged > 0) { |
| 23667 | result = proxy(POSTS, output, selectors, selectors, line, column, output.length, 0, 0, 0) |
| 23668 | |
| 23669 | // bypass minification |
| 23670 | if (result !== void 0 && typeof(output = result) !== 'string') { |
| 23671 | code = 0 |
| 23672 | } |
| 23673 | } |
| 23674 | |
| 23675 | // reset |
| 23676 | key = '' |
| 23677 | nscope = '' |
| 23678 | nscopealt = '' |
no test coverage detected