There was an error while loading. Please reload this page.
1 parent 4f28f63 commit 65283acCopy full SHA for 65283ac
1 file changed
src/lib/semantic-tags.ts
@@ -7,12 +7,13 @@ import { getW3CDateString } from './w3cdate';
7
function normalizeSemanticValue(value: SemanticTagValue): SemanticTagValue {
8
if (value instanceof Date) {
9
if (!Number.isFinite(value.getTime()))
10
- throw new TypeError(`Semantic tag dates must be valid Date instances`);
+ throw new TypeError(`Semantic tag Date values must be valid`);
11
return getW3CDateString(value);
12
}
13
14
if (Array.isArray(value)) return value.map(normalizeSemanticValue);
15
16
+ // The truthiness check excludes null, because typeof null is 'object'.
17
if (value && typeof value === 'object') {
18
const result: { [key: string]: SemanticTagValue } = {};
19
for (const [key, nestedValue] of Object.entries(value))
0 commit comments