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

dx-lib

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dx-lib - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/ajax/isPlainObject.js

21

lib/ajax/index.js
import { param } from '../param/index.js'
import Promise from '../Promise/index.js'
import { parseJSON } from '../json/index.js'
import isPlainObject from './isPlainObject.js'
const isObject = isType("Object")
const noop = function() {}

@@ -34,3 +35,3 @@ /**

if (options.method === 'GET' && isObject(options.data)) {
if (options.method === 'GET' && isPlainObject(options.data)) {
if (!options.cache) {

@@ -73,7 +74,5 @@ options.data._ = Math.random().toString().slice(2)

}
const setRequestHeader = (k, v) => {
if ('setRequestHeader' in xhr) {
xhr.setRequestHeader(k, v)
}
}
const setRequestHeader = 'setRequestHeader' in xhr ? (k, v) => {
xhr.setRequestHeader(k, v)
} : noop

@@ -121,3 +120,3 @@ if ('onload' in xhr) {

let data = options.data
if (isObject(data)) {
if (isPlainObject(data)) {
data = param(data)

@@ -141,8 +140,2 @@ setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')

return target
}
function isType(type) {
return function(obj) {
return obj != null && toString.call(obj) == "[object " + type + "]"
}
}
{
"name": "dx-lib",
"version": "0.1.0",
"version": "0.1.1",
"description": "dx fe lib",

@@ -14,4 +14,4 @@ "main": "index.js",

"repository": {
"type" : "git",
"url" : "https://github.com/zenxds/dx-lib.git"
"type": "git",
"url": "https://github.com/zenxds/dx-lib.git"
},

@@ -35,2 +35,3 @@ "ava": {

"expect.js": "^0.3.1",
"http-server": "^0.11.1",
"puppeteer": "^1.1.1",

@@ -37,0 +38,0 @@ "sinon": "^4.4.5"

Sorry, the diff of this file is not supported yet

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