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

exaquark-js

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exaquark-js - npm Package Compare versions

Comparing version 1.0.8 to 1.0.10

index.js

12

package.json
{
"name": "exaquark-js",
"version": "1.0.8",
"version": "1.0.10",
"description": "JS wrapper for exaquark.com",
"main": "./lib/index.js",
"main": "./index.js",
"scripts": {
"clean": "rimraf lib",
"clean": "rimraf lib utils index.js helpers.js",
"test": "cross-env BABEL_ENV=commonjs mocha --compilers js:babel-register --recursive",

@@ -13,3 +13,3 @@ "test:watch": "npm test -- --watch",

"lint": "eslint src test",
"build": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build": "cross-env BABEL_ENV=commonjs babel src --out-dir ./",
"prepublish": "npm run clean && npm run lint && npm run test && npm run build",

@@ -64,3 +64,5 @@ "docs": "./node_modules/.bin/jsdoc -c ./conf/jsdoc.json",

},
"dependencies": {}
"dependencies": {
"xhr": "^2.4.1"
}
}

@@ -37,2 +37,11 @@ # exaQuark JS

##### 1.0.10
- Changing native XMLHttpRequest to xhr
##### 1.0.9
- Changing JSONP to AJAX for allocator
- Moving code from `lib` to root folder
##### 1.0.8

@@ -39,0 +48,0 @@

@@ -0,0 +0,0 @@ import { distanceOnSphere } from './utils/distance'

@@ -1,30 +0,30 @@

import { log } from './utils/private'
import { log, getRequest } from './utils/private'
import { dictionaryToArray } from './helpers'
const loadJSONP = (() => {
let unique = 0
return (url, callback, context) => {
// INIT
let name = '_jsonp_' + unique++
if (url.match(/\?/)) url += '&callback=' + name
else url += '?callback=' + name
// const loadJSONP = (() => {
// let unique = 0
// return (url, callback, context) => {
// // INIT
// let name = '_jsonp_' + unique++
// if (url.match(/\?/)) url += '&callback=' + name
// else url += '?callback=' + name
//
// // Create script
// let script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = url
//
// // Setup handler
// window[name] = data => {
// callback.call((context || window), data)
// document.getElementsByTagName('head')[0].removeChild(script)
// script = null
// delete window[name]
// }
//
// // Load JSON
// document.getElementsByTagName('head')[0].appendChild(script)
// }
// })()
// Create script
let script = document.createElement('script')
script.type = 'text/javascript'
script.src = url
// Setup handler
window[name] = data => {
callback.call((context || window), data)
document.getElementsByTagName('head')[0].removeChild(script)
script = null
delete window[name]
}
// Load JSON
document.getElementsByTagName('head')[0].appendChild(script)
}
})()
/**

@@ -69,3 +69,5 @@ * Represents an exaQuark instance

return new Promise((resolve, reject) => {
loadJSONP(this.allocatorUrl, response => {
getRequest(this.allocatorUrl, (err, response) => {
console.log('err', err)
console.log('response', response)
this.entryPoint = response.entryPoint

@@ -72,0 +74,0 @@ this.iid = response.iid

@@ -0,0 +0,0 @@ var exports = module.exports = {}

@@ -0,1 +1,2 @@

const xhr = require('xhr')
var exports = module.exports = {}

@@ -7,1 +8,7 @@

}
exports.getRequest = function (url, callback) {
xhr.get(url, (err, resp) => {
callback(err, JSON.parse(resp.body))
})
}
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