vendor: 3,437 bytes, lines 1-109
1/* Source and licensing information for the line(s) below can be found at https://www.oiv.int/core/assets/vendor/css-escape/css.escape.js. */ 2/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ 3;(function(root, factory) { 4 // https://github.com/umdjs/umd/blob/master/returnExports.js 5 if (typeof exports == 'object') { 6 // For Node.js. 7 module.exports = factory(root); 8 } else if (typeof define == 'function' && define.amd) { 9 // For AMD. Register as an anonymous module. 10 define([], factory.bind(root, root)); 11 } else { 12 // For browser globals (not exposing the function separately). 13 factory(root); 14 } 15}(typeof global != 'undefined' ? global : this, function(root) { 16 17 if (root.CSS && root.CSS.escape) { 18 return root.CSS.escape; 19 } 20 21 // https://drafts.csswg.org/cssom/#serialize-an-identifier 22 var cssEscape = function(value) { 23 if (arguments.length == 0) { 24 throw new TypeError('`CSS.escape` requires an argument.'); 25 } 26 var string = String(value); 27 var length = string.length; 28 var index = -1; 29 var codeUnit; 30 var result = ''; 31 var firstCodeUnit = string.charCodeAt(0); 32 while (++index < length) { 33 codeUnit = string.charCodeAt(index); 34 // Note: thereâs no need to special-case astral symbols, surrogate 35 // pairs, or lone surrogates. 36 37 // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER 38 // (U+FFFD). 39 if (codeUnit == 0x0000) { 40 result += '\uFFFD'; 41 continue; 42 } 43 44 if ( 45 // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is 46 // U+007F, [â¦] 47 (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || 48 // If the character is the first character and is in the range [0-9] 49 // (U+0030 to U+0039), [â¦] 50 (index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || 51 // If the character is the second character and is in the range [0-9] 52 // (U+0030 to U+0039) and the first character is a `-` (U+002D), [â¦] 53 ( 54 index == 1 && 55 codeUnit >= 0x0030 && codeUnit <= 0x0039 && 56 firstCodeUnit == 0x002D 57 ) 58 ) { 59 // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point 60 result += '\\' + codeUnit.toString(16) + ' '; 61 continue; 62 } 63 64 if ( 65 // If the character is the first character and is a `-` (U+002D), and 66 // there is no second character, [â¦] 67 index == 0 && 68 length == 1 && 69 codeUnit == 0x002D 70 ) { 71 result += '\\' + string.charAt(index); 72 continue; 73 } 74 75 // If the character is not handled by one of the above rules and is 76 // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or 77 // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to 78 // U+005A), or [a-z] (U+0061 to U+007A), [â¦] 79 if ( 80 codeUnit >= 0x0080 || 81 codeUnit == 0x002D || 82 codeUnit == 0x005F || 83 codeUnit >= 0x0030 && codeUnit <= 0x0039 || 84 codeUnit >= 0x0041 && codeUnit <= 0x005A || 85 codeUnit >= 0x0061 && codeUnit <= 0x007A 86 ) { 87 // the character itself 88 result += string.charAt(index); 89 continue; 90 } 91 92 // Otherwise, the escaped character. 93 // https://drafts.csswg.org/cssom/#escape-a-character 94 result += '\\' + string.charAt(index); 95 96 } 97 return result; 98 }; 99 100 if (!root.CSS) { 101 root.CSS = {}; 102 } 103 104 root.CSS.escape = cssEscape; 105 return cssEscape; 106 107})); 108 109/* Source and licensing information for the above line(s) can be found at https://www.oiv.int/core/assets/vendor/css-escape/css.escape.js. */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.