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

swiz

Package Overview
Dependencies
Maintainers
11
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiz - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

24

lib/validators.js

@@ -17,2 +17,24 @@ var check = require('validator');

exports.isV1UUID = function(str) {
this.isUUID(str);
if (str.charAt(14) !== '1') {
throw new Error('UUID is not version 1');
}
return str;
};
exports.isV4UUID = function(str) {
this.isUUID(str);
if (str.charAt(14) !== '4') {
throw new Error('UUID is not version 4');
}
return str;
};
exports.isUUID = function(str) {
if (!str.match(/^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$/)) {

@@ -22,4 +44,2 @@ throw new Error('Invalid UUID');

throw new Error('Unsupported UUID variant');
} else if (str.charAt(14) !== '1') {
throw new Error('UUID is not version 1');
}

@@ -26,0 +46,0 @@

2

package.json

@@ -16,3 +16,3 @@ {

"description": "Serialization and Validation Framework for objects in RESTful APIs",
"version": "0.6.3",
"version": "0.6.4",
"homepage": "https://github.com/racker/node-swiz",

@@ -19,0 +19,0 @@ "repository": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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