+9
-11
@@ -1,19 +0,17 @@ | ||
| function s(f, t, u) { | ||
| const l = (u == null ? void 0 : u.returnFunction) || !1, n = t[f], r = Object.keys(t).filter((e) => e.includes(",")), i = r.flatMap((e) => e.split(",")).map((e) => e.trim()); | ||
| if (n) | ||
| return typeof n == "function" && !l ? n() : n; | ||
| function d(f, n, u) { | ||
| const l = (u == null ? void 0 : u.returnFunction) || !1, t = n[f], i = Object.keys(n).filter((e) => e.includes(",")), a = i.flatMap((e) => e.split(",")).map((e) => e.trim()); | ||
| if (t) | ||
| return typeof t == "function" && !l ? t() : t; | ||
| { | ||
| if (i.includes(f)) { | ||
| const o = r.find((a) => a.includes(f)), c = t[o]; | ||
| if (a.includes(f)) { | ||
| const r = i.find((s) => s.includes(f)), c = n[r]; | ||
| return typeof c == "function" && !l ? c() : c; | ||
| } | ||
| const e = t[""]; | ||
| const e = n[""]; | ||
| return typeof e == "function" && !l ? e() : e; | ||
| } | ||
| } | ||
| exports.rswitch = s; | ||
| module.exports = s; | ||
| export { | ||
| s as default, | ||
| s as rswitch | ||
| d as default, | ||
| d as rswitch | ||
| }; |
@@ -1,1 +0,1 @@ | ||
| (function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.rswitch={}))})(this,function(t){"use strict";function n(i,f,l){const c=(l==null?void 0:l.returnFunction)||!1,u=f[i],o=Object.keys(f).filter(e=>e.includes(",")),s=o.flatMap(e=>e.split(",")).map(e=>e.trim());if(u)return typeof u=="function"&&!c?u():u;{if(s.includes(i)){const r=o.find(a=>a.includes(i)),d=f[r];return typeof d=="function"&&!c?d():d}const e=f[""];return typeof e=="function"&&!c?e():e}}t.rswitch=n,module.exports=n,t.default=n,t.rswitch=n,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
| (function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.rswitch={}))})(this,function(t){"use strict";function n(i,f,l){const c=(l==null?void 0:l.returnFunction)||!1,u=f[i],o=Object.keys(f).filter(e=>e.includes(",")),s=o.flatMap(e=>e.split(",")).map(e=>e.trim());if(u)return typeof u=="function"&&!c?u():u;{if(s.includes(i)){const r=o.find(a=>a.includes(i)),d=f[r];return typeof d=="function"&&!c?d():d}const e=f[""];return typeof e=="function"&&!c?e():e}}t.default=n,t.rswitch=n,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
+1
-1
| { | ||
| "name": "rswitch", | ||
| "description": "The rswitch library provides a compact and flexible way to implement switch-like functionality in JavaScript. It allows you to define cases and their corresponding actions using an object literal syntax.", | ||
| "version": "0.4.0-beta", | ||
| "version": "0.4.0", | ||
| "author": "Rashed Iqbal", | ||
@@ -6,0 +6,0 @@ "files": [ |
5353
-1.38%28
-6.67%