@zeit/schemas
Advanced tools
Comparing version 2.22.0 to 2.23.0
{ | ||
"name": "@zeit/schemas", | ||
"version": "2.22.0", | ||
"version": "2.23.0", | ||
"description": "All schemas used for validation that are shared between our projects", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -333,12 +333,12 @@ /* eslint camelcase: 0 */ | ||
exports.test_dismissedToasts_valid = () => { | ||
assert(ajv.validate(User, { dismissedToasts: {} })); | ||
assert(ajv.validate(User, { dismissedToasts: [] })); | ||
}; | ||
exports.test_dismissedToasts_valid = () => { | ||
assert(ajv.validate(User, { dismissedToasts: { exampleToast: { exampleScopeId: 1656442351576 } } })); | ||
assert(ajv.validate(User, { dismissedToasts: [{ name: ' exampleToast', dismissals: [{ scopeId: 'exampleScopeId', createdAt: 1656442351576 }] }] })); | ||
}; | ||
exports.test_dismissedToasts_valid = () => { | ||
const isValid = ajv.validate(User, { dismissedToasts: []}); | ||
exports.test_dismissedToasts_invalid = () => { | ||
const isValid = ajv.validate(User, { dismissedToasts: [{ name: ' exampleToast', dismissals: [] }] }); | ||
assert.strictEqual(isValid, false); | ||
}; |
@@ -148,11 +148,26 @@ const Username = { | ||
const ToastDismissal = { | ||
type: 'object', | ||
properties: { | ||
scopeId: { | ||
type: 'string' | ||
}, | ||
createdAt: { | ||
type: 'number' | ||
} | ||
}, | ||
additionalProperties: false | ||
}; | ||
// Record<ToastName, Record<Scope, Date>> | ||
const DismissedToasts = { | ||
const DismissedToast = { | ||
type: 'object', | ||
patternProperties: { | ||
'^.*$': { | ||
'^.*$': { | ||
type: 'number' | ||
} | ||
properties: { | ||
name: { | ||
type: 'string' | ||
}, | ||
dismissals: { | ||
type: 'array', | ||
minItems: 1, | ||
maxItems: 50, | ||
items: ToastDismissal | ||
} | ||
@@ -163,2 +178,10 @@ }, | ||
const DismissedToasts = { | ||
type: 'array', | ||
minItems: 0, | ||
maxItems: 50, | ||
items: DismissedToast, | ||
additionalProperties: false | ||
}; | ||
const User = { | ||
@@ -165,0 +188,0 @@ type: 'object', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29925
1194
0