diff --git a/lib/schemaProxy.js b/lib/schemaProxy.js index f2de9f0d..c9d64989 100644 --- a/lib/schemaProxy.js +++ b/lib/schemaProxy.js @@ -54,7 +54,10 @@ const handler = ({ return [...parent[symbols.titles], target.title]; } // otherwise, it's just our own - return [target[keyword`title`]]; + if (typeof target.title === 'string') { + return [target[keyword`title`]]; + } + return []; }; meta[symbols.resolve] = (target, prop, receiver) => (path) => { @@ -80,8 +83,13 @@ const handler = ({ const parentslug = parent[symbols.slug]; const { title } = receiver; const name = receiver[symbols.pointer].split('/').pop(); - // eslint-disable-next-line no-param-reassign - receiver[myslug] = slugger.slug(`${parentslug}-${title || name}`); + if (typeof title === 'string') { + // eslint-disable-next-line no-param-reassign + receiver[myslug] = slugger.slug(`${parentslug}-${title || name}`); + } else { + // eslint-disable-next-line no-param-reassign + receiver[myslug] = slugger.slug(`${parentslug}-${name}`); + } } return receiver[myslug]; }; diff --git a/test/markdownBuilder.test.js b/test/markdownBuilder.test.js index 54bb77ce..c1a02685 100644 --- a/test/markdownBuilder.test.js +++ b/test/markdownBuilder.test.js @@ -72,14 +72,8 @@ describe('Testing Markdown Builder: title', () => { }); it('Meta Schema looks OK', () => { - assertMarkdown(results.title) - .fuzzy`## Not true Type - -merged type ([Not true](not.md)) - -not - -- [True](not-true.md "check type definition")`; + assertMarkdown(results.meta) + .fuzzy`defined in: [Meta](meta-definitions-meta-properties-title.md "https://ns.adobe.com/helix/pipeline/meta#/definitions/meta/properties/title")`; }); });