Socket
Socket
Sign inDemoInstall

ajv-formats

Package Overview
Dependencies
10
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.3.2

2

package.json
{
"name": "ajv-formats",
"version": "1.3.1",
"version": "1.3.2",
"description": "Plugin for AJV that adds support for some of draft2019 formats.",

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

@@ -10,5 +10,5 @@ # ajv-formats

An open question is how thoroughly to validate things like hostnames and IRIs
where the syntax and semantics diverge. Writing a regex for a hostname the
syntax (ie. only contains certain characters, there are multiple segments
separated by `.` and the lengths of all segments and the total length). But that
where the syntax and semantics diverge. Writing a regex for hostnames checks the
syntax (ie. contains only certain characters, there are multiple segments
separated by `.` and the lengths of all segments and the total length). That
won't catch obviously fake domains like `unknown.unknown`. This library goes a

@@ -19,14 +19,2 @@ step further than just checking the syntax and also attempts to check the

Validating a IRI references is challenging since the syntax is so permissive.
Basically, any URL-safe string is a valid IRI syntactically. I struggled to find
[negative test cases](https://github.com/luzlab/ajv-formats/blob/master/index.test.js#L232)
when writing the unit tests for IRI-references. Consider:
- `google.com` is NOT a valid IRI because it does not include a scheme.
- `file.txt` is a valid IRI-reference
- `/this:that` is a valid IRI-reference
- `this:that` is a NOT a valid IRI-reference
Regardless, the library is a solid first-pass at implementing the
## Installation

@@ -106,2 +94,12 @@

Validating a IRI references is challenging since the syntax is so permissive.
Basically, any URL-safe string is a valid IRI syntactically. I struggled to find
[negative test cases](https://github.com/luzlab/ajv-formats/blob/master/index.test.js#L232)
when writing the unit tests for IRI-references. Consider:
- `google.com` is NOT a valid IRI because it does not include a scheme.
- `file.txt` is a valid IRI-reference
- `/this:that` is a valid IRI-reference
- `this:that` is a NOT a valid IRI-reference
### idn-email

@@ -108,0 +106,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc