+2
-1
@@ -7,2 +7,3 @@ type RSwitch = { | ||
| }; | ||
| declare function rswitch(key: string | undefined, rswitch: RSwitch, options?: Options): any; | ||
| export declare function rswitch(key: string | undefined, rswitch: RSwitch, options?: Options): any; | ||
| export default rswitch; |
+19
-1
@@ -1,1 +0,19 @@ | ||
| 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; | ||
| { | ||
| if (i.includes(f)) { | ||
| const o = r.find((a) => a.includes(f)), c = t[o]; | ||
| return typeof c == "function" && !l ? c() : c; | ||
| } | ||
| const e = t[""]; | ||
| return typeof e == "function" && !l ? e() : e; | ||
| } | ||
| } | ||
| exports.rswitch = s; | ||
| module.exports = s; | ||
| export { | ||
| s as default, | ||
| s as rswitch | ||
| }; |
@@ -1,1 +0,1 @@ | ||
| (function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict"}); | ||
| (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"}})}); |
+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.3.0", | ||
| "version": "0.4.0-beta", | ||
| "author": "Rashed Iqbal", | ||
@@ -6,0 +6,0 @@ "files": [ |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
5428
29.24%30
275%0
-100%2
100%