Socket
Socket
Sign inDemoInstall

@zeit/schemas

Package Overview
Dependencies
Maintainers
19
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.6.0 to 1.6.1

test/deployment-env.js

6

deployment/config.js

@@ -1,2 +0,2 @@

const envSchema = require('./env');
const {EnvObject} = require('./env');
const staticSchema = require('./config-static');

@@ -18,3 +18,3 @@

},
'env': envSchema,
'env': EnvObject,
'build': {

@@ -24,3 +24,3 @@ type: 'object',

properties: {
env: envSchema
env: EnvObject
}

@@ -27,0 +27,0 @@ },

@@ -0,18 +1,62 @@

const maxEnvLength = 100;
const reservedEnvKeys = [
'NOW',
'NOW_REGION',
'NOW_DC',
'NOW_URL',
// Questionable?
'PATH',
'HOME',
'TEMP',
// Legacy
'NOW_PLAN',
'AUTH_TOKEN',
'DEPLOYMENT_ID',
'REGISTRY_AUTH_TOKEN'
];
const EnvKey = {
type: 'string',
pattern: '^[A-z0-9_]+$',
minLength: 1,
maxLength: 256,
not: {
'enum': reservedEnvKeys
}
};
const EnvKeys = {
type: 'array',
minItems: 0,
maxItems: maxEnvLength,
uniqueItems: true,
items: EnvKey,
additionalProperties: false
};
const EnvValue = {
type: 'string',
minLength: 0,
maxLength: 65536
};
// { 'FOO': 'BAR' }
const EnvObject = {
type: 'object',
minProperties: 0,
maxProperties: maxEnvLength,
patternProperties: {
'.+': EnvValue
},
additionalProperties: false
};
module.exports = {
anyOf: [
{
type: 'object',
patternProperties: {
'.+': {
type: 'string'
}
}
},
{
type: 'array',
items: {
type: 'string'
}
}
]
EnvKey,
EnvKeys,
EnvValue,
EnvObject
};
{
"name": "@zeit/schemas",
"version": "1.6.0",
"version": "1.6.1",
"description": "All schemas used for validation that are shared between our projects",

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

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

exports.test_valid_build_env_types = () => {
let isValid = ajv.validate(deploymentConfigSchema, {
const isValid = ajv.validate(deploymentConfigSchema, {
build: {

@@ -89,11 +89,2 @@ env: {

assert.equal(isValid, true);
isValid = ajv.validate(deploymentConfigSchema, {
build: {
env: [
'USER_SUPPLIED_ENV'
]
}
});
assert.equal(isValid, true);
};

@@ -100,0 +91,0 @@

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