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

@zeit/schemas

Package Overview
Dependencies
Maintainers
15
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeit/schemas - npm Package Compare versions

Comparing version 1.7.0 to 2.0.0

deployment/config-env.js

42

deployment/config-static.js

@@ -20,3 +20,43 @@ module.exports = {

'headers': {
type: 'array'
type: 'array',
maxItems: 50,
minItems: 1,
uniqueItems: true,
items: {
type: 'object',
required: ['source', 'headers'],
properties: {
source: {
type: 'string',
maxLength: 100,
minLength: 1
},
headers: {
type: 'array',
maxItems: 50,
minItems: 1,
uniqueItems: true,
items: {
type: 'object',
required: ['key', 'value'],
properties: {
key: {
type: 'string',
minLength: 1,
maxLength: 32,
pattern: "^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$"
},
value: {
type: 'string',
minLength: 1,
maxLength: 2048,
pattern: "^[a-zA-Z0-9_!#$%&'*+., =^`|~-]+$"
}
},
additionalProperties: false
}
}
},
additionalProperties: false
}
},

@@ -23,0 +63,0 @@ 'directoryListing': {

3

deployment/config.js

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

const {EnvKeys, EnvObject} = require('./env');
const {EnvKeys, EnvObject} = require('./config-env');
const staticSchema = require('./config-static');
module.exports = {

@@ -6,0 +5,0 @@ type: 'object',

{
"name": "@zeit/schemas",
"version": "1.7.0",
"version": "2.0.0",
"description": "All schemas used for validation that are shared between our projects",

@@ -5,0 +5,0 @@ "scripts": {

@@ -7,3 +7,3 @@ /* eslint camelcase: 0 */

EnvObject
} = require('../deployment/env');
} = require('../deployment/config-env');

@@ -10,0 +10,0 @@ const ajv = new AJV({allErrors: true});

@@ -154,2 +154,59 @@ /* eslint camelcase: 0 */

exports.test_valid_static_headers_object = () => {
const isValid = ajv.validate(deploymentConfigSchema, {
'static': {
headers: [
{
source: '/_next/webpack/chunks/*',
headers: [{
key: 'Cache-Control',
value: 'adssds'
}]
},
{
source: '/_next/static/commons/**',
headers: [{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable'
}]
},
{
source: '/_next/*/page/**/*.js',
headers: [{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable'
}]
}
]
}
});
assert.equal(isValid, true);
};
exports.test_invalid_static_headers_object = () => {
const isValid = ajv.validate(deploymentConfigSchema, {
'static': {
headers: [
{
source: '/_next/webpack/chunks/*',
headers: [{
key: ':alternate-protocol',
value: 'foo\x00bar'
}]
},
{
source: '/_next/static/commons/**',
headers: [{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable'
}]
}
]
}
});
assert.equal(isValid, false);
};
exports.test_valid_static_object_trailing_slash = () => {

@@ -156,0 +213,0 @@ const isValid = ajv.validate(deploymentConfigSchema, {

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