myst-frontmatter
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -744,2 +744,8 @@ // This file can be updated by: | ||
}, | ||
'DocBook-Schema': { | ||
name: 'DocBook Schema License', | ||
}, | ||
'DocBook-XML': { | ||
name: 'DocBook XML License', | ||
}, | ||
Dotseqn: { | ||
@@ -1009,2 +1015,5 @@ name: 'Dotseqn License', | ||
}, | ||
HIDAPI: { | ||
name: 'HIDAPI License', | ||
}, | ||
'Hippocratic-2.1': { | ||
@@ -1066,2 +1075,5 @@ name: 'Hippocratic License 2.1', | ||
}, | ||
'HPND-Netrek': { | ||
name: 'Historical Permission Notice and Disclaimer - Netrek variant', | ||
}, | ||
'HPND-Pbmplus': { | ||
@@ -1484,5 +1496,2 @@ name: 'Historical Permission Notice and Disclaimer - Pbmplus variant', | ||
}, | ||
'Net-SNMP': { | ||
name: 'Net-SNMP License', | ||
}, | ||
NetCDF: { | ||
@@ -1839,2 +1848,5 @@ name: 'NetCDF license', | ||
}, | ||
'Ruby-pty': { | ||
name: 'Ruby pty extension license', | ||
}, | ||
'SAX-PD': { | ||
@@ -2017,2 +2029,5 @@ name: 'Sax Public Domain Notice', | ||
}, | ||
'Ubuntu-font-1.0': { | ||
name: 'Ubuntu Font Licence v1.0', | ||
}, | ||
UCAR: { | ||
@@ -2082,2 +2097,3 @@ name: 'UCAR License', | ||
name: 'W3C Software Notice and Document License (2015-05-13)', | ||
osi: true, | ||
}, | ||
@@ -2108,2 +2124,5 @@ w3m: { | ||
}, | ||
'X11-swapped': { | ||
name: 'X11 swapped final paragraphs', | ||
}, | ||
'Xdebug-1.03': { | ||
@@ -2110,0 +2129,0 @@ name: 'Xdebug License v 1.03', |
@@ -31,3 +31,3 @@ import type { Biblio } from '../biblio/types.js'; | ||
/** Abbreviations used throughout the project */ | ||
abbreviations?: Record<string, string>; | ||
abbreviations?: Record<string, string | null>; | ||
exports?: Export[]; | ||
@@ -34,0 +34,0 @@ downloads?: Download[]; |
@@ -1,2 +0,2 @@ | ||
import { defined, filterKeys, incrementOptions, validateBoolean, validateDate, validateList, validateObject, validateObjectKeys, validateString, validateUrl, validationError, } from 'simple-validators'; | ||
import { defined, incrementOptions, validateBoolean, validateDate, validateList, validateObject, validateObjectKeys, validateString, validateUrl, validationError, } from 'simple-validators'; | ||
import { validateTOC } from 'myst-toc'; | ||
@@ -17,2 +17,3 @@ import { validateBiblio } from '../biblio/validators.js'; | ||
export function validateProjectAndPageFrontmatterKeys(value, opts) { | ||
var _a; | ||
const output = validateSiteFrontmatterKeys(value, opts); | ||
@@ -69,9 +70,21 @@ if (defined(value.date)) { | ||
const abbreviationsOpts = incrementOptions('abbreviations', opts); | ||
const abbreviations = validateObject(value.abbreviations, abbreviationsOpts); | ||
if (abbreviations) { | ||
const stringKeys = Object.keys(abbreviations).filter((key) => { | ||
// Filter on non-string values | ||
return validateString(abbreviations[key], incrementOptions(key, abbreviationsOpts)); | ||
const abbreviations = Object.fromEntries(Object.entries((_a = validateObject(value.abbreviations, abbreviationsOpts)) !== null && _a !== void 0 ? _a : {}) | ||
.map(([k, v]) => { | ||
// A null / false explicitly disables an abbreviation | ||
if (v === null || v === false) | ||
return [k, null]; | ||
// Filter on non-string values | ||
const title = validateString(v, incrementOptions(k, abbreviationsOpts)); | ||
// Ensure that we filter out invalid abbreviations (single characters) | ||
const key = validateString(k, { | ||
...incrementOptions(k, abbreviationsOpts), | ||
minLength: 2, | ||
}); | ||
output.abbreviations = filterKeys(abbreviations, stringKeys); | ||
if (!(key && title)) | ||
return null; | ||
return [k, title]; | ||
}) | ||
.filter((v) => !!v)); | ||
if (abbreviations && Object.keys(abbreviations).length > 0) { | ||
output.abbreviations = abbreviations; | ||
} | ||
@@ -78,0 +91,0 @@ } |
{ | ||
"name": "myst-frontmatter", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"sideEffects": false, | ||
@@ -38,3 +38,3 @@ "license": "MIT", | ||
"orcid": "^1.0.0", | ||
"simple-validators": "^1.0.6", | ||
"simple-validators": "^1.1.0", | ||
"spdx-correct": "^3.2.0", | ||
@@ -41,0 +41,0 @@ "myst-toc": "^0.1.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
222401
5618
Updatedsimple-validators@^1.1.0