@formatjs/intl-listformat
Advanced tools
Comparing version 1.3.4 to 1.3.5
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.3.5](https://github.com/formatjs/formatjs/compare/@formatjs/intl-listformat@1.3.4...@formatjs/intl-listformat@1.3.5) (2020-01-06) | ||
### Bug Fixes | ||
* **@formatjs/intl-listformat:** don’t treat en-US-POSIX as en-US because they are different ([a37b091](https://github.com/formatjs/formatjs/commit/a37b091830ddc0ac9fd5771eb402f2b5c23c45f7)) | ||
## [1.3.4](https://github.com/formatjs/formatjs/compare/@formatjs/intl-listformat@1.3.3...@formatjs/intl-listformat@1.3.4) (2019-12-27) | ||
@@ -8,0 +19,0 @@ |
/* @generated */ | ||
// prettier-ignore | ||
if (Intl.ListFormat && typeof Intl.ListFormat.__addLocaleData === 'function') { | ||
Intl.ListFormat.__addLocaleData({"data":{"en-001":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"}},"disjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"}}},"en-150":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"}},"disjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"}}},"en-CA":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0} and {1}"}}},"en-IN":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0}, {1}"}}},"en":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, & {1}","pair":"{0} & {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"}},"disjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, or {1}","pair":"{0} or {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, or {1}","pair":"{0} or {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, or {1}","pair":"{0} or {1}"}},"unit":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"},"narrow":{"start":"{0} {1}","middle":"{0} {1}","end":"{0} {1}","pair":"{0} {1}"}}}},"availableLocales":["en-001","en-150","en-AE","en-AG","en-AI","en-AS","en-AT","en-AU","en-BB","en-BE","en-BI","en-BM","en-BS","en-BW","en-BZ","en-CA","en-CC","en-CH","en-CK","en-CM","en-CX","en-CY","en-DE","en-DG","en-DK","en-DM","en-ER","en-FI","en-FJ","en-FK","en-FM","en-GB","en-GD","en-GG","en-GH","en-GI","en-GM","en-GU","en-GY","en-HK","en-IE","en-IL","en-IM","en-IN","en-IO","en-JE","en-JM","en-KE","en-KI","en-KN","en-KY","en-LC","en-LR","en-LS","en-MG","en-MH","en-MO","en-MP","en-MS","en-MT","en-MU","en-MW","en-MY","en-NA","en-NF","en-NG","en-NL","en-NR","en-NU","en-NZ","en-PG","en-PH","en-PK","en-PN","en-PR","en-PW","en-RW","en-SB","en-SC","en-SD","en-SE","en-SG","en-SH","en-SI","en-SL","en-SS","en-SX","en-SZ","en-TC","en-TK","en-TO","en-TT","en-TV","en-TZ","en-UG","en-UM","en-US","en-VC","en-VG","en-VI","en-VU","en-WS","en-ZA","en-ZM","en-ZW","en"],"aliases":{},"parentLocales":{"en-150":"en-001","en-AG":"en-001","en-AI":"en-001","en-AU":"en-001","en-BB":"en-001","en-BM":"en-001","en-BS":"en-001","en-BW":"en-001","en-BZ":"en-001","en-CA":"en-001","en-CC":"en-001","en-CK":"en-001","en-CM":"en-001","en-CX":"en-001","en-CY":"en-001","en-DG":"en-001","en-DM":"en-001","en-ER":"en-001","en-FJ":"en-001","en-FK":"en-001","en-FM":"en-001","en-GB":"en-001","en-GD":"en-001","en-GG":"en-001","en-GH":"en-001","en-GI":"en-001","en-GM":"en-001","en-GY":"en-001","en-HK":"en-001","en-IE":"en-001","en-IL":"en-001","en-IM":"en-001","en-IN":"en-001","en-IO":"en-001","en-JE":"en-001","en-JM":"en-001","en-KE":"en-001","en-KI":"en-001","en-KN":"en-001","en-KY":"en-001","en-LC":"en-001","en-LR":"en-001","en-LS":"en-001","en-MG":"en-001","en-MO":"en-001","en-MS":"en-001","en-MT":"en-001","en-MU":"en-001","en-MW":"en-001","en-MY":"en-001","en-NA":"en-001","en-NF":"en-001","en-NG":"en-001","en-NR":"en-001","en-NU":"en-001","en-NZ":"en-001","en-PG":"en-001","en-PH":"en-001","en-PK":"en-001","en-PN":"en-001","en-PW":"en-001","en-RW":"en-001","en-SB":"en-001","en-SC":"en-001","en-SD":"en-001","en-SG":"en-001","en-SH":"en-001","en-SL":"en-001","en-SS":"en-001","en-SX":"en-001","en-SZ":"en-001","en-TC":"en-001","en-TK":"en-001","en-TO":"en-001","en-TT":"en-001","en-TV":"en-001","en-TZ":"en-001","en-UG":"en-001","en-VC":"en-001","en-VG":"en-001","en-VU":"en-001","en-WS":"en-001","en-ZA":"en-001","en-ZM":"en-001","en-ZW":"en-001","en-AT":"en-150","en-BE":"en-150","en-CH":"en-150","en-DE":"en-150","en-DK":"en-150","en-FI":"en-150","en-NL":"en-150","en-SE":"en-150","en-SI":"en-150"}}) | ||
Intl.ListFormat.__addLocaleData({"data":{"en-001":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"}},"disjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"}}},"en-150":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"}},"disjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} or {1}","pair":"{0} or {1}"}}},"en-CA":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0} and {1}"}}},"en-IN":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0} and {1}","pair":"{0} and {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0}, {1}"}}},"en":{"conjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, and {1}","pair":"{0} and {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, & {1}","pair":"{0} & {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"}},"disjunction":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, or {1}","pair":"{0} or {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, or {1}","pair":"{0} or {1}"},"narrow":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, or {1}","pair":"{0} or {1}"}},"unit":{"long":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"},"short":{"start":"{0}, {1}","middle":"{0}, {1}","end":"{0}, {1}","pair":"{0}, {1}"},"narrow":{"start":"{0} {1}","middle":"{0} {1}","end":"{0} {1}","pair":"{0} {1}"}}}},"availableLocales":["en-001","en-150","en-AE","en-AG","en-AI","en-AS","en-AT","en-AU","en-BB","en-BE","en-BI","en-BM","en-BS","en-BW","en-BZ","en-CA","en-CC","en-CH","en-CK","en-CM","en-CX","en-CY","en-DE","en-DG","en-DK","en-DM","en-ER","en-FI","en-FJ","en-FK","en-FM","en-GB","en-GD","en-GG","en-GH","en-GI","en-GM","en-GU","en-GY","en-HK","en-IE","en-IL","en-IM","en-IN","en-IO","en-JE","en-JM","en-KE","en-KI","en-KN","en-KY","en-LC","en-LR","en-LS","en-MG","en-MH","en-MO","en-MP","en-MS","en-MT","en-MU","en-MW","en-MY","en-NA","en-NF","en-NG","en-NL","en-NR","en-NU","en-NZ","en-PG","en-PH","en-PK","en-PN","en-PR","en-PW","en-RW","en-SB","en-SC","en-SD","en-SE","en-SG","en-SH","en-SI","en-SL","en-SS","en-SX","en-SZ","en-TC","en-TK","en-TO","en-TT","en-TV","en-TZ","en-UG","en-UM","en-US-POSIX","en-VC","en-VG","en-VI","en-VU","en-WS","en-ZA","en-ZM","en-ZW","en"],"aliases":{},"parentLocales":{"en-150":"en-001","en-AG":"en-001","en-AI":"en-001","en-AU":"en-001","en-BB":"en-001","en-BM":"en-001","en-BS":"en-001","en-BW":"en-001","en-BZ":"en-001","en-CA":"en-001","en-CC":"en-001","en-CK":"en-001","en-CM":"en-001","en-CX":"en-001","en-CY":"en-001","en-DG":"en-001","en-DM":"en-001","en-ER":"en-001","en-FJ":"en-001","en-FK":"en-001","en-FM":"en-001","en-GB":"en-001","en-GD":"en-001","en-GG":"en-001","en-GH":"en-001","en-GI":"en-001","en-GM":"en-001","en-GY":"en-001","en-HK":"en-001","en-IE":"en-001","en-IL":"en-001","en-IM":"en-001","en-IN":"en-001","en-IO":"en-001","en-JE":"en-001","en-JM":"en-001","en-KE":"en-001","en-KI":"en-001","en-KN":"en-001","en-KY":"en-001","en-LC":"en-001","en-LR":"en-001","en-LS":"en-001","en-MG":"en-001","en-MO":"en-001","en-MS":"en-001","en-MT":"en-001","en-MU":"en-001","en-MW":"en-001","en-MY":"en-001","en-NA":"en-001","en-NF":"en-001","en-NG":"en-001","en-NR":"en-001","en-NU":"en-001","en-NZ":"en-001","en-PG":"en-001","en-PH":"en-001","en-PK":"en-001","en-PN":"en-001","en-PW":"en-001","en-RW":"en-001","en-SB":"en-001","en-SC":"en-001","en-SD":"en-001","en-SG":"en-001","en-SH":"en-001","en-SL":"en-001","en-SS":"en-001","en-SX":"en-001","en-SZ":"en-001","en-TC":"en-001","en-TK":"en-001","en-TO":"en-001","en-TT":"en-001","en-TV":"en-001","en-TZ":"en-001","en-UG":"en-001","en-VC":"en-001","en-VG":"en-001","en-VU":"en-001","en-WS":"en-001","en-ZA":"en-001","en-ZM":"en-001","en-ZW":"en-001","en-AT":"en-150","en-BE":"en-150","en-CH":"en-150","en-DE":"en-150","en-DK":"en-150","en-FI":"en-150","en-NL":"en-150","en-SE":"en-150","en-SI":"en-150"}}) | ||
} |
@@ -53,6 +53,2 @@ (function (global, factory) { | ||
function setInternalSlot(map, pl, field, value) { | ||
var _a; | ||
setMultiInternalSlots(map, pl, (_a = {}, _a[field] = value, _a)); | ||
} | ||
function setMultiInternalSlots(map, pl, props) { | ||
if (!map.get(pl)) { | ||
@@ -62,3 +58,3 @@ map.set(pl, Object.create(null)); | ||
var slots = map.get(pl); | ||
Object.assign(slots, props); | ||
slots[field] = value; | ||
} | ||
@@ -80,3 +76,3 @@ function getInternalSlot(map, pl, field) { | ||
return all; | ||
}, {}); | ||
}, Object.create(null)); | ||
} | ||
@@ -83,0 +79,0 @@ function isLiteralPart(patternPart) { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlRelativeTimeFormat={})}(this,function(e){"use strict";function O(e,t,r){if(void 0===r&&(r=Error),!e)throw new r(t)}function s(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function p(e,t,r,n,a){var o=e[t];if(void 0===o)return a;if("boolean"!==r&&"string"!==r)throw new TypeError("invalid type");if("boolean"===r&&(o=Boolean(o)),"string"===r&&(o=String(o)),void 0!==n&&!n.filter(function(e){return e==o}).length)throw new RangeError(o+" in not within "+n);return o}function v(e,t,r,n){var a;!function(e,t,r){e.get(t)||e.set(t,Object.create(null));var n=e.get(t);Object.assign(n,r)}(e,t,((a={})[r]=n,a))}function l(e,t,r){return function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=e.get(t);if(a)return r.reduce(function(e,t){return e[t]=a[t],e},{});throw new TypeError(t+" InternalSlot has not been initialized")}(e,t,r)[r]}function m(e){var t=Intl.getCanonicalLocales;return"function"==typeof t?t(e):Intl.NumberFormat.supportedLocalesOf(e||"")}var n,t=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function _(e){var b=function(u){return function(e,t){for(var r={locale:""},n=0,a=t;n<a.length;n++){var o=a[n],l=o.replace(c,""),i=f(e,l);if(i)return r.locale=i,o!==l&&(r.extension=o.slice(l.length+1,o.length)),r}return r.locale=u(),r}}(e),L=function(u){return function(e,t){for(var r={locale:""},n=0,a=t;n<a.length;n++){var o=a[n],l=o.replace(c,""),i=f(e,l);if(i)return r.locale=i,o!==l&&(r.extension=o.slice(l.length+1,o.length)),r}return r.locale=u(),r}}(e);return function(e,t,r,n,a){for(var o,l=(o="lookup"===r.localeMatcher?b(e,t):L(e,t)).locale,i={locale:"",dataLocale:l},u="-u",c=0,f=n;c<f.length;c++){var s=f[c],p=a[l];O("object"==typeof p&&null!==p,"locale data "+s+" must be an object");var v=p[s];O(Array.isArray(v),"keyLocaleData for "+s+" must be an array");var _=v[0];O("string"==typeof _||null===_,"value must be string or null");var h="";if(o.extension){var y=A(o.extension,s);void 0!==y&&(""!==y?~v.indexOf(y)&&(h="-"+s+"-"+(_=y)):~y.indexOf("true")&&(_="true",h="-"+s))}if(s in r){var d=r[s];O("string"==typeof d||null==d,"optionsValue must be String, Undefined or Null"),~v.indexOf(d)&&d!==_&&(_=d,h="")}i[s]=_,u+=h}if(2<u.length){var g=l.indexOf("-x-");if(-1===g)l+=u;else l=l.slice(0,g)+u+l.slice(g,l.length);l=m(l)[0]}return i.locale=l,i}}function A(e,t){O(2===t.length,"key must have 2 elements");var r=e.length,n="-"+t+"-",a=e.indexOf(n);if(-1!==a){for(var o=a+4,l=o,i=o,u=!1;!u;){var c=e.indexOf("-",i);2===(-1===c?r-i:c-i)?u=!0:-1===c?(l=r,u=!0):i=(l=c)+1}return e.slice(o,l)}if(n="-"+t,-1!==(a=e.indexOf(n))&&a+3===r)return""}var c=/-u(?:-[0-9a-z]{2,8})+/gi;function f(e,t){for(var r=t;;){if(~e.indexOf(r))return r;var n=r.lastIndexOf("-");if(!~n)return;2<=n&&"-"===r[n-2]&&(n-=2),r=r.slice(0,n)}}function a(e,t){for(var r=[],n=0,a=t;n<a.length;n++){var o=f(e,a[n].replace(c,""));o&&r.push(o)}return r}var r,i=(r=Error,t(u,r),u);function u(){var e=null!==r&&r.apply(this,arguments)||this;return e.type="MISSING_LOCALE_DATA",e}var h=function(){return(h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},y=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var o=arguments[t],l=0,i=o.length;l<i;l++,a++)n[a]=o[l];return n};function d(e,t){if(!(e instanceof T))throw new TypeError("Method Intl.ListFormat.prototype."+t+" called on incompatible receiver "+String(e))}function g(e){if(void 0===e)return[];for(var t=[],r=0,n=e;r<n.length;r++){var a=n[r];if("string"!=typeof a)throw new TypeError("array list["+e.indexOf(a)+"] is not type String");t.push(a)}return t}function b(e,t,r){var n=r.length;if(0===n)return[];if(2===n)return L(l(e,t,"templatePair"),{0:{type:"element",value:r[0]},1:{type:"element",value:r[1]}});for(var a={type:"element",value:r[n-1]},o=n-2;0<=o;){a=L(l(e,t,0===o?"templateStart":o<n-2?"templateMiddle":"templateEnd"),{0:{type:"element",value:r[o]},1:a}),o--}return a}function L(e,t){for(var r=[],n=0,a=function(e){for(var t=[],r=e.indexOf("{"),n=0,a=0,o=e.length;r<e.length&&-1<r;)O(r<(n=e.indexOf("}",r)),"Invalid pattern "+e),a<r&&t.push({type:"literal",value:e.substring(a,r)}),t.push({type:e.substring(r+1,n),value:void 0}),a=n+1,r=e.indexOf("{",a);return a<o&&t.push({type:"literal",value:e.substring(a,o)}),t}(e);n<a.length;n++){var o=a[n],l=o.type;if("literal"===o.type)r.push({type:"literal",value:o.value});else{O(l in t,l+" is missing from placables");var i=t[l];Array.isArray(i)?r.push.apply(r,i):r.push(i)}}return r}var T=(N.prototype.format=function(e){d(this,"format");var t="",r=b(N.__INTERNAL_SLOT_MAP__,this,g(e));if(!Array.isArray(r))return r.value;for(var n=0,a=r;n<a.length;n++)t+=a[n].value;return t},N.prototype.formatToParts=function(e){d(this,"format");var t=b(N.__INTERNAL_SLOT_MAP__,this,g(e));if(!Array.isArray(t))return[t];for(var r=[],n=0,a=t;n<a.length;n++){var o=a[n];r.push(h({},o))}return r},N.prototype.resolvedOptions=function(){return d(this,"resolvedOptions"),{locale:l(N.__INTERNAL_SLOT_MAP__,this,"locale"),type:l(N.__INTERNAL_SLOT_MAP__,this,"type"),style:l(N.__INTERNAL_SLOT_MAP__,this,"style")}},N.supportedLocalesOf=function(e,t){return function(e,t,r){return void 0!==r&&p(r=s(r),"localeMatcher","string",["lookup","best fit"],"best fit"),a(e,t)}(N.availableLocales,m(e),t)},N.__addLocaleData=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=function(t){Object.keys(y(t.availableLocales,Object.keys(t.aliases),Object.keys(t.parentLocales)).reduce(function(e,t){return e[t]=!0,e},{})).forEach(function(e){try{N.localeData[e]=function(e,t,r){void 0===r&&(r=function(e,t){return o(o({},e),t)});var n=function(e,t,r){var n=[e];t[e]&&(e=t[e],n.push(e));var a=r[e];a&&n.push(a);for(var o=e.split("-"),l=o.length;1<l;l--)n.push(o.slice(0,l-1).join("-"));return n}(e,t.aliases,t.parentLocales),a=n.map(function(e){return t.data[e]}).filter(Boolean);if(!a.length)throw new i('Missing locale data for "'+e+'", lookup hierarchy: '+n.join(", "));return a.reverse(),a.reduce(r,{})}(e,t)}catch(e){}})},n=0,a=e;n<a.length;n++)r(a[n]);N.availableLocales=Object.keys(N.localeData),N.__defaultLocale||(N.__defaultLocale=N.availableLocales[0])},N.getDefaultLocale=function(){return N.__defaultLocale},N.localeData={},N.availableLocales=[],N.__defaultLocale="en",N.relevantExtensionKeys=[],N.polyfilled=!0,N.__INTERNAL_SLOT_MAP__=new WeakMap,N);function N(e,t){if(!(this&&this instanceof N?this.constructor:void 0))throw new TypeError("Intl.ListFormat must be called with 'new'");v(N.__INTERNAL_SLOT_MAP__,this,"initializedListFormat",!0);var r=m(e),n=Object.create(null),a=void 0===t?Object.create(null):s(t),o=p(a,"localeMatcher","string",["best fit","lookup"],"best fit");n.localeMatcher=o;var l=N.localeData,i=_(N.getDefaultLocale)(N.availableLocales,r,n,N.relevantExtensionKeys,l);v(N.__INTERNAL_SLOT_MAP__,this,"locale",i.locale);var u=p(a,"type","string",["conjunction","disjunction","unit"],"conjunction");v(N.__INTERNAL_SLOT_MAP__,this,"type",u);var c=p(a,"style","string",["long","short","narrow"],"long");v(N.__INTERNAL_SLOT_MAP__,this,"style",c);var f=l[i.dataLocale][u][c];v(N.__INTERNAL_SLOT_MAP__,this,"templatePair",f.pair),v(N.__INTERNAL_SLOT_MAP__,this,"templateStart",f.start),v(N.__INTERNAL_SLOT_MAP__,this,"templateMiddle",f.middle),v(N.__INTERNAL_SLOT_MAP__,this,"templateEnd",f.end)}try{"undefined"!=typeof Symbol&&Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"Intl.ListFormat",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype.constructor,"length",{value:0,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(T.supportedLocalesOf,"length",{value:1,writable:!1,enumerable:!1,configurable:!0})}catch(e){}e.default=T,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlRelativeTimeFormat={})}(this,function(e){"use strict";function O(e,t,r){if(void 0===r&&(r=Error),!e)throw new r(t)}function s(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function p(e,t,r,n,a){var o=e[t];if(void 0===o)return a;if("boolean"!==r&&"string"!==r)throw new TypeError("invalid type");if("boolean"===r&&(o=Boolean(o)),"string"===r&&(o=String(o)),void 0!==n&&!n.filter(function(e){return e==o}).length)throw new RangeError(o+" in not within "+n);return o}function _(e,t,r,n){e.get(t)||e.set(t,Object.create(null)),e.get(t)[r]=n}function l(e,t,r){return function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=e.get(t);if(a)return r.reduce(function(e,t){return e[t]=a[t],e},Object.create(null));throw new TypeError(t+" InternalSlot has not been initialized")}(e,t,r)[r]}function m(e){var t=Intl.getCanonicalLocales;return"function"==typeof t?t(e):Intl.NumberFormat.supportedLocalesOf(e||"")}var n,t=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function v(e){var b=function(u){return function(e,t){for(var r={locale:""},n=0,a=t;n<a.length;n++){var o=a[n],l=o.replace(c,""),i=f(e,l);if(i)return r.locale=i,o!==l&&(r.extension=o.slice(l.length+1,o.length)),r}return r.locale=u(),r}}(e),L=function(u){return function(e,t){for(var r={locale:""},n=0,a=t;n<a.length;n++){var o=a[n],l=o.replace(c,""),i=f(e,l);if(i)return r.locale=i,o!==l&&(r.extension=o.slice(l.length+1,o.length)),r}return r.locale=u(),r}}(e);return function(e,t,r,n,a){for(var o,l=(o="lookup"===r.localeMatcher?b(e,t):L(e,t)).locale,i={locale:"",dataLocale:l},u="-u",c=0,f=n;c<f.length;c++){var s=f[c],p=a[l];O("object"==typeof p&&null!==p,"locale data "+s+" must be an object");var _=p[s];O(Array.isArray(_),"keyLocaleData for "+s+" must be an array");var v=_[0];O("string"==typeof v||null===v,"value must be string or null");var h="";if(o.extension){var y=A(o.extension,s);void 0!==y&&(""!==y?~_.indexOf(y)&&(h="-"+s+"-"+(v=y)):~y.indexOf("true")&&(v="true",h="-"+s))}if(s in r){var d=r[s];O("string"==typeof d||null==d,"optionsValue must be String, Undefined or Null"),~_.indexOf(d)&&d!==v&&(v=d,h="")}i[s]=v,u+=h}if(2<u.length){var g=l.indexOf("-x-");if(-1===g)l+=u;else l=l.slice(0,g)+u+l.slice(g,l.length);l=m(l)[0]}return i.locale=l,i}}function A(e,t){O(2===t.length,"key must have 2 elements");var r=e.length,n="-"+t+"-",a=e.indexOf(n);if(-1!==a){for(var o=a+4,l=o,i=o,u=!1;!u;){var c=e.indexOf("-",i);2===(-1===c?r-i:c-i)?u=!0:-1===c?(l=r,u=!0):i=(l=c)+1}return e.slice(o,l)}if(n="-"+t,-1!==(a=e.indexOf(n))&&a+3===r)return""}var c=/-u(?:-[0-9a-z]{2,8})+/gi;function f(e,t){for(var r=t;;){if(~e.indexOf(r))return r;var n=r.lastIndexOf("-");if(!~n)return;2<=n&&"-"===r[n-2]&&(n-=2),r=r.slice(0,n)}}function a(e,t){for(var r=[],n=0,a=t;n<a.length;n++){var o=f(e,a[n].replace(c,""));o&&r.push(o)}return r}var r,i=(r=Error,t(u,r),u);function u(){var e=null!==r&&r.apply(this,arguments)||this;return e.type="MISSING_LOCALE_DATA",e}var h=function(){return(h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},y=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var o=arguments[t],l=0,i=o.length;l<i;l++,a++)n[a]=o[l];return n};function d(e,t){if(!(e instanceof T))throw new TypeError("Method Intl.ListFormat.prototype."+t+" called on incompatible receiver "+String(e))}function g(e){if(void 0===e)return[];for(var t=[],r=0,n=e;r<n.length;r++){var a=n[r];if("string"!=typeof a)throw new TypeError("array list["+e.indexOf(a)+"] is not type String");t.push(a)}return t}function b(e,t,r){var n=r.length;if(0===n)return[];if(2===n)return L(l(e,t,"templatePair"),{0:{type:"element",value:r[0]},1:{type:"element",value:r[1]}});for(var a={type:"element",value:r[n-1]},o=n-2;0<=o;){a=L(l(e,t,0===o?"templateStart":o<n-2?"templateMiddle":"templateEnd"),{0:{type:"element",value:r[o]},1:a}),o--}return a}function L(e,t){for(var r=[],n=0,a=function(e){for(var t=[],r=e.indexOf("{"),n=0,a=0,o=e.length;r<e.length&&-1<r;)O(r<(n=e.indexOf("}",r)),"Invalid pattern "+e),a<r&&t.push({type:"literal",value:e.substring(a,r)}),t.push({type:e.substring(r+1,n),value:void 0}),a=n+1,r=e.indexOf("{",a);return a<o&&t.push({type:"literal",value:e.substring(a,o)}),t}(e);n<a.length;n++){var o=a[n],l=o.type;if("literal"===o.type)r.push({type:"literal",value:o.value});else{O(l in t,l+" is missing from placables");var i=t[l];Array.isArray(i)?r.push.apply(r,i):r.push(i)}}return r}var T=(N.prototype.format=function(e){d(this,"format");var t="",r=b(N.__INTERNAL_SLOT_MAP__,this,g(e));if(!Array.isArray(r))return r.value;for(var n=0,a=r;n<a.length;n++)t+=a[n].value;return t},N.prototype.formatToParts=function(e){d(this,"format");var t=b(N.__INTERNAL_SLOT_MAP__,this,g(e));if(!Array.isArray(t))return[t];for(var r=[],n=0,a=t;n<a.length;n++){var o=a[n];r.push(h({},o))}return r},N.prototype.resolvedOptions=function(){return d(this,"resolvedOptions"),{locale:l(N.__INTERNAL_SLOT_MAP__,this,"locale"),type:l(N.__INTERNAL_SLOT_MAP__,this,"type"),style:l(N.__INTERNAL_SLOT_MAP__,this,"style")}},N.supportedLocalesOf=function(e,t){return function(e,t,r){return void 0!==r&&p(r=s(r),"localeMatcher","string",["lookup","best fit"],"best fit"),a(e,t)}(N.availableLocales,m(e),t)},N.__addLocaleData=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=function(t){Object.keys(y(t.availableLocales,Object.keys(t.aliases),Object.keys(t.parentLocales)).reduce(function(e,t){return e[t]=!0,e},{})).forEach(function(e){try{N.localeData[e]=function(e,t,r){void 0===r&&(r=function(e,t){return o(o({},e),t)});var n=function(e,t,r){var n=[e];t[e]&&(e=t[e],n.push(e));var a=r[e];a&&n.push(a);for(var o=e.split("-"),l=o.length;1<l;l--)n.push(o.slice(0,l-1).join("-"));return n}(e,t.aliases,t.parentLocales),a=n.map(function(e){return t.data[e]}).filter(Boolean);if(!a.length)throw new i('Missing locale data for "'+e+'", lookup hierarchy: '+n.join(", "));return a.reverse(),a.reduce(r,{})}(e,t)}catch(e){}})},n=0,a=e;n<a.length;n++)r(a[n]);N.availableLocales=Object.keys(N.localeData),N.__defaultLocale||(N.__defaultLocale=N.availableLocales[0])},N.getDefaultLocale=function(){return N.__defaultLocale},N.localeData={},N.availableLocales=[],N.__defaultLocale="en",N.relevantExtensionKeys=[],N.polyfilled=!0,N.__INTERNAL_SLOT_MAP__=new WeakMap,N);function N(e,t){if(!(this&&this instanceof N?this.constructor:void 0))throw new TypeError("Intl.ListFormat must be called with 'new'");_(N.__INTERNAL_SLOT_MAP__,this,"initializedListFormat",!0);var r=m(e),n=Object.create(null),a=void 0===t?Object.create(null):s(t),o=p(a,"localeMatcher","string",["best fit","lookup"],"best fit");n.localeMatcher=o;var l=N.localeData,i=v(N.getDefaultLocale)(N.availableLocales,r,n,N.relevantExtensionKeys,l);_(N.__INTERNAL_SLOT_MAP__,this,"locale",i.locale);var u=p(a,"type","string",["conjunction","disjunction","unit"],"conjunction");_(N.__INTERNAL_SLOT_MAP__,this,"type",u);var c=p(a,"style","string",["long","short","narrow"],"long");_(N.__INTERNAL_SLOT_MAP__,this,"style",c);var f=l[i.dataLocale][u][c];_(N.__INTERNAL_SLOT_MAP__,this,"templatePair",f.pair),_(N.__INTERNAL_SLOT_MAP__,this,"templateStart",f.start),_(N.__INTERNAL_SLOT_MAP__,this,"templateMiddle",f.middle),_(N.__INTERNAL_SLOT_MAP__,this,"templateEnd",f.end)}try{"undefined"!=typeof Symbol&&Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"Intl.ListFormat",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype.constructor,"length",{value:0,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(T.supportedLocalesOf,"length",{value:1,writable:!1,enumerable:!1,configurable:!0})}catch(e){}e.default=T,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=intl-listformat.min.js.map |
@@ -52,6 +52,2 @@ (function (factory) { | ||
function setInternalSlot(map, pl, field, value) { | ||
var _a; | ||
setMultiInternalSlots(map, pl, (_a = {}, _a[field] = value, _a)); | ||
} | ||
function setMultiInternalSlots(map, pl, props) { | ||
if (!map.get(pl)) { | ||
@@ -61,3 +57,3 @@ map.set(pl, Object.create(null)); | ||
var slots = map.get(pl); | ||
Object.assign(slots, props); | ||
slots[field] = value; | ||
} | ||
@@ -79,3 +75,3 @@ function getInternalSlot(map, pl, field) { | ||
return all; | ||
}, {}); | ||
}, Object.create(null)); | ||
} | ||
@@ -82,0 +78,0 @@ function isLiteralPart(patternPart) { |
{ | ||
"name": "@formatjs/intl-listformat", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "Formats JS list in a i18n-safe way", | ||
@@ -21,6 +21,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"formatjs-extract-cldr-data": "^10.0.1" | ||
"formatjs-extract-cldr-data": "^10.0.2" | ||
}, | ||
"dependencies": { | ||
"@formatjs/intl-utils": "^2.0.1" | ||
"@formatjs/intl-utils": "^2.0.2" | ||
}, | ||
@@ -48,3 +48,3 @@ "main": "dist/index.js", | ||
"license": "MIT", | ||
"gitHead": "3f4ea0305b68d709d5a5bf9570a99ba6d103f545" | ||
"gitHead": "4143ae3da624e6f117d177cee70e57dac5444bd0" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4529065
12258
Updated@formatjs/intl-utils@^2.0.2