Skip to content

Commit 4d765e5

Browse files
committed
1 parent 157619c commit 4d765e5

File tree

104 files changed

+24112
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+24112
-28
lines changed

test/fixtures/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.next

test/fixtures/.next/BUILD_ID

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lQzbZpujXJtqiMXAeuORY
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"polyfillFiles": [
3+
"static/chunks/polyfills-36bde18dcfde0c144be5.js"
4+
],
5+
"devFiles": [],
6+
"ampDevFiles": [],
7+
"lowPriorityFiles": [
8+
"static/lQzbZpujXJtqiMXAeuORY/_buildManifest.js",
9+
"static/lQzbZpujXJtqiMXAeuORY/_ssgManifest.js"
10+
],
11+
"pages": {
12+
"/": [
13+
"static/chunks/main-636401514c82a6b87008.js",
14+
"static/chunks/webpack-e067438c4cf4ef2ef178.js",
15+
"static/chunks/framework.9116e7bff2bfccdffa19.js",
16+
"static/css/c50ddf22b716c7b6b76d.css",
17+
"static/chunks/pages/index-071b8dd1801c570106f0.js"
18+
],
19+
"/_app": [
20+
"static/chunks/main-636401514c82a6b87008.js",
21+
"static/chunks/webpack-e067438c4cf4ef2ef178.js",
22+
"static/chunks/framework.9116e7bff2bfccdffa19.js",
23+
"static/chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.0d390002b679b0003559.js",
24+
"static/css/6e9ef204d6fd7ac61493.css",
25+
"static/chunks/pages/_app-90fcc616c99a45ea1d34.js"
26+
],
27+
"/_error": [
28+
"static/chunks/main-636401514c82a6b87008.js",
29+
"static/chunks/webpack-e067438c4cf4ef2ef178.js",
30+
"static/chunks/framework.9116e7bff2bfccdffa19.js",
31+
"static/chunks/pages/_error-4f026761014494626b1e.js"
32+
]
33+
},
34+
"ampFirstPages": []
35+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.removePathTrailingSlash = removePathTrailingSlash;\nexports.normalizePathTrailingSlash = void 0;\n/**\n* Removes the trailing slash of a path if there is one. Preserves the root path `/`.\n*/\n\nfunction removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}\n/**\n* Normalizes the trailing slash of a path according to the `trailingSlash` option\n* in `next.config.js`.\n*/\n\n\nvar normalizePathTrailingSlash = process.env.__NEXT_TRAILING_SLASH ? function (path) {\n if (/\\.[^/]+\\/?$/.test(path)) {\n return removePathTrailingSlash(path);\n } else if (path.endsWith('/')) {\n return path;\n } else {\n return path + '/';\n }\n} : removePathTrailingSlash;\nexports.normalizePathTrailingSlash = normalizePathTrailingSlash;","map":null,"metadata":{},"sourceType":"script"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.RouterContext = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nvar RouterContext = /*#__PURE__*/_react[\"default\"].createContext(null);\n\nexports.RouterContext = RouterContext;\n\nif (false) {\n RouterContext.displayName = 'RouterContext';\n}","map":null,"metadata":{},"sourceType":"script"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.isInAmpMode = isInAmpMode;\nexports.useAmp = useAmp;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _ampContext = require(\"./amp-context\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction isInAmpMode() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$ampFirst = _ref.ampFirst,\n ampFirst = _ref$ampFirst === void 0 ? false : _ref$ampFirst,\n _ref$hybrid = _ref.hybrid,\n hybrid = _ref$hybrid === void 0 ? false : _ref$hybrid,\n _ref$hasQuery = _ref.hasQuery,\n hasQuery = _ref$hasQuery === void 0 ? false : _ref$hasQuery;\n\n return ampFirst || hybrid && hasQuery;\n}\n\nfunction useAmp() {\n // Don't assign the context value to a variable to save bytes\n return isInAmpMode(_react[\"default\"].useContext(_ampContext.AmpStateContext));\n}","map":null,"metadata":{},"sourceType":"script"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.default = mitt;\n/*\nMIT License\nCopyright (c) Jason Miller (https://jasonformat.com/)\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n// This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js\n// It's been edited for the needs of this script\n// See the LICENSE at the top of the file\n\nfunction mitt() {\n const all = Object.create(null);\n return {\n on(type, handler) {\n ;\n (all[type] || (all[type] = [])).push(handler);\n },\n\n off(type, handler) {\n if (all[type]) {\n all[type].splice(all[type].indexOf(handler) >>> 0, 1);\n }\n },\n\n emit(type, ...evts) {\n // eslint-disable-next-line array-callback-return\n ;\n (all[type] || []).slice().map(handler => {\n handler(...evts);\n });\n }\n\n };\n}","map":null,"metadata":{},"sourceType":"script"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.RouterContext = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nconst RouterContext = /*#__PURE__*/_react.default.createContext(null);\n\nexports.RouterContext = RouterContext;\n\nif (false) {\n RouterContext.displayName = 'RouterContext';\n}","map":null,"metadata":{},"sourceType":"script"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports[\"default\"] = withRouter;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _router = require(\"./router\");\n\nfunction withRouter(ComposedComponent) {\n function WithRouterWrapper(props) {\n return /*#__PURE__*/_react[\"default\"].createElement(ComposedComponent, Object.assign({\n router: (0, _router.useRouter)()\n }, props));\n }\n\n WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps // This is needed to allow checking for custom getInitialProps in _app\n ;\n WithRouterWrapper.origGetInitialProps = ComposedComponent.origGetInitialProps;\n\n if (false) {\n var name = ComposedComponent.displayName || ComposedComponent.name || 'Unknown';\n WithRouterWrapper.displayName = \"withRouter(\".concat(name, \")\");\n }\n\n return WithRouterWrapper;\n}","map":null,"metadata":{},"sourceType":"script"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.getRouteRegex = getRouteRegex; // this isn't importing the escape-string-regex module\n// to reduce bytes\n\nfunction escapeRegex(str) {\n return str.replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&');\n}\n\nfunction parseParameter(param) {\n var optional = param.startsWith('[') && param.endsWith(']');\n\n if (optional) {\n param = param.slice(1, -1);\n }\n\n var repeat = param.startsWith('...');\n\n if (repeat) {\n param = param.slice(3);\n }\n\n return {\n key: param,\n repeat: repeat,\n optional: optional\n };\n}\n\nfunction getRouteRegex(normalizedRoute) {\n var segments = (normalizedRoute.replace(/\\/$/, '') || '/').slice(1).split('/');\n var groups = {};\n var groupIndex = 1;\n var parameterizedRoute = segments.map(function (segment) {\n if (segment.startsWith('[') && segment.endsWith(']')) {\n var _parseParameter = parseParameter(segment.slice(1, -1)),\n key = _parseParameter.key,\n optional = _parseParameter.optional,\n repeat = _parseParameter.repeat;\n\n groups[key] = {\n pos: groupIndex++,\n repeat: repeat,\n optional: optional\n };\n return repeat ? optional ? '(?:/(.+?))?' : '/(.+?)' : '/([^/]+?)';\n } else {\n return \"/\".concat(escapeRegex(segment));\n }\n }).join(''); // dead code eliminate for browser since it's only needed\n // while generating routes-manifest\n\n if (false) {\n var routeKeyCharCode = 97;\n var routeKeyCharLength = 1; // builds a minimal routeKey using only a-z and minimal number of characters\n\n var getSafeRouteKey = function getSafeRouteKey() {\n var routeKey = '';\n\n for (var i = 0; i < routeKeyCharLength; i++) {\n routeKey += String.fromCharCode(routeKeyCharCode);\n routeKeyCharCode++;\n\n if (routeKeyCharCode > 122) {\n routeKeyCharLength++;\n routeKeyCharCode = 97;\n }\n }\n\n return routeKey;\n };\n\n var routeKeys = {};\n var namedParameterizedRoute = segments.map(function (segment) {\n if (segment.startsWith('[') && segment.endsWith(']')) {\n var _parseParameter2 = parseParameter(segment.slice(1, -1)),\n key = _parseParameter2.key,\n optional = _parseParameter2.optional,\n repeat = _parseParameter2.repeat; // replace any non-word characters since they can break\n // the named regex\n\n\n var cleanedKey = key.replace(/\\W/g, '');\n var invalidKey = false; // check if the key is still invalid and fallback to using a known\n // safe key\n\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true;\n }\n\n if (!isNaN(parseInt(cleanedKey.substr(0, 1)))) {\n invalidKey = true;\n }\n\n if (invalidKey) {\n cleanedKey = getSafeRouteKey();\n }\n\n routeKeys[cleanedKey] = key;\n return repeat ? optional ? \"(?:/(?<\".concat(cleanedKey, \">.+?))?\") : \"/(?<\".concat(cleanedKey, \">.+?)\") : \"/(?<\".concat(cleanedKey, \">[^/]+?)\");\n } else {\n return \"/\".concat(escapeRegex(segment));\n }\n }).join('');\n return {\n re: new RegExp(\"^\".concat(parameterizedRoute, \"(?:/)?$\")),\n groups: groups,\n routeKeys: routeKeys,\n namedRegex: \"^\".concat(namedParameterizedRoute, \"(?:/)?$\")\n };\n }\n\n return {\n re: new RegExp(\"^\".concat(parameterizedRoute, \"(?:/)?$\")),\n groups: groups\n };\n}","map":null,"metadata":{},"sourceType":"script"}

0 commit comments

Comments
 (0)