Socket
Socket
Sign inDemoInstall

jares

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jares - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

30

index.js

@@ -15,20 +15,12 @@ 'use strict';

if ( typeof this.json[item] == "undefined" && this.verify[item].request ) {
return reject(this.answer(false, {
code: 100,
error: this.verify[item].error && this.verify[item].error.isUndefined||
`${item} is undefined.`
}))
return reject(this.error(100, this.verify[item].error && this.verify[item].error.isUndefined||
`${item} is undefined.`))
}
if ( typeof this.json[item] != this.verify[item].type && typeof this.json[item] != "undefined" ) {
return reject(this.answer(false, {
code: 200,
error: this.verify[item].error && this.verify[item].error.isInvalidType||
`${item} is invalid type.`
}))
return reject(this.error(200, this.verify[item].error && this.verify[item].error.isInvalidType||
`${item} is invalid type.`))
}
resolve(this.answer(true, {
data: this.json
}))
resolve(this.json)
});

@@ -38,12 +30,12 @@ })

answer(ok, param) {
if ( !ok ) {
return { ok, code: param.code, error: param.error}
} else {
return { ok, data: param.data}
}
error(error, code){
return { ok: false, code, error}
}
success(data){
return { ok: true, data }
}
}
module.exports = JAres;
{
"name": "jares",
"version": "1.0.2",
"version": "1.0.3",
"description": "simple json api ewsult format",

@@ -5,0 +5,0 @@ "main": "index.js",

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