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

classpass

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classpass - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 0.2.2
* Fixed validate function to ignore the attr if the value is null
# 0.2.1

@@ -2,0 +6,0 @@

6

dist/validate.d.ts

@@ -10,4 +10,6 @@ /// <reference types="promise" />

export declare function attr(type: string): (target: Object, key: string) => void;
/** Model basic type validator function */
/** Model basic type validator function */
/**
* Model basic type validator function
* @param model The model object to be validated
*/
export declare function validate(model: Object): Promise.IThenable<{}>;

@@ -27,4 +27,6 @@ "use strict";

exports.attr = attr;
/** Model basic type validator function */
/** Model basic type validator function */
/**
* Model basic type validator function
* @param model The model object to be validated
*/
function validate(model) {

@@ -34,3 +36,3 @@ return new Promise(function (resolve, reject) {

for (var key in data) {
if (model[key] === undefined)
if (model[key] === undefined || !model[key])
continue;

@@ -37,0 +39,0 @@ if (typeof model[key] !== data[key]) {

{
"name": "classpass",
"version": "0.2.1",
"version": "0.2.2",
"main": "dist/index.js",

@@ -22,3 +22,4 @@ "bugs": "https://github.com/sorakthunly/classpass/issues",

"reflect-metadata": "^0.1.10",
"typescript": "^2.2.2"
"typescript": "^2.2.2",
"@types/promise": "^7.1.30"
},

@@ -28,5 +29,4 @@ "devDependencies": {

"@types/node": "^7.0.12",
"@types/promise": "^7.1.30",
"@types/reflect-metadata": "0.0.5"
}
}

@@ -19,4 +19,6 @@ import 'reflect-metadata';

/** Model basic type validator function */
/** Model basic type validator function */
/**
* Model basic type validator function
* @param model The model object to be validated
*/
export function validate(model: Object) {

@@ -27,3 +29,3 @@ return new Promise((resolve, reject) => {

for (let key in data) {
if (model[key] === undefined) continue;
if (model[key] === undefined || !model[key]) continue;
if (typeof model[key] !== data[key]) {

@@ -30,0 +32,0 @@ const validBoolean = [0, 1].indexOf(model[key]) > -1;

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