@mobilon-dev/chotto 0.3.116 → 0.3.117

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,9 +1,9 @@
1
- import { isAttributeUnconfirmed as f, needsAttributeConfirmation as d } from "./useCommunicationAttributes.js";
2
- const c = /* @__PURE__ */ new Set(["whatsapp", "telegram", "max", "sms"]);
3
- function h(t) {
4
- return c.has(t);
1
+ import { needsAttributeConfirmation as f } from "./useCommunicationAttributes.js";
2
+ const d = /* @__PURE__ */ new Set(["whatsapp", "telegram", "max", "sms"]);
3
+ function c(t) {
4
+ return d.has(t);
5
5
  }
6
- function a(t, n) {
6
+ function h(t, n) {
7
7
  if (!n || !t.length)
8
8
  return;
9
9
  const l = n.includes(".") ? n.split(".").pop() : n;
@@ -12,10 +12,10 @@ function a(t, n) {
12
12
  return !i || typeof i != "string" ? !1 : i === n || i === l || i.endsWith(`.${l}`);
13
13
  });
14
14
  }
15
- function m(t, n, l, r) {
15
+ function a(t, n, l, r) {
16
16
  const i = r(t);
17
17
  if (n != null && n.channelId) {
18
- const s = i.find((e) => e.channelId === n.channelId);
18
+ const s = i.find((u) => u.channelId === n.channelId);
19
19
  if (s)
20
20
  return s.channelId;
21
21
  }
@@ -25,9 +25,9 @@ function m(t, n, l, r) {
25
25
  return (o == null ? void 0 : o.channelId) ?? null;
26
26
  }
27
27
  function I(t, n, l, r, i) {
28
- if (!h(t))
28
+ if (!c(t))
29
29
  return null;
30
- const o = n == null ? void 0 : n[t], s = m(
30
+ const o = n == null ? void 0 : n[t], s = a(
31
31
  t,
32
32
  o,
33
33
  r,
@@ -35,13 +35,10 @@ function I(t, n, l, r, i) {
35
35
  );
36
36
  if (!s)
37
37
  return null;
38
- const e = l[t] ?? [];
39
- if (e.some(f))
40
- return null;
41
- const u = a(e, o == null ? void 0 : o.attributeId) ?? (e.length === 1 ? e[0] : void 0);
42
- return !u || d(u) ? null : { attribute: u, channelId: s };
38
+ const u = l[t] ?? [], e = h(u, o == null ? void 0 : o.attributeId) ?? (u.length === 1 ? u[0] : void 0);
39
+ return !e || f(e) ? null : { attribute: e, channelId: s };
43
40
  }
44
41
  export {
45
- h as isOneClickChannelType,
42
+ c as isOneClickChannelType,
46
43
  I as resolveRecentChannelSelection
47
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.3.116",
3
+ "version": "0.3.117",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",