vendor: 4,996 bytes, lines 1-7
1/** 2 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. 3 * Original file: /npm/@formatjs/[email protected]/lib/index.js 4 * 5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 */ 7import{__assign as e}from"tslib";var n=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function t(e){var t={};return e.replace(n,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"long":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var r=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function i(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var n=[],t=0,i=e.split(r).filter((function(e){return e.length>0}));t<i.length;t++){var o=i[t].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var a=o[0],s=o.slice(1),c=0,u=s;c<u.length;c++){if(0===u[c].length)throw new Error("Invalid number skeleton")}n.push({stem:a,options:s})}return n}var o=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,a=/^(@+)?(\+|#+)?[rs]?$/g,s=/(\*)(0+)|(#+)(0+)|(0+)/g,c=/^(0+)$/;function u(e){var n={};return"r"===e[e.length-1]?n.roundingPriority="morePrecision":"s"===e[e.length-1]&&(n.roundingPriority="lessPrecision"),e.replace(a,(function(e,t,r){return"string"!=typeof r?(n.minimumSignificantDigits=t.length,n.maximumSignificantDigits=t.length):"+"===r?n.minimumSignificantDigits=t.length:"#"===t[0]?n.maximumSignificantDigits=t.length:(n.minimumSignificantDigits=t.length,n.maximumSignificantDigits=t.length+("string"==typeof r?r.length:0)),""})),n}function g(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function l(e){var n;if("E"===e[0]&&"E"===e[1]?(n={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(n={notation:"scientific"},e=e.slice(1)),n){var t=e.slice(0,2);if("+!"===t?(n.signDisplay="always",e=e.slice(2)):"+?"===t&&(n.signDisplay="exceptZero",e=e.slice(2)),!c.test(e))throw new Error("Malformed concise eng/scientific notation");n.minimumIntegerDigits=e.length}return n}function p(e){var n=g(e);return n||{}}function m(n){for(var t={},r=0,i=n;r<i.length;r++){var m=i[r];switch(m.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=m.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=m.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;
vendor: 2,312 bytes, line 7
7case"scientific":t=e(e(e({},t),{notation:"scientific"}),m.options.reduce((function(n,t){return e(e({},n),p(t))}),{}));continue;case"engineering":t=e(e(e({},t),{notation:"engineering"}),m.options.reduce((function(n,t){return e(e({},n),p(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(m.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(m.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");m.options[0].replace(s,(function(e,n,r,i,o,a){if(n)t.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(c.test(m.stem))t.minimumIntegerDigits=m.stem.length;else if(o.test(m.stem)){if(m.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");m.stem.replace(o,(function(e,n,r,i,o,a){return"*"===r?t.minimumFractionDigits=n.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&a?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var h=m.options[0];"w"===h?t=e(e({},t),{trailingZeroDisplay:"stripIfInteger"}):h&&(t=e(e({},t),u(h)))}else if(a.test(m.stem))t=e(e({},t),u(m.stem));else{var d=g(m.stem);d&&(t=e(e({},t),d));var w=l(m.stem);w&&(t=e(e({},t),w))}}return t}export{t as parseDateTimeSkeleton,m as parseNumberSkeleton,i as parseNumberSkeletonFromString};export default null;
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.