hatch-surf/node_modules/next/dist/esm/shared/lib/utils/reflect-utils.js
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00

43 lines
1.5 KiB
JavaScript

// This regex will have fast negatives meaning valid identifiers may not pass
// this test. However this is only used during static generation to provide hints
// about why a page bailed out of some or all prerendering and we can use bracket notation
// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`
// even if this would have been fine too `searchParams.ಠ_ಠ`
const isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
export function describeStringPropertyAccess(target, prop) {
if (isDefinitelyAValidIdentifier.test(prop)) {
return `\`${target}.${prop}\``;
}
return `\`${target}[${JSON.stringify(prop)}]\``;
}
export function describeHasCheckingStringProperty(target, prop) {
const stringifiedProp = JSON.stringify(prop);
return `\`Reflect.has(${target}, ${stringifiedProp})\`, \`${stringifiedProp} in ${target}\`, or similar`;
}
export const wellKnownProperties = new Set([
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toString',
'valueOf',
'toLocaleString',
// Promise prototype
'then',
'catch',
'finally',
// React Promise extension
'status',
// 'value',
// 'error',
// React introspection
'displayName',
'_debugInfo',
// Common tested properties
'toJSON',
'$$typeof',
'__esModule',
// Tested by flight when checking for iterables
'@@iterator'
]);
//# sourceMappingURL=reflect-utils.js.map