You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

rswitch

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rswitch - npm Package Compare versions

Comparing version
0.3.0
to
0.4.0-beta
+2
-1
dist/index.d.ts

@@ -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;

@@ -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"}})});
{
"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": [