
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@lweb-utils/url
Advanced tools
Url相关工具函数
npm i @lweb-utils/url --save
getQueryUrl(url, params)
获取附带query参数的url。
url(string): 生成参数的url,包含协议域名和端口等。
params(object): 参数对象。
(string): 附带query参数的完整url。
// url没有参数
const url = getQueryUrl('http://www.abc.com', { a: 1 });
// 'http://www.abc.com?a=1'
// url带有参数
const url = getQueryUrl('http://www.abc.com?a=1', { b: 2 });
// 'http://www.abc.com?a=1&b=2'
getUrlParam(param, url)
获取url上制定的参数值。
param(string): url上的参数名称,没有时返回全部。
url(string): url字符串,默认取window.location.href
。
(string|object|null): url附带的参数值。
// 不指定参数名称和url,当前地址为http://www.abc.com?a=1&b=2&c=3
const result = getUrlParam();
// { a: '1', b: '2', c: '3' }
// 指定参数,不指定url
const result = getUrlParam('a');
// '1'
// 指定参数和url
const result = getUrlParam('a', 'http://www.abc.com?a=2&b=3&c=4');
// '2'
// 不指定参数,指定url
const result = getUrlParam(null, 'http://www.abc.com?a=2&b=3&c=4');
// { a: '2', b: '3', c: '4' }
isUrl(path)
判断给定字符串是否为url的格式。
path(string): 判断的字符串。
(boolean): 参数是否为url格式。
const result = isUrl('http://www.abc.com');
// true
const result = isUrl('www.abc.com');
// false
FAQs
@lweb-utils/url
The npm package @lweb-utils/url receives a total of 0 weekly downloads. As such, @lweb-utils/url popularity was classified as not popular.
We found that @lweb-utils/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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.