Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dfeidao/atom-mobile

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfeidao/atom-mobile - npm Package Compare versions

Comparing version 4.6.201905151327 to 4.6.201905161817

2

msg/get.d.ts
/**
* @module msg服务请求
*/
export default function post<T>(url: string, body: string | FormData): Promise<T>;
export default function get<T>(url: string, body: string, disable_cache: boolean): Promise<T>;

@@ -10,4 +10,21 @@ "use strict";

const _global_1 = __importDefault(require("./_global"));
async function post(url, body) {
const ret = await fetch(`${_global_1.default.host}/${url}`, {
function generateRequestUrl(url, body, disable_cache) {
const usp = new URLSearchParams();
const query_param = body || {};
for (const k in query_param) {
if (query_param.hasOwnProperty(k)) {
usp.append(k, query_param[k]);
}
}
let query = usp.toString();
// let query = obj2query(options.query || {});
if (disable_cache) {
const cacheBust = String(Date.now());
query += query ? '&' + cacheBust : cacheBust;
}
const separator = url.indexOf('?') > -1 ? '&' : '?';
return query ? url + separator + query : url;
}
async function get(url, body, disable_cache) {
const ret = await fetch(`${_global_1.default.host}/${generateRequestUrl(url, body, disable_cache)}`, {
body,

@@ -47,2 +64,2 @@ credentials: 'include',

}
exports.default = post;
exports.default = get;
{
"name": "@dfeidao/atom-mobile",
"version": "4.6.201905151327",
"version": "4.6.201905161817",
"description": "原子操作",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc