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

nomics-platform

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nomics-platform - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

lib/audit/market.js

13

lib/audit/get.js
const https = require('https')
const http = require('http')
module.exports = function (u) {
return new Promise((resolve, reject) => {
https.get(u, (res) => {
const handler = (res) => {
const { statusCode } = res

@@ -30,6 +31,10 @@ const contentType = res.headers['content-type']

})
}).on('error', (e) => {
reject(e)
})
}
if (u.indexOf('https') === 0) {
https.get(u, handler).on('error', (e) => { reject(e) })
} else {
http.get(u, handler).on('error', (e) => { reject(e) })
}
})
}

@@ -20,3 +20,6 @@ const url = require('url')

const results = []
results.push(...await require('./info')(u))
results.push(...await require('./market')(u))
results.push(...await require('./trade')(u))

@@ -23,0 +26,0 @@ console.log(results.map((r) => r.toString()).join('\n'))

@@ -9,6 +9,6 @@ const get = require('./get')

const info = await get(u + '/info')
results.push(new Result(true, true, 'Fetched /info and parsed as JSON'))
results.push(new Result(true, true, '/info is valid JSON'))
results.push(...auditInfoData(info))
} catch (e) {
results.push(new Result(false, true, 'Failed to fetch /info and parse as JSON', e))
results.push(new Result(false, true, '/info failed or not JSON', e))
}

@@ -21,9 +21,9 @@ return results

results.push(validateStringProperty(info, 'name', true, 'Info'))
results.push(validateStringProperty(info, 'description', false, 'Info'))
results.push(validateStringProperty(info, 'logo', false, 'Info'))
results.push(validateURLProperty(info, 'logo', false, 'Info'))
results.push(validateStringProperty(info, 'website', false, 'Info'))
results.push(validateURLProperty(info, 'website', false, 'Info'))
results.push(validateStringProperty(info, 'twitter', false, 'Info'))
results.push(validateStringProperty(info, 'name', true, '/info'))
results.push(validateStringProperty(info, 'description', false, '/info'))
results.push(validateStringProperty(info, 'logo', false, '/info'))
results.push(validateURLProperty(info, 'logo', false, '/info'))
results.push(validateStringProperty(info, 'website', false, '/info'))
results.push(validateURLProperty(info, 'website', false, '/info'))
results.push(validateStringProperty(info, 'twitter', false, '/info'))

@@ -30,0 +30,0 @@ return results

{
"name": "nomics-platform",
"version": "0.2.1",
"version": "0.3.0",
"description": "Nomics Platform Toolkit",

@@ -5,0 +5,0 @@ "keywords": [

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