/opt/canhelp/node_modules/next/dist/lib/metadata
NameSizeModeActions
generate/-0755rm
resolvers/-0755rm
types/-0755rm
clone-metadata.d.ts1880644editdlrm
clone-metadata.js8180644editdlrm
clone-metadata.js.map14180644editdlrm
constants.d.ts2450644editdlrm
constants.js8680644editdlrm
constants.js.map10180644editdlrm
default-metadata.d.ts2200644editdlrm
default-metadata.js19160644editdlrm
default-metadata.js.map26970644editdlrm
get-metadata-route.d.ts6930644editdlrm
get-metadata-route.js47270644editdlrm
get-metadata-route.js.map72720644editdlrm
is-metadata-route.d.ts20270644editdlrm
is-metadata-route.js58940644editdlrm
is-metadata-route.js.map99760644editdlrm
metadata-context.d.ts2420644editdlrm
metadata-context.js4330644editdlrm
metadata-context.js.map6710644editdlrm
metadata.d.ts14320644editdlrm
metadata.js123100644editdlrm
metadata.js.map187450644editdlrm
resolve-metadata.d.ts18350644editdlrm
resolve-metadata.js324890644editdlrm
resolve-metadata.js.map529970644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/lib/metadata/is-metadata-route.js (5894B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { DEFAULT_METADATA_ROUTE_EXTENSIONS: null, STATIC_METADATA_IMAGES: null, getExtensionRegexString: null, isMetadataPage: null, isMetadataRoute: null, isMetadataRouteFile: null, isStaticMetadataRoute: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { DEFAULT_METADATA_ROUTE_EXTENSIONS: function() { return DEFAULT_METADATA_ROUTE_EXTENSIONS; }, STATIC_METADATA_IMAGES: function() { return STATIC_METADATA_IMAGES; }, getExtensionRegexString: function() { return getExtensionRegexString; }, isMetadataPage: function() { return isMetadataPage; }, isMetadataRoute: function() { return isMetadataRoute; }, isMetadataRouteFile: function() { return isMetadataRouteFile; }, isStaticMetadataRoute: function() { return isStaticMetadataRoute; } }); const _normalizepathsep = require("../../shared/lib/page-path/normalize-path-sep"); const _apppaths = require("../../shared/lib/router/utils/app-paths"); const _isapprouteroute = require("../is-app-route-route"); const STATIC_METADATA_IMAGES = { icon: { filename: 'icon', extensions: [ 'ico', 'jpg', 'jpeg', 'png', 'svg' ] }, apple: { filename: 'apple-icon', extensions: [ 'jpg', 'jpeg', 'png' ] }, favicon: { filename: 'favicon', extensions: [ 'ico' ] }, openGraph: { filename: 'opengraph-image', extensions: [ 'jpg', 'jpeg', 'png', 'gif' ] }, twitter: { filename: 'twitter-image', extensions: [ 'jpg', 'jpeg', 'png', 'gif' ] } }; const DEFAULT_METADATA_ROUTE_EXTENSIONS = [ 'js', 'jsx', 'ts', 'tsx' ]; const getExtensionRegexString = (staticExtensions, dynamicExtensions)=>{ // If there's no possible multi dynamic routes, will not match any []. files if (!dynamicExtensions || dynamicExtensions.length === 0) { return `(\\.(?:${staticExtensions.join('|')}))`; } return `(?:\\.(${staticExtensions.join('|')})|(\\.(${dynamicExtensions.join('|')})))`; }; function isMetadataRouteFile(appDirRelativePath, pageExtensions, strictlyMatchExtensions) { // End with the extension or optional to have the extension // When strictlyMatchExtensions is true, it's used for match file path; // When strictlyMatchExtensions, the dynamic extension is skipped but // static extension is kept, which is usually used for matching route path. const trailingMatcher = (strictlyMatchExtensions ? '' : '?') + '$'; // Match the optional variants like /opengraph-image2, /icon-a102f4.png, etc. const variantsMatcher = '\\d?'; // The -\w{6} is the suffix that normalized from group routes; const groupSuffix = strictlyMatchExtensions ? '' : '(-\\w{6})?'; const suffixMatcher = `${variantsMatcher}${groupSuffix}`; const metadataRouteFilesRegex = [ new RegExp(`^[\\\\/]robots${getExtensionRegexString(pageExtensions.concat('txt'), null)}${trailingMatcher}`), new RegExp(`^[\\\\/]manifest${getExtensionRegexString(pageExtensions.concat('webmanifest', 'json'), null)}${trailingMatcher}`), new RegExp(`^[\\\\/]favicon\\.ico$`), new RegExp(`[\\\\/]sitemap${getExtensionRegexString([ 'xml' ], pageExtensions)}${trailingMatcher}`), new RegExp(`[\\\\/]${STATIC_METADATA_IMAGES.icon.filename}${suffixMatcher}${getExtensionRegexString(STATIC_METADATA_IMAGES.icon.extensions, pageExtensions)}${trailingMatcher}`), new RegExp(`[\\\\/]${STATIC_METADATA_IMAGES.apple.filename}${suffixMatcher}${getExtensionRegexString(STATIC_METADATA_IMAGES.apple.extensions, pageExtensions)}${trailingMatcher}`), new RegExp(`[\\\\/]${STATIC_METADATA_IMAGES.openGraph.filename}${suffixMatcher}${getExtensionRegexString(STATIC_METADATA_IMAGES.openGraph.extensions, pageExtensions)}${trailingMatcher}`), new RegExp(`[\\\\/]${STATIC_METADATA_IMAGES.twitter.filename}${suffixMatcher}${getExtensionRegexString(STATIC_METADATA_IMAGES.twitter.extensions, pageExtensions)}${trailingMatcher}`) ]; const normalizedAppDirRelativePath = (0, _normalizepathsep.normalizePathSep)(appDirRelativePath); const matched = metadataRouteFilesRegex.some((r)=>r.test(normalizedAppDirRelativePath)); return matched; } function isStaticMetadataRoute(route) { // extract ext with regex const pathname = route.replace(/\/route$/, ''); const matched = (0, _isapprouteroute.isAppRouteRoute)(route) && isMetadataRouteFile(pathname, [], true) && // These routes can either be built by static or dynamic entrypoints, // so we assume they're dynamic pathname !== '/robots.txt' && pathname !== '/manifest.webmanifest' && !pathname.endsWith('/sitemap.xml'); return matched; } function isMetadataPage(page) { const matched = !(0, _isapprouteroute.isAppRouteRoute)(page) && isMetadataRouteFile(page, [], false); return matched; } function isMetadataRoute(route) { let page = (0, _apppaths.normalizeAppPath)(route).replace(/^\/?app\//, '')// Remove the dynamic route id .replace('/[__metadata_id__]', '')// Remove the /route suffix .replace(/\/route$/, ''); if (page[0] !== '/') page = '/' + page; const matched = (0, _isapprouteroute.isAppRouteRoute)(route) && isMetadataRouteFile(page, [], false); return matched; } //# sourceMappingURL=is-metadata-route.js.map