Socket
Socket
Sign inDemoInstall

@formatjs/intl-listformat

Package Overview
Dependencies
Maintainers
2
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/intl-listformat - npm Package Compare versions

Comparing version 1.3.7 to 1.4.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [1.4.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-listformat@1.3.7...@formatjs/intl-listformat@1.4.0) (2020-01-22)
### Features
* **@formatjs/intl-displaynames:** initial commit ([#469](https://github.com/formatjs/formatjs/issues/469)) ([137b994](https://github.com/formatjs/formatjs/commit/137b994846526b02de80b024c860b2771868f236))
## [1.3.7](https://github.com/formatjs/formatjs/compare/@formatjs/intl-listformat@1.3.6...@formatjs/intl-listformat@1.3.7) (2020-01-09)

@@ -8,0 +19,0 @@

16

dist/umd/intl-listformat.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.IntlRelativeTimeFormat = {}));
(global = global || self, factory(global.IntlListFormat = {}));
}(this, (function (exports) { 'use strict';

@@ -25,2 +25,12 @@

/**
* https://tc39.es/ecma262/#sec-tostring
*/
function toString(o) {
// Only symbol is irregular...
if (typeof o === 'symbol') {
throw TypeError('Cannot convert a Symbol value to a string');
}
return String(o);
}
/**
* https://tc39.es/ecma402/#sec-getoption

@@ -44,6 +54,6 @@ * @param opts

if (type === 'string') {
value = String(value);
value = toString(value);
}
if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {
throw new RangeError(value + " in not within " + values);
throw new RangeError(value + " is not within " + values.join(', '));
}

@@ -50,0 +60,0 @@ return value;

2

dist/umd/intl-listformat.min.js

@@ -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 _(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})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlListFormat={})}(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,o){var a=e[t];if(void 0===a)return o;if("boolean"!==r&&"string"!==r)throw new TypeError("invalid type");if("boolean"===r&&(a=Boolean(a)),"string"===r&&(a=function(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}(a)),void 0!==n&&!n.filter(function(e){return e==a}).length)throw new RangeError(a+" is not within "+n.join(", "));return a}function v(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 o=e.get(t);if(o)return r.reduce(function(e,t){return e[t]=o[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)}),a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e){var b=function(u){return function(e,t){for(var r={locale:""},n=0,o=t;n<o.length;n++){var a=o[n],l=a.replace(c,""),i=f(e,l);if(i)return r.locale=i,a!==l&&(r.extension=a.slice(l.length+1,a.length)),r}return r.locale=u(),r}}(e),L=function(u){return function(e,t){for(var r={locale:""},n=0,o=t;n<o.length;n++){var a=o[n],l=a.replace(c,""),i=f(e,l);if(i)return r.locale=i,a!==l&&(r.extension=a.slice(l.length+1,a.length)),r}return r.locale=u(),r}}(e);return function(e,t,r,n,o){for(var a,l=(a="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=o[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(a.extension){var y=A(a.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+"-",o=e.indexOf(n);if(-1!==o){for(var a=o+4,l=a,i=a,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(a,l)}if(n="-"+t,-1!==(o=e.indexOf(n))&&o+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 o(e,t){for(var r=[],n=0,o=t;n<o.length;n++){var a=f(e,o[n].replace(c,""));a&&r.push(a)}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 o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);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),o=0;for(t=0;t<r;t++)for(var a=arguments[t],l=0,i=a.length;l<i;l++,o++)n[o]=a[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 o=n[r];if("string"!=typeof o)throw new TypeError("array list["+e.indexOf(o)+"] is not type String");t.push(o)}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 o={type:"element",value:r[n-1]},a=n-2;0<=a;){o=L(l(e,t,0===a?"templateStart":a<n-2?"templateMiddle":"templateEnd"),{0:{type:"element",value:r[a]},1:o}),a--}return o}function L(e,t){for(var r=[],n=0,o=function(e){for(var t=[],r=e.indexOf("{"),n=0,o=0,a=e.length;r<e.length&&-1<r;)O(r<(n=e.indexOf("}",r)),"Invalid pattern "+e),o<r&&t.push({type:"literal",value:e.substring(o,r)}),t.push({type:e.substring(r+1,n),value:void 0}),o=n+1,r=e.indexOf("{",o);return o<a&&t.push({type:"literal",value:e.substring(o,a)}),t}(e);n<o.length;n++){var a=o[n],l=a.type;if("literal"===a.type)r.push({type:"literal",value:a.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=(w.prototype.format=function(e){d(this,"format");var t="",r=b(w.__INTERNAL_SLOT_MAP__,this,g(e));if(!Array.isArray(r))return r.value;for(var n=0,o=r;n<o.length;n++)t+=o[n].value;return t},w.prototype.formatToParts=function(e){d(this,"format");var t=b(w.__INTERNAL_SLOT_MAP__,this,g(e));if(!Array.isArray(t))return[t];for(var r=[],n=0,o=t;n<o.length;n++){var a=o[n];r.push(h({},a))}return r},w.prototype.resolvedOptions=function(){return d(this,"resolvedOptions"),{locale:l(w.__INTERNAL_SLOT_MAP__,this,"locale"),type:l(w.__INTERNAL_SLOT_MAP__,this,"type"),style:l(w.__INTERNAL_SLOT_MAP__,this,"style")}},w.supportedLocalesOf=function(e,t){return function(e,t,r){return void 0!==r&&p(r=s(r),"localeMatcher","string",["lookup","best fit"],"best fit"),o(e,t)}(w.availableLocales,m(e),t)},w.__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{w.localeData[e]=function(e,t,r){void 0===r&&(r=function(e,t){return a(a({},e),t)});var n=function(e,t,r){var n=[e];t[e]&&(e=t[e],n.push(e));var o=r[e];o&&n.push(o);for(var a=e.split("-"),l=a.length;1<l;l--)n.push(a.slice(0,l-1).join("-"));return n}(e,t.aliases,t.parentLocales),o=n.map(function(e){return t.data[e]}).filter(Boolean);if(!o.length)throw new i('Missing locale data for "'+e+'", lookup hierarchy: '+n.join(", "));return o.reverse(),o.reduce(r,{})}(e,t)}catch(e){}})},n=0,o=e;n<o.length;n++)r(o[n]);w.availableLocales=Object.keys(w.localeData),w.__defaultLocale||(w.__defaultLocale=w.availableLocales[0])},w.getDefaultLocale=function(){return w.__defaultLocale},w.localeData={},w.availableLocales=[],w.__defaultLocale="en",w.relevantExtensionKeys=[],w.polyfilled=!0,w.__INTERNAL_SLOT_MAP__=new WeakMap,w);function w(e,t){if(!(this&&this instanceof w?this.constructor:void 0))throw new TypeError("Intl.ListFormat must be called with 'new'");v(w.__INTERNAL_SLOT_MAP__,this,"initializedListFormat",!0);var r=m(e),n=Object.create(null),o=void 0===t?Object.create(null):s(t),a=p(o,"localeMatcher","string",["best fit","lookup"],"best fit");n.localeMatcher=a;var l=w.localeData,i=_(w.getDefaultLocale)(w.availableLocales,r,n,w.relevantExtensionKeys,l);v(w.__INTERNAL_SLOT_MAP__,this,"locale",i.locale);var u=p(o,"type","string",["conjunction","disjunction","unit"],"conjunction");v(w.__INTERNAL_SLOT_MAP__,this,"type",u);var c=p(o,"style","string",["long","short","narrow"],"long");v(w.__INTERNAL_SLOT_MAP__,this,"style",c);var f=l[i.dataLocale][u][c];v(w.__INTERNAL_SLOT_MAP__,this,"templatePair",f.pair),v(w.__INTERNAL_SLOT_MAP__,this,"templateStart",f.start),v(w.__INTERNAL_SLOT_MAP__,this,"templateMiddle",f.middle),v(w.__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

@@ -24,2 +24,12 @@ (function (factory) {

/**
* https://tc39.es/ecma262/#sec-tostring
*/
function toString(o) {
// Only symbol is irregular...
if (typeof o === 'symbol') {
throw TypeError('Cannot convert a Symbol value to a string');
}
return String(o);
}
/**
* https://tc39.es/ecma402/#sec-getoption

@@ -43,6 +53,6 @@ * @param opts

if (type === 'string') {
value = String(value);
value = toString(value);
}
if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {
throw new RangeError(value + " in not within " + values);
throw new RangeError(value + " is not within " + values.join(', '));
}

@@ -49,0 +59,0 @@ return value;

{
"name": "@formatjs/intl-listformat",
"version": "1.3.7",
"version": "1.4.0",
"description": "Formats JS list in a i18n-safe way",

@@ -21,6 +21,6 @@ "keywords": [

"devDependencies": {
"formatjs-extract-cldr-data": "^10.0.4"
"formatjs-extract-cldr-data": "^10.1.0"
},
"dependencies": {
"@formatjs/intl-utils": "^2.0.4"
"@formatjs/intl-utils": "^2.1.0"
},

@@ -48,3 +48,3 @@ "main": "dist/index.js",

"license": "MIT",
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c"
"gitHead": "86f218a78e66f003e35d4807842102d6ff670af9"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc