
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@m860/cerberus-babel-plugin-transform
Advanced tools
cerberus转换工具
npm i -D @m860/cerberus-babel-plugin-transform
NOTE:默认情况下
react,react-native会被替换
{
"plugins": ["@cerberus/transform"]
}
如果需要替换自己的模块可以设置modules参数
{
"plugins": [["@cerberus/transform",{"modules": ["dateformat"]}]]
}
NOTE:
modules中设置的module名字和npm保持一致,在Cerberus库中导出的名字也必须一致。
type Option={
/**
* 不需要被打包的公共模块
*/
modules?:Array<string>,
/**
* 需要处理的资源文件的正则表达式,默认:/\.(gif|png|jpeg|jpg|svg)$/i
*/
resourceTest?:?RegExp
};
// input
import * as React from "react"
import React2 from "react"
import {memo,useState} from "react"
import {useRef as ur} from "react"
import {Text} from "react-native"
import df from "dateformat"
import {get as getPath} from "object-path"
// output
const React = $REACT$;
const React2 = $REACT$;
const memo = $REACT$.memo;
const useState = $REACT$.useState;
const ur = $REACT$.useRef;
const Text = $REACTNATIVE$.Text;
const df = $MODULES$["dateformat"];
const getPath = $MODULES$["object-path"].get;
FAQs
cerberus转换工具
We found that @m860/cerberus-babel-plugin-transform 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.