Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
40
node_modules/next/dist/lib/metadata/resolvers/resolve-title.js
generated
vendored
Normal file
40
node_modules/next/dist/lib/metadata/resolvers/resolve-title.js
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "resolveTitle", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return resolveTitle;
|
||||
}
|
||||
});
|
||||
function resolveTitleTemplate(template, title) {
|
||||
return template ? template.replace(/%s/g, title) : title;
|
||||
}
|
||||
function resolveTitle(title, stashedTemplate) {
|
||||
let resolved;
|
||||
const template = typeof title !== 'string' && title && 'template' in title ? title.template : null;
|
||||
if (typeof title === 'string') {
|
||||
resolved = resolveTitleTemplate(stashedTemplate, title);
|
||||
} else if (title) {
|
||||
if ('default' in title) {
|
||||
resolved = resolveTitleTemplate(stashedTemplate, title.default);
|
||||
}
|
||||
if ('absolute' in title && title.absolute) {
|
||||
resolved = title.absolute;
|
||||
}
|
||||
}
|
||||
if (title && typeof title !== 'string') {
|
||||
return {
|
||||
template,
|
||||
absolute: resolved || ''
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
absolute: resolved || title || '',
|
||||
template
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=resolve-title.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue