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

@traveloka/validation

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@traveloka/validation - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

<a name="3.1.3"></a>
## [3.1.3](https://github.com/Jekiwijaya/react-schema/compare/v3.1.2...v3.1.3) (2018-10-19)
### Bug Fixes
* **required:** fixing object validation ([ee24242](https://github.com/Jekiwijaya/react-schema/commit/ee24242))
<a name="3.1.2"></a>

@@ -8,0 +20,0 @@ ## [3.1.2](https://github.com/Jekiwijaya/react-schema/compare/v3.1.1...v3.1.2) (2018-10-19)

2

lib/required.js

@@ -7,3 +7,3 @@ "use strict";

value === '' ||
(Object.keys(value).length === 0 && value.constructor === Object) ||
(value.constructor === Object && Object.keys(value).length === 0) ||
(Array.isArray(value) && !value.length))

@@ -10,0 +10,0 @@ return errorMessage || 'Required';

{
"name": "@traveloka/validation",
"version": "3.1.2",
"version": "3.1.3",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

@@ -29,2 +29,12 @@ import { required } from '../index';

it("should return falsy because value 123", () => {
const result = required(123);
expect(result).toBeFalsy();
});
it("should return falsy because value true", () => {
const result = required(true);
expect(result).toBeFalsy();
});
it("should return truthy because value is {}", () => {

@@ -31,0 +41,0 @@ const result = required({});

@@ -8,3 +8,3 @@ import { ValidationResult, Validation } from "./types";

value === '' ||
(Object.keys(value).length === 0 && value.constructor === Object) ||
(value.constructor === Object && Object.keys(value).length === 0) ||
(Array.isArray(value) && !value.length)

@@ -11,0 +11,0 @@ )

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