Benign Download

create-pages.ts

References a DOM element creation method

Evidence

References a DOM element creation method lines 1–19
1import { createElement } from 'react';
2import type { FunctionComponent, ReactNode } from 'react';
3
4import { unstable_defineRouter } from './define-router.js';
5import type { RouteProps } from './common.js';
6import {
7 joinPath,
8 parsePathWithSlug,
9 getPathMapping,
10} from '../lib/utils/path.js';
11import type { BuildConfig } from '../server.js';
12import type { PathSpec } from '../lib/utils/path.js';
13
14const hasPathSpecPrefix = (prefix: PathSpec, path: PathSpec) => {
15 for (let i = 0; i < prefix.length; i++) {
16 if (
17 i >= path.length ||
18 prefix[i]!.type !== path[i]!.type ||
19 prefix[i]!.name !== path[i]!.n …
English function-word token "and" lines 29–33
29:6… XME we should add unit tests for some functions and type utils.
30
31type IsValidPathItem<T> = T extends `/${infer _}`
32 ? false
33 : T extends '[]' | ' …
Plain JavaScript identifier assignment lines 111–119
111:7… ts: {
112 unstable_buildConfig: BuildConfig | undefined;
113 },
114 ) => Promise<void>,
115) {
116 let configured = false;
117
118 // TODO I think there's room for improvement to refactor these structures
119 const staticPath …
Calls a string replacement method lines 162–165
162:45… ]);
163 const id = joinPath(page.path, 'page').replace(/^\//, '');
164 registerStaticComponent(id, page.component);
165 } else if (page.render === 's …
English function-word token "with" lines 173–176
173:7… throw new Error('staticPaths does not match with slug pattern');
174 }
175 const mapping: Record<string, string> = {};
176 let slugI …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.