
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.
codestar-base
Advanced tools
``` Result<T> { code: string = '' // 错误码, "00"表示成功,其他均表示错误 msg: string = '' // 错误描述 success: boolean = false // 是否成功 data?: T // 携带的数据 errors?: { [field: string]: string } // 错误描述,通常用于表单验证失败,返回验证失败字段的详细错误 args?: Record<string, string |
Result<T> {
code: string = '' // 错误码, "00"表示成功,其他均表示错误
msg: string = '' // 错误描述
success: boolean = false // 是否成功
data?: T // 携带的数据
errors?: { [field: string]: string } // 错误描述,通常用于表单验证失败,返回验证失败字段的详细错误
args?: Record<string, string | number> // 错误描述的 占位符参数,用于i18n翻译
}
import ResultBuilder from "./ResultBuilder";
// 等价于 {success:true, code:"00", data}
ResultBuilder.ok(data);
// 等价于 {success:false, code:"01", msg:"error message"}
ResultBuilder.error("error message")
// 解析结果,比如解析服务器返回的字符串转成Result对象
ResultBuilder.parse('{code:"00", data:"hello"}')
// 更详细的Result封装
ResultBuilder.success({data:T, msg:"description"})
ResultBuilder.fail({
code:'01',
msg:'invalid request',
errors:{username:"Length exceeds the limit"},
args:{}
})
FAQs
``` Result<T> { code: string = '' // 错误码, "00"表示成功,其他均表示错误 msg: string = '' // 错误描述 success: boolean = false // 是否成功 data?: T // 携带的数据 errors?: { [field: string]: string } // 错误描述,通常用于表单验证失败,返回验证失败字段的详细错误 args?: Record<string, string |
We found that codestar-base 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.