@ancon/wildcat-utils 1.53.0-check-optimizations.1 → 1.53.0

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.
@@ -1,5 +1,5 @@
1
1
  import { IETFLanguageTag as r } from "@ancon/wildcat-types";
2
- function m(e) {
2
+ function u(e) {
3
3
  switch (e) {
4
4
  case "sv":
5
5
  return r.Swedish;
@@ -11,47 +11,43 @@ function m(e) {
11
11
  return null;
12
12
  }
13
13
  }
14
- function u(e, a) {
15
- var t, i;
16
- if (e) {
17
- const c = e, n = (t = e.localizedProductNames) == null ? void 0 : t[a], o = (i = e.localizedVariantNames) == null ? void 0 : i[a];
18
- return n && (c.productName = n), o && (c.variantName = o), c;
19
- }
20
- return e;
14
+ function d(e, c) {
15
+ var i, n;
16
+ const t = e, a = (i = e.localizedProductNames) == null ? void 0 : i[c], o = (n = e.localizedVariantNames) == null ? void 0 : n[c];
17
+ return a && (t.productName = a), o && (t.variantName = o), t;
21
18
  }
22
- function s(e, a) {
23
- var n, o;
24
- const t = e, i = (n = e.localizedNames) == null ? void 0 : n[a], c = (o = e.localizedReplacementNames) == null ? void 0 : o[a];
25
- return i && (t.name = i), c && (t.replacementName = c), t;
19
+ function m(e, c) {
20
+ var i, n;
21
+ const t = e, a = (i = e.localizedNames) == null ? void 0 : i[c], o = (n = e.localizedReplacementNames) == null ? void 0 : n[c];
22
+ return a && (t.name = a), o && (t.replacementName = o), t;
26
23
  }
27
- function f(e, a) {
24
+ function f(e, c) {
28
25
  const t = e;
29
- return t.product = u(
26
+ return t.product = d(
30
27
  e.product,
31
- a
28
+ c
32
29
  ), t;
33
30
  }
34
- function d(e, a) {
35
- const t = e, { product: i, modifications: c, addOnProducts: n, subCheckItems: o } = e;
36
- return t.product = u(i, a), c != null && c.length && (t.modifications = c.map(
37
- (l) => s(l, a)
38
- )), n != null && n.length && (t.addOnProducts = n == null ? void 0 : n.map(
39
- (l) => f(l, a)
40
- )), o != null && o.length && (t.subCheckItems = o.map(
41
- (l) => d(l, a)
31
+ function s(e, c) {
32
+ const t = e, { product: a, modifications: o, addOnProducts: i, subCheckItems: n } = e;
33
+ return t.product = d(a, c), o.length && (t.modifications = o.map(
34
+ (l) => m(l, c)
35
+ )), i != null && i.length && (t.addOnProducts = i.map(
36
+ (l) => f(l, c)
37
+ )), n.length && (t.subCheckItems = n.map(
38
+ (l) => s(l, c)
42
39
  )), t;
43
40
  }
44
- function N(e, a) {
45
- var i;
46
- const t = m(a);
41
+ function p(e, c) {
42
+ const t = u(c);
47
43
  if (t) {
48
- const c = e;
49
- return c.items = (i = e.items) == null ? void 0 : i.map(
50
- (n) => d(n, t)
51
- ), c;
44
+ const a = e;
45
+ return a.items = e.items.map(
46
+ (o) => s(o, t)
47
+ ), a;
52
48
  }
53
49
  return e;
54
50
  }
55
51
  export {
56
- N as default
52
+ p as default
57
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.53.0-check-optimizations.1",
3
+ "version": "1.53.0",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "types": "index.d.ts",
@@ -400,6 +400,11 @@
400
400
  "require": "./currency/index.js",
401
401
  "types": "./currency/index.d.ts"
402
402
  },
403
+ "./currency/placeCurrencySymbol": {
404
+ "import": "./currency/placeCurrencySymbol.mjs",
405
+ "require": "./currency/placeCurrencySymbol.js",
406
+ "types": "./currency/placeCurrencySymbol.d.ts"
407
+ },
403
408
  "./date/convertToLocalTimezone": {
404
409
  "import": "./date/convertToLocalTimezone.mjs",
405
410
  "require": "./date/convertToLocalTimezone.js",
@@ -1 +1,6 @@
1
- export default function base64Encode(str: string): string;
1
+ declare type Base64EncodeOptions = {
2
+ urlSafe?: boolean;
3
+ padding?: 'omit' | 'encode';
4
+ };
5
+ export default function base64Encode(str: string, options?: Base64EncodeOptions): string;
6
+ export {};
@@ -1 +1 @@
1
- "use strict";function o(n){const t=new TextEncoder().encode(n),e=String.fromCodePoint(...t);return btoa(e)}module.exports=o;
1
+ "use strict";function f(t,r){const a=new TextEncoder().encode(t),n=String.fromCodePoint(...a);let e=btoa(n);const d=(r==null?void 0:r.urlSafe)===!0,c=(r==null?void 0:r.padding)??"omit";return d&&(e=e.replace(/\+/g,"-").replace(/\//g,"_"),c==="omit"&&(e=e.replace(/=+$/,"")),c==="encode"&&(e=e.replace(/=+$/,l=>"%3D".repeat(l.length)))),e}module.exports=f;
@@ -1,7 +1,9 @@
1
- function o(n) {
2
- const e = new TextEncoder().encode(n), t = String.fromCodePoint(...e);
3
- return btoa(t);
1
+ function g(c, r) {
2
+ const t = new TextEncoder().encode(c), n = String.fromCodePoint(...t);
3
+ let e = btoa(n);
4
+ const d = (r == null ? void 0 : r.urlSafe) === !0, a = (r == null ? void 0 : r.padding) ?? "omit";
5
+ return d && (e = e.replace(/\+/g, "-").replace(/\//g, "_"), a === "omit" && (e = e.replace(/=+$/, "")), a === "encode" && (e = e.replace(/=+$/, (l) => "%3D".repeat(l.length)))), e;
4
6
  }
5
7
  export {
6
- o as default
8
+ g as default
7
9
  };