
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
create-enum-es
Advanced tools
import createEnum from "create-enum-es";
const base = createEnum({
AA: [11, "AA-"],
BB: [22, "BB-"],
} as const);
console.log("base.AA :>> ", base.AA);
// 11
console.log("base.BB :>> ", base.BB);
// 22
console.log("base.options() :>> ", base.options());
// [
// {
// "value": 11,
// "label": "AA-"
// },
// {
// "value": 22,
// "label": "BB-"
// }
// ]
const enumInstance = createEnum({
A: [1, "A-", { a: "axx" }],
B: [2, "B-", { b: "bxx" }],
} as const);
const value = enumInstance.value("A");
console.log("value :>> ", value);
// 1
const values = enumInstance.values();
console.log("values :>> ", values);
// [1, 2]
const options = enumInstance.options();
console.log("options :>> ", options);
// [
// {
// "value": 1,
// "label": "A-",
// "extra": {
// "a": "axx"
// }
// },
// {
// "value": 2,
// "label": "B-",
// "extra": {
// "b": "bxx"
// }
// }
// ]
const label = enumInstance.label("A");
console.log("label :>> ", label);
// 'A-'
const extra = enumInstance.extra("A");
console.log("extra :>> ", extra);
// {"a": "axx"}
const check = enumInstance.check(1, "A");
console.log("check :>> ", check);
// true
FAQs
处理前端枚举的工具方法,支持ts类型检测
We found that create-enum-es demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.