
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
Using npm:
$ npm install cenum
or using yarn:
$ yarn add cenum
import Enum from 'cenum';
const status = new Enum([
{name: 'ACTIVE', value: 1, label: '激活'},
{name: 'INACTIVE', value: 0, lable: '未激活'}
]);
status.ACTIVE.is(1); // true
status.ACTIVE.is('ACTIVE'); // true
status.ACTIVE.is('激活'); // true
status.has('INACTIVE'); // true
status.has(0); // true
status.has('未激活'); // true
status.ACTIVE.in(0, 1) // true
status.ACTIVE.in(['ACTIVE', '未激活']) // true
status.ACTIVE.label // 激活
status.ACTIVE.name // ACTIVE
status.ACTIVE.value // 0
或者使用parse批量转换
import { enums, parse } from 'cenum';
parse({
role: [
{name: 'ACTIVE', value: 1, label: '激活'},
{name: 'INACTIVE', value: 0, lable: '未激活'}
],
gender: [
['MALE', 1, '男'],
['FEMALE', 0, '女']
]
})
enums.role // 角色Enum
enums.gender // 性别Enum
构造方法的参数有四种格式
当缺失name或者label的时候,将自动用name表示label或者用label表示name
当name和label都没有的时候,将默认等于value
请确保每一条的name, value, label互相之间都是不一样的
FAQs
一个简易的enum库
The npm package cenum receives a total of 9 weekly downloads. As such, cenum popularity was classified as not popular.
We found that cenum demonstrated a not healthy version release cadence and project activity because the last version was released 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.