@nosto/search-js 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/currencies.cjs.js +1 -1
- package/dist/currencies.es.js +1 -1
- package/package.json +3 -3
package/dist/currencies.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index.es-D_7T9vdv.cjs"),g={defaultCurrency:"EUR",defaultLocale:"en-US",currencySettings:{}},p={EUR:"de-DE",GBP:"en-GB",USD:"en-US",AUD:"en-AU",CAD:"en-CA",INR:"en-IN",AFN:"en-IN",BDT:"en-IN",BTN:"en-IN",MMK:"en-IN",NPR:"en-IN",PKR:"en-IN"};function d(o={}){const u={...g,...o};o.currencySettings||y.s(c=>{u.currencySettings=c.internal.getSettings().currencySettings});function a(c,n){const{defaultCurrency:t,currencySettings:e,defaultLocale:i}=u,s=n??t,m=p[s]??i;if(s in e){const r=e[s],l=new Intl.NumberFormat(m,{useGrouping:!!r.groupingSeparator,minimumFractionDigits:r.decimalPlaces,maximumFractionDigits:r.decimalPlaces}).formatToParts(c).map(f=>f.type==="group"?r.groupingSeparator:f.type==="decimal"?r.decimalCharacter:f.value).join("");return r!=null&&r.currencyBeforeAmount?`${r.currencyToken}${l}`:`${l}${r==null?void 0:r.currencyToken}`}return new Intl.NumberFormat(m,{style:"currency",currency:s}).format(c)}return{formatCurrency:a}}function C(o){const{formatCurrency:u}=d(o);function a(n,t){const e={};return n.price!==void 0&&(e.priceText=u(n.price,t)),n.listPrice!==void 0&&(e.listPriceText=u(n.listPrice,t)),Object.assign({},n,e)}function c(n){return n.price!==void 0||n.listPrice!==void 0}return function(t){if(!c(t))return t;const e=a(t,t.priceCurrencyCode);return e.skus&&e.skus.some(c)&&(e.skus=e.skus.map(i=>c(i)?a(i,t.priceCurrencyCode):i)),e}}exports.getCurrencyFormatting=d;exports.priceDecorator=C;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index.es-D_7T9vdv.cjs"),g={defaultCurrency:"EUR",defaultLocale:"en-US",currencySettings:{}},p={EUR:"de-DE",GBP:"en-GB",USD:"en-US",AUD:"en-AU",CAD:"en-CA",INR:"en-IN",AFN:"en-IN",BDT:"en-IN",BTN:"en-IN",MMK:"en-IN",NPR:"en-IN",PKR:"en-IN"};function d(o={}){const u={...g,...o};o.currencySettings||y.s(c=>{u.currencySettings=c.internal.getSettings().currencySettings??{}});function a(c,n){const{defaultCurrency:t,currencySettings:e,defaultLocale:i}=u,s=n??t,m=p[s]??i;if(s in e){const r=e[s],l=new Intl.NumberFormat(m,{useGrouping:!!r.groupingSeparator,minimumFractionDigits:r.decimalPlaces,maximumFractionDigits:r.decimalPlaces}).formatToParts(c).map(f=>f.type==="group"?r.groupingSeparator:f.type==="decimal"?r.decimalCharacter:f.value).join("");return r!=null&&r.currencyBeforeAmount?`${r.currencyToken}${l}`:`${l}${r==null?void 0:r.currencyToken}`}return new Intl.NumberFormat(m,{style:"currency",currency:s}).format(c)}return{formatCurrency:a}}function C(o){const{formatCurrency:u}=d(o);function a(n,t){const e={};return n.price!==void 0&&(e.priceText=u(n.price,t)),n.listPrice!==void 0&&(e.listPriceText=u(n.listPrice,t)),Object.assign({},n,e)}function c(n){return n.price!==void 0||n.listPrice!==void 0}return function(t){if(!c(t))return t;const e=a(t,t.priceCurrencyCode);return e.skus&&e.skus.some(c)&&(e.skus=e.skus.map(i=>c(i)?a(i,t.priceCurrencyCode):i)),e}}exports.getCurrencyFormatting=d;exports.priceDecorator=C;
|
package/dist/currencies.es.js
CHANGED
|
@@ -25,7 +25,7 @@ function g(o = {}) {
|
|
|
25
25
|
...o
|
|
26
26
|
};
|
|
27
27
|
o.currencySettings || d((c) => {
|
|
28
|
-
u.currencySettings = c.internal.getSettings().currencySettings;
|
|
28
|
+
u.currencySettings = c.internal.getSettings().currencySettings ?? {};
|
|
29
29
|
});
|
|
30
30
|
function a(c, n) {
|
|
31
31
|
const { defaultCurrency: t, currencySettings: e, defaultLocale: i } = u, s = n ?? t, m = p[s] ?? i;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosto/search-js",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@nosto/nosto-js": "^1.4.4",
|
|
46
46
|
"@testing-library/dom": "^10.4.0",
|
|
47
47
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
48
|
-
"@types/node": "^22.
|
|
48
|
+
"@types/node": "^22.13.0",
|
|
49
49
|
"copyfiles": "^2.4.1",
|
|
50
50
|
"eslint": "^9.19.0",
|
|
51
51
|
"eslint-config-prettier": "^10.0.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typescript": "^5.7.3",
|
|
58
58
|
"typescript-eslint": "^8.22.0",
|
|
59
59
|
"vite": "^6.0.11",
|
|
60
|
-
"vitest": "^3.0.
|
|
60
|
+
"vitest": "^3.0.5"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|