
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
@lichao.franklee/lcajax
Advanced tools
new Ajax(options)
其中,options的配置项如下:
{
rest
// TODO: 传递请求库的对象,自动识别对象,消除上面的requestLib参数
requestInstance
defaultOptions // 请求的默认配置
extension // ajax实例扩展,对象,可选
isProduction // 是不是正式环境,用以开启或关闭某些功能,boolean/() => bool
// 请求拦截器处理函数,(config) => config,可选,不要使用箭头函数,函数内this指向ajax实例
requestInterceptor
// 响应成功拦截器处理函数,response => response, 可选,不要使用箭头函数,函数内this指向ajax实例
responseOkInterceptor
// 响应请求错误的拦截器,即status不等于304且不在[200, 300),error => any,可选
// 不要使用箭头函数,函数内this强制指向ajax实例
responseErrorInterceptor
responseNotOkHandler // 请求正常返回,但后端判断请求出错,response => any
schema // jsonschema,结构和rest保持一致,可选
handleRequestDataInvalid // 响应数据校验未通过时的处理函数, (res, validInfo) => any
handleResponseDataInvalid // 请求数据校验未通过时的处理函数, (res, validInfo) => any
}
其中,rest
{
moduleName: {
requestFunction: [method, url, params],
// ...
},
// ...
}
其中,params可选参数:
{
isReturnRes // Boolean,true表示直接返回response,false表示返回response.data
baseUrl // 请求路径前缀,拼接在url之前,构成一个完整的请求路径
cache // Boolean,该请求是否开启缓存,可选,默认false
}
FAQs
```js new Ajax(options) ```
The npm package @lichao.franklee/lcajax receives a total of 0 weekly downloads. As such, @lichao.franklee/lcajax popularity was classified as not popular.
We found that @lichao.franklee/lcajax 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
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.