
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.
easy-code-url
Advanced tools
为便利浏览器传参转换而设立。
1.可将JSON对象直接转换成传参地址拼接字符,默认拼接符号"&"可设置新符号
2.可将地址与参数便捷的组合成传参地址,通过设置可启用encodeURIComponent对拼接后的地址进行安全符处理,也可通过携带参数的地址或者安全符地址,便捷的将参数转换为JSON对象
3.传参分割符号"?"可设置
npm安装命令
npm install --save easy-code-url
引入包
import ECU from "easy-code-url"
范例
import easyCodeURL from "easy-code-url";
//全局设置
easyCodeURL.setConfig({break:"?",jpin:"&",encode:true});
//获取全局设置
easyCodeURL.getConfig();
//拼装Data
let data={
name:"MOD",
age:12,
gender:"male",
hobby:["videogame","tree",{new:"keep"}],
}
var strData = easyCodeURL.encodeData(data)
console.log(strData);
console.log(easyCodeURL.decodeData(strData))
var URL = easyCodeURL.encodeURL("www.baidu.com",data,{encode:true})
var URL2 = easyCodeURL.encodeURL("www.baidu.com",data,{encode:false})
console.log(URL,URL2);
console.log(easyCodeURL.decodeURL(URL,{encode:true}))
var sss = easyCodeURL.decodeURL(URL,{encode:true});
console.log(sss);
//通过以上输出测试,可看到具体的使用方式与结果
设置全局配置参数 config:{ break:String,// 地址与参数分割符号,默认为"?"; join:String,// 参数拼接符 默认"&" encode:Boolean,//是否将拼接后的地址进行 encodeURIComponent 编码 ,默认true }
获取全局配置参数 return config
将地址拼接参数 baseURL:String,//需要拼接参数的地址 data:JSON Object,//参数JSON格式 config:Object,//同全局配置属性,可每次调用该方法时,灵活设置,如空则默认全局配置。
easyCodeURL.encodeURL('www.baiduc.com',{name:"foo",age:"22"},{break:"?",join:"!",encode:false});
可将携参地址的参数解析成对象 locationURL:String,//携参地址 config:Object,//同全局配置属性,可每次调用该方法时,灵活设置,如空则默认全局配置方式进行解析。
easyCodeURL.decodeURL('www.baiduc.com',{break:"?",join:"!",encode:false});
FAQs
encodeURIComponent decodeURIComponent
We found that easy-code-url 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
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.