prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
ypeof(obj) {
if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
_typeof = function _typeof(obj) {
return typeof obj
}
} else {
_typeof = function _typeof(obj) {
return obj &&
typeof Symbol === 'function' &&
obj.constructor === Symbol &&
obj !==... | ion _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj
}
if (
obj === null ||
(_typeof(obj) !== 'object' && typeof obj !== 'function')
) {
return { default: obj }
}
var cache = _getRequireWildcardCache()
if | )
function _getRequireWildcardCache() {
if (typeof WeakMap !== 'function') return null
var cache = new WeakMap()
_getRequireWildcardCache = function _getRequireWildcardCache() {
return cache
}
return cache
}
funct | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/asset-fs-inline-path-babel/input.js",
"language": "javascript",
"file_size": 1959,
"cut_index": 537,
"middle_length": 229
} |
/***/ 474: /***/ function (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__
) {
'use strict'
__webpack_require__.r(__webpack_exports__)
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ default: function () {
... | __webpack_require__.n(
react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__
)
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(747)
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___defau | })
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(282)
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default =
/*#__PURE__*/ | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper-multi/input.js",
"language": "javascript",
"file_size": 3072,
"cut_index": 614,
"middle_length": 229
} |
var o = (e[n] = {
i: n,
l: !1,
exports: {},
})
return (t[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports)
}
return (
(r.m = t),
(r.c = e),
(r.d = function (t, e, n) {
r.o(t, e) ||
Object.defineProperty(t, e, {
enumerable: !0,
get: n... | t && t.__esModule) return t
var n = Object.create(null)
if (
(r.r(n),
Object.defineProperty(n, 'default', {
enumerable: !0,
value: t,
}),
2 & e && 'string' != typeof t)
)
for (v | dule',
}),
Object.defineProperty(t, '__esModule', {
value: !0,
}))
}),
(r.t = function (t, e) {
if ((1 & e && (t = r(t)), 8 & e)) return t
if (4 & e && 'object' == typeof t && | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper-null/mangled.js",
"language": "javascript",
"file_size": 4813,
"cut_index": 614,
"middle_length": 229
} |
e) {
'object' == typeof exports && 'undefined' != typeof module
? (module.exports = e())
: 'function' == typeof define && define.amd
? define([], e)
: (('undefined' != typeof window
? window
: 'undefined' != typeof global
? global
: 'undefined' != typeof... | D'), n)
}
var a = (u[t] = {
exports: {},
})
l[t][0].call(
a.exports,
function (e) {
return s(l[t][1][e] || e)
},
a,
a.exports,
r,
l, | var i = 'function' == typeof require && require
if (!e && i) return i(t, !0)
if (c) return c(t, !0)
var n = new Error("Cannot find module '" + t + "'")
throw ((n.code = 'MODULE_NOT_FOUN | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/browserify-minify/input.js",
"language": "javascript",
"file_size": 1424,
"cut_index": 524,
"middle_length": 229
} |
node_modules/pixelmatch/bin/pixelmatch',
'node_modules/pixelmatch/index.js',
'node_modules/pixelmatch/package.json',
'node_modules/pngjs/lib/bitmapper.js',
'node_modules/pngjs/lib/bitpacker.js',
'node_modules/pngjs/lib/chunkstream.js',
'node_modules/pngjs/lib/constants.js',
'node_modules/pngjs/lib/crc.js'... | gjs/lib/paeth-predictor.js',
'node_modules/pngjs/lib/parser-async.js',
'node_modules/pngjs/lib/parser-sync.js',
'node_modules/pngjs/lib/parser.js',
'node_modules/pngjs/lib/png-sync.js',
'node_modules/pngjs/lib/png.js',
'node_modules/pngjs/lib/s | ode_modules/pngjs/lib/format-normaliser.js',
'node_modules/pngjs/lib/interlace.js',
'node_modules/pngjs/lib/packer-async.js',
'node_modules/pngjs/lib/packer-sync.js',
'node_modules/pngjs/lib/packer.js',
'node_modules/pn | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/pixelmatch/output.js",
"language": "javascript",
"file_size": 1155,
"cut_index": 518,
"middle_length": 229
} |
mlinks/input.js',
'test/unit/pnpm-symlinks/node_modules/.pnpm/parse5-htmlparser2-tree-adapter@6.0.1/node_modules/parse5',
'test/unit/pnpm-symlinks/node_modules/.pnpm/parse5-htmlparser2-tree-adapter@6.0.1/node_modules/parse5-htmlparser2-tree-adapter/lib/index.js',
'test/unit/pnpm-symlinks/node_modules/.pnpm/parse5... | se5@6.0.1/node_modules/parse5/lib/common/html.js',
'test/unit/pnpm-symlinks/node_modules/.pnpm/parse5@6.0.1/node_modules/parse5/package.json',
'test/unit/pnpm-symlinks/node_modules/parse5-htmlparser2-tree-adapter',
'test/unit/pnpm-symlinks/package.js | ',
'test/unit/pnpm-symlinks/node_modules/.pnpm/par | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/pnpm-symlinks/output.js",
"language": "javascript",
"file_size": 850,
"cut_index": 535,
"middle_length": 52
} |
= {}
function r(n) {
if (t[n]) return t[n].exports
var o = (t[n] = { i: n, l: !1, exports: {} })
return (e[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports)
}
;((r.m = e),
(r.c = t),
(r.d = function (e, t, n) {
r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }... | .create(null)
if (
(r.r(n),
Object.defineProperty(n, 'default', { enumerable: !0, value: e }),
2 & t && 'string' != typeof e)
)
for (var o in e)
r.d(
n,
o,
function ( | ect.defineProperty(e, '__esModule', { value: !0 }))
}),
(r.t = function (e, t) {
if ((1 & t && (e = r(e)), 8 & t)) return e
if (4 & t && 'object' == typeof e && e && e.__esModule) return e
var n = Object | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper/input.js",
"language": "javascript",
"file_size": 1736,
"cut_index": 537,
"middle_length": 229
} |
mport SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
import Typography from '@mui/material/Typography'
function LightBulbIcon(props: SvgIconProps) {
return (
<SvgIcon {...props}>
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1... | eturn (
<Typography sx={{ mt: 6, mb: 3, color: 'text.secondary' }}>
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
{'Pro tip: See more '}
<Link href="https://mui.com/material-ui/getting-started/templates/">
template | gIcon>
)
}
export default function ProTip() {
r | {
"filepath": "turbopack/benchmark-apps/mui/ProTip.tsx",
"language": "tsx",
"file_size": 976,
"cut_index": 582,
"middle_length": 52
} |
mport SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
import Typography from '@mui/material/Typography'
function LightBulbIcon(props: SvgIconProps) {
return (
<SvgIcon {...props}>
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1... | eturn (
<Typography sx={{ mt: 6, mb: 3, color: 'text.secondary' }}>
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
{'Pro tip: See more '}
<Link href="https://mui.com/material-ui/getting-started/templates/">
template | gIcon>
)
}
export default function ProTip() {
r | {
"filepath": "turbopack/benchmark-apps/mui/components/ProTip.tsx",
"language": "tsx",
"file_size": 976,
"cut_index": 582,
"middle_length": 52
} |
ongoose from 'mongoose'
const MONGODB_URI = process.env.MONGODB_URI
if (!MONGODB_URI) {
throw new Error(
'Please define the MONGODB_URI environment variable inside .env.local'
)
}
/**
* Global is used here to maintain a cached connection across hot reloads
* in development. This prevents connections growin... | d.promise) {
const opts = {
bufferCommands: false,
}
cached.promise = mongoose.connect(MONGODB_URI, opts).then((mongoose) => {
return mongoose
})
}
cached.conn = await cached.promise
return cached.conn
}
export default d | hed.conn) {
return cached.conn
}
if (!cache | {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/lib/dbConnect.js",
"language": "javascript",
"file_size": 837,
"cut_index": 520,
"middle_length": 52
} |
ose from 'mongoose'
/* PetSchema will correspond to a collection in your MongoDB database. */
const PetSchema = new mongoose.Schema({
name: {
/* The name of this pet */
type: String,
required: [true, 'Please provide a name for this pet.'],
maxlength: [60, 'Name cannot be more than 60 characters'],
... | age: {
/* Pet's age, if applicable */
type: Number,
},
poddy_trained: {
/* Boolean poddy_trained value, if applicable */
type: Boolean,
},
diet: {
/* List of dietary needs, if applicable */
type: Array,
},
image_url: | racters"],
},
species: {
/* The species of your pet */
type: String,
required: [true, 'Please specify the species of your pet.'],
maxlength: [40, 'Species specified cannot be more than 40 characters'],
},
| {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/models/Pet.js",
"language": "javascript",
"file_size": 1376,
"cut_index": 524,
"middle_length": 229
} |
m 'next/router'
import useSWR from 'swr'
import Form from '../../components/Form'
const fetcher = (url) =>
fetch(url)
.then((res) => res.json())
.then((json) => json.data)
const EditPet = () => {
const router = useRouter()
const { id } = router.query
const { data: pet, error } = useSWR(id ? `/api/pets... | age: pet.age,
poddy_trained: pet.poddy_trained,
diet: pet.diet,
image_url: pet.image_url,
likes: pet.likes,
dislikes: pet.dislikes,
}
return <Form formId="edit-pet-form" petForm={petForm} forNewPet={false} />
}
export default Ed | et.species,
| {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/pages/[id]/edit.js",
"language": "javascript",
"file_size": 812,
"cut_index": 536,
"middle_length": 14
} |
nect from '../../../lib/dbConnect'
import Pet from '../../../models/Pet'
export default async function handler(req, res) {
const {
query: { id },
method,
} = req
await dbConnect()
switch (method) {
case 'GET' /* Get a model by its ID */:
try {
const pet = await Pet.findById(id)
... | if (!pet) {
return res.status(400).json({ success: false })
}
res.status(200).json({ success: true, data: pet })
} catch (error) {
res.status(400).json({ success: false })
}
break
case 'DELET | son({ success: false })
}
break
case 'PUT' /* Edit a model by its ID */:
try {
const pet = await Pet.findByIdAndUpdate(id, req.body, {
new: true,
runValidators: true,
})
| {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/pages/api/pets/[id].js",
"language": "javascript",
"file_size": 1441,
"cut_index": 524,
"middle_length": 229
} |
nnect from '../../../lib/dbConnect'
import Pet from '../../../models/Pet'
export default async function handler(req, res) {
const { method } = req
await dbConnect()
switch (method) {
case 'GET':
try {
const pets = await Pet.find({}) /* find all the data in our database */
res.status(2... | model in the database */
res.status(201).json({ success: true, data: pet })
} catch (error) {
res.status(400).json({ success: false })
}
break
default:
res.status(400).json({ success: false })
break
}
}
| create(
req.body
) /* create a new | {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/pages/api/pets/index.js",
"language": "javascript",
"file_size": 831,
"cut_index": 523,
"middle_length": 52
} |
Promise<void>
reload(metricName: string): Promise<void>
}
const browserOutput = Boolean(process.env.BROWSER_OUTPUT)
async function withRequestMetrics(
metricName: string,
page: Page,
fn: () => Promise<void>
): Promise<void> {
const activePromises: Array<Promise<void>> = []
const sizeByExtension = new Map<... | ? 0
requestsByExtension.set(extension, currentRequests + 1)
if (status >= 200 && status < 300) {
let body
try {
body = await response.body()
} catch {
// empty
}
if ( | response.request().url()
const status = response.status()
const extension =
/^[^?#]+\.([a-z0-9]+)(?:[?#]|$)/i.exec(url)?.[1] ?? 'none'
const currentRequests = requestsByExtension.get(extension) ? | {
"filepath": "turbopack/packages/devlow-bench/src/browser.ts",
"language": "typescript",
"file_size": 10912,
"cut_index": 921,
"middle_length": 229
} |
red, underline } = picocolors
const SIGNIFICANCE_THRESHOLD = 0.05
type RowVerdict = 'improved' | 'regressed' | undefined
interface FormattedRow {
cells: string[]
verdict: RowVerdict
}
export interface SampleGroup {
scenario: string
variant: string
metric: string
unit: string
samples: number[]
}
// Gr... | roup) {
group = {
scenario: r.scenario,
variant: r.variant,
metric: r.metric,
unit: r.unit,
samples: [],
}
out.set(key, group)
}
group.samples.push(r.value)
}
return out
}
export functi | g, SampleGroup> {
const out = new Map<string, SampleGroup>()
for (const r of rows) {
if (!Number.isFinite(r.value)) continue
const key = makeKey(r.scenario, r.variant, r.metric)
let group = out.get(key)
if (!g | {
"filepath": "turbopack/packages/devlow-bench/src/compare.ts",
"language": "typescript",
"file_size": 8253,
"cut_index": 716,
"middle_length": 229
} |
'
import { access, constants } from 'fs/promises'
import { dirname } from 'path'
export async function waitForFile(
path: string,
timeout: number
): Promise<void> {
let currentAction = ''
let timeoutRef
const timeoutPromise = new Promise<void>((resolve, reject) => {
timeoutRef = setTimeout(() => {
... | =>
access(path, constants.F_OK)
.then(() => true)
.catch(() => false)
if (!(await checkAccess())) {
let resolveCheckAgain = () => {}
const watcher = watch(dirname(path), () => {
resolveCheckAgain( | elements.push(current)
const parent = dirname(current)
if (parent === current) {
break
}
current = parent
}
elements.reverse()
try {
for (const path of elements) {
const checkAccess = () | {
"filepath": "turbopack/packages/devlow-bench/src/file.ts",
"language": "typescript",
"file_size": 1629,
"cut_index": 537,
"middle_length": 229
} |
{ formatVariant } from './utils.js'
interface SampleSet {
samples: number[]
unit: string
relativeTo?: string
}
interface BufferedSample {
value: number
unit: string
relativeTo?: string
}
// Total attempts per variant are capped at this multiple of the requested
// `warmup + n`. Allows retrying flaky run... | me((scenario) => scenario.only)) {
scenarios = scenarios.filter((scenario) => scenario.only)
}
scenarios = await fullIface.filterScenarios(scenarios)
let totalFailedAttempts = 0
let variantsWithRetries = 0
let variantsShortOfTarget = 0
let | : number; warmup?: number } = {}
): Promise<void> {
const n = Math.max(1, Math.floor(options.n ?? 1))
const warmup = Math.max(0, Math.floor(options.warmup ?? 0))
const fullIface = intoFullInterface(iface)
if (scenarios.so | {
"filepath": "turbopack/packages/devlow-bench/src/runner.ts",
"language": "typescript",
"file_size": 6674,
"cut_index": 716,
"middle_length": 229
} |
hsTTest, mannWhitneyU } from './statistics.js'
function near(actual: number, expected: number, tol = 1e-6, label = '') {
assert.ok(
Math.abs(actual - expected) < tol,
`${label}: expected ${expected}, got ${actual} (tol ${tol})`
)
}
test('mean', () => {
near(mean([1, 2, 3, 4, 5]), 3)
near(mean([10]), 1... | es = 1.
// sea = seb = 1/3, denom = 2/3
// t = -1 / sqrt(2/3) = -1.2247448713915892
// df = (2/3)^2 / (2 * (1/3)^2 / 2) = (4/9) / (1/9) = 4
// p ≈ 0.288 (two-sided, df=4)
const r = welchsTTest([1, 2, 3], [2, 3, 4])
near(r.t, -1.22474487 | .9), 4.6)
// sorts internally
near(quantile([5, 3, 1, 2, 4], 0.5), 3)
// single sample
near(quantile([42], 0.9), 42)
})
test("Welch's t-test: small samples", () => {
// Hand-verified: means 2 and 3, both sample varianc | {
"filepath": "turbopack/packages/devlow-bench/src/statistics-test.ts",
"language": "typescript",
"file_size": 4671,
"cut_index": 614,
"middle_length": 229
} |
('../util/stats')
// Location of the native binary that the workflow copies into the action dir.
// From src/run/index.js → .github/actions/next-stats-action/native
const nativeBinaryDir = path.join(__dirname, '../../native')
// Sum the size of all *.node files in the action's native/ directory.
async function getSwc... | er(`Unable to measure SWC binary size: ${err.message}`)
return null
}
}
// Number of iterations for build benchmarks to get stable median
const BUILD_BENCHMARK_ITERATIONS = 5
// Bundler configurations for dual-bundler benchmarking
const BUNDLERS = |
const stat = await fs.stat(path.join(nativeBinaryDir, entry))
if (stat.isFile()) {
total += stat.size
found++
}
}
if (found === 0) return null
return total
} catch (err) {
logg | {
"filepath": ".github/actions/next-stats-action/src/run/index.js",
"language": "javascript",
"file_size": 11011,
"cut_index": 921,
"middle_length": 229
} |
github from '@actions/github'
import * as core from '@actions/core'
const LABELS = {
VERIFY_CANARY: 'please verify canary',
ADD_REPRODUCTION: 'please add a complete reproduction',
SIMPLIFY_REPRODUCTION: 'please simplify reproduction',
NEEDS_TRIAGE: 'type: needs triage',
}
const labelsRequireUserInput = [
LA... | comment)
if (!process.env.GITHUB_TOKEN) return
const client = github.getOctokit(process.env.GITHUB_TOKEN).rest
const issueCommon = { ...repo, issue_number: issue.number }
const issueLabels: string[] = issue.labels.map((label: any) => lab | === null)
throw new Error('Unexpected nullable value')
}
async function run() {
try {
const { payload, repo } = github.context
const { issue, comment } = payload
assertNotNullable(issue)
assertNotNullable( | {
"filepath": ".github/actions/needs-triage/src/index.ts",
"language": "typescript",
"file_size": 1337,
"cut_index": 524,
"middle_length": 229
} |
Usage: node aggregate-results.js <results-dir>
*
* Expects JSON files named pr-stats-*.json in the results directory
*/
const path = require('path')
const fs = require('fs/promises')
const { existsSync } = require('fs')
const addComment = require('./add-comment')
const logger = require('./util/logger')
async func... | 'No pr-stats-*.json files found - this may be a docs-only change')
process.exit(0)
}
logger(`Found ${statsFiles.length} results files: ${statsFiles.join(', ')}`)
// Load all results
const allData = []
for (const file of statsFiles) {
co | esultsDir)
const statsFiles = files.filter(
(f) => f.startsWith('pr-stats-') && f.endsWith('.json')
)
if (statsFiles.length === 0) {
// This can happen for docs-only changes where stats jobs are skipped
logger( | {
"filepath": ".github/actions/next-stats-action/src/aggregate-results.js",
"language": "javascript",
"file_size": 3670,
"cut_index": 614,
"middle_length": 229
} |
rom 'node:fs'
import type { Sandbox } from '@vercel/agent-eval'
/**
* Install the locally-built Next.js into the sandbox.
*
* The tarball path comes from run-evals.js via NEXT_EVAL_TARBALL, the same
* env-var handoff that run-tests.js uses for NEXT_TEST_PKG_PATHS. We hard-fail
* if it's missing rather than fallin... | types writeFiles as Record<string, string>
// but the runtime accepts Buffer. Tarballs are binary; can't send as string.
'next.tgz': readFileSync(tarball),
})
const { exitCode, stderr } = await sandbox.runCommand('npm', [
'install',
'./ | ll = process.env.NEXT_EVAL_TARBALL
if (!tarball) {
throw new Error(
'NEXT_EVAL_TARBALL not set. Run evals via `pnpm eval` from the repo root.'
)
}
await sandbox.writeFiles({
// @ts-expect-error — upstream | {
"filepath": "evals/lib/setup.ts",
"language": "typescript",
"file_size": 1761,
"cut_index": 537,
"middle_length": 229
} |
e client'
import * as React from 'react'
import Box from '@mui/material/Box'
import FormControl from '@mui/material/FormControl'
import InputLabel from '@mui/material/InputLabel'
import MenuItem from '@mui/material/MenuItem'
import Select from '@mui/material/Select'
import { useColorScheme } from '@mui/material/styles'... | value={mode}
onChange={(event) => setMode(event.target.value as typeof mode)}
label="Theme"
>
<MenuItem value="system">System</MenuItem>
<MenuItem value="light">Light</MenuItem>
<MenuItem | yContent: 'flex-end',
mt: 1,
p: 1,
}}
>
<FormControl>
<InputLabel id="mode-select-label">Theme</InputLabel>
<Select
labelId="mode-select-label"
id="mode-select"
| {
"filepath": "turbopack/benchmark-apps/mui/components/ModeSwitch.tsx",
"language": "tsx",
"file_size": 1085,
"cut_index": 515,
"middle_length": 229
} |
const Form = ({ formId, petForm, forNewPet = true }) => {
const router = useRouter()
const contentType = 'application/json'
const [errors, setErrors] = useState({})
const [message, setMessage] = useState('')
const [form, setForm] = useState({
name: petForm.name,
owner_name: petForm.owner_name,
s... | method: 'PUT',
headers: {
Accept: contentType,
'Content-Type': contentType,
},
body: JSON.stringify(form),
})
// Throw error with status code in case Fetch API req failed
if (!res.ok) {
| rm.dislikes,
})
/* The PUT method edits an existing entry in the mongodb database. */
const putData = async (form) => {
const { id } = router.query
try {
const res = await fetch(`/api/pets/${id}`, {
| {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/components/Form.js",
"language": "javascript",
"file_size": 4991,
"cut_index": 614,
"middle_length": 229
} |
nk'
import dbConnect from '../lib/dbConnect'
import Pet from '../models/Pet'
const Index = ({ pets }) => (
<>
{/* Create a card for each pet */}
{pets.map((pet) => (
<div key={pet._id}>
<div className="card">
<img src={pet.image_url} />
<h5 className="pet-name">{pet.name}</h... | ))}
</ul>
</div>
<div className="dislikes info">
<p className="label">Dislikes</p>
<ul>
{pet.dislikes.map((data, index) => (
<li key={index}>{data} | es and Dislikes */}
<div className="likes info">
<p className="label">Likes</p>
<ul>
{pet.likes.map((data, index) => (
<li key={index}>{data} </li>
| {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/pages/index.js",
"language": "javascript",
"file_size": 1867,
"cut_index": 537,
"middle_length": 229
} |
t {
NodeModuleTracePlugin,
NodeModuleTracePluginOptions,
} from '@vercel/webpack-nft'
import type { NextConfig } from 'next'
export function createNodeFileTrace(options?: NodeModuleTracePluginOptions) {
return function withNodeFileTrace(config: NextConfig = {}) {
const createWebpackConfig = config.webpack
... | & !context.dev) {
const plugin = new NodeModuleTracePlugin(options)
if (config.plugins) {
config.plugins.push(plugin)
} else {
config.plugins = [plugin]
}
}
return config
}
return con | ext.isServer & | {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/src/index.ts",
"language": "typescript",
"file_size": 797,
"cut_index": 517,
"middle_length": 14
} |
interfaces/compose.js'
import { groupRows, printComparison } from './compare.js'
import { readSnapshot, resolveCompareTarget } from './snapshot.js'
import { pathToFileURL } from 'url'
const SUBCOMMANDS = new Set(['run', 'compare'])
;(async () => {
// Subcommand dispatch. `devlow-bench run [opts] scenario.mjs` and
... |
}
await runRunSubcommand(rest)
})().catch((e) => {
console.error(e.stack)
process.exit(1)
})
async function runCompareSubcommand(argv: string[]): Promise<void> {
const args = minimist(argv, {
alias: { '?': 'help', h: 'help' },
})
if (ar | const first = argv[0]
const sub = first && SUBCOMMANDS.has(first) ? first : 'run'
const rest = first && SUBCOMMANDS.has(first) ? argv.slice(1) : argv
if (sub === 'compare') {
await runCompareSubcommand(rest)
return | {
"filepath": "turbopack/packages/devlow-bench/src/cli.ts",
"language": "typescript",
"file_size": 7933,
"cut_index": 716,
"middle_length": 229
} |
e.js'
export interface Command {
ok(): Promise<void>
kill(): Promise<void>
end(): Promise<number>
waitForOutput(
regex: RegExp,
options?: {
timeoutMs?: number
}
): Promise<RegExpMatchArray>
reportMemUsage(
metricName: string,
options: {
relativeTo?: string | typeof PREVIOUS
... | ildProcess) {
process.stdout?.pipe(split2()).on('data', (data) => {
const str = data.toString()
this.stdout += str + '\n'
this.output += str + '\n'
if (shellOutput) {
console.log(`[STDOUT] ${str}`)
}
if (this | ELL_OUTPUT
class CommandImpl {
stdout: string = ''
stderr: string = ''
output: string = ''
outputCursor: number = 0
exitPromise: Promise<number>
waitingForOutput: (() => void)[] = []
constructor(private process: Ch | {
"filepath": "turbopack/packages/devlow-bench/src/shell.ts",
"language": "typescript",
"file_size": 5291,
"cut_index": 716,
"middle_length": 229
} |
string; job: Job }> {
console.log(
`fetchJobLogsFromWorkflow ${job.name}: Checking test results for the job`
)
// downloadJobLogsForWorkflowRun returns a redirect to the actual logs
// The returned URL is valid (without any additional auth) for 1 minute
const jobLogRedirectResponse =
await octokit.r... | ub.v3+json',
},
})
console.log(
`fetchJobLogsFromWorkflow ${job.name}: Logs response status ${jobLogsResponse.status}`
)
if (!jobLogsResponse.ok) {
throw new Error(
`Failed to get logsUrl, got status ${jobLogsResponse.status}`
| job.name}: Trying to get logs from redirect url ${jobLogRedirectResponse.url}`
)
// fetch the actual logs
const jobLogsResponse = await fetch(jobLogRedirectResponse.url, {
headers: {
Accept: 'application/vnd.gith | {
"filepath": ".github/actions/next-integration-stat/src/index.ts",
"language": "typescript",
"file_size": 20343,
"cut_index": 1331,
"middle_length": 229
} |
from '@mui/material/Container'
import Typography from '@mui/material/Typography'
import Box from '@mui/material/Box'
import Link from '@mui/material/Link'
import ProTip from './components/ProTip'
import Copyright from './components/Copyright'
export default function Home() {
return (
<Container maxWidth="lg">
... | mb: 2 }}>
Material UI - Next.js App Router example in TypeScript
</Typography>
<Link href="/about" color="secondary">
Go to the about page
</Link>
<ProTip />
<Copyright />
</Box>
</Conta | <Typography variant="h4" component="h1" sx={{ | {
"filepath": "turbopack/benchmark-apps/mui/App.tsx",
"language": "tsx",
"file_size": 879,
"cut_index": 559,
"middle_length": 52
} |
} from 'next/router'
import Link from 'next/link'
import dbConnect from '../../lib/dbConnect'
import Pet from '../../models/Pet'
/* Allows you to view pet card info and delete pet card*/
const PetPage = ({ pet }) => {
const router = useRouter()
const [message, setMessage] = useState('')
const handleDelete = asy... | >
<p className="pet-name">{pet.name}</p>
<p className="owner">Owner: {pet.owner_name}</p>
{/* Extra Pet Info: Likes and Dislikes */}
<div className="likes info">
<p className="label">Likes</p>
| ge('Failed to delete the pet.')
}
}
return (
<div key={pet._id}>
<div className="card">
<img src={pet.image_url} />
<h5 className="pet-name">{pet.name}</h5>
<div className="main-content" | {
"filepath": "turbopack/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/pages/[id]/index.js",
"language": "javascript",
"file_size": 2058,
"cut_index": 563,
"middle_length": 229
} |
ose from './interfaces/compose.js'
import { runScenarios } from './runner.js'
let currentScenarios: Scenario[] | null = null
export function setCurrentScenarios(scenarios: Scenario[] | null): void {
currentScenarios = scenarios
}
export function describe<P>(
name: string,
config: ConfigFor<P>,
fn: (props: P)... | .js`)
} catch (e) {
iface = await import(ifaceName)
}
iface = (iface && (iface as any).default) || iface
if (typeof iface === 'function') {
iface = await iface()
}
if (!iface) {
| RFACE || 'interactive,console'
const ifaces = []
for (const ifaceName of ifaceNames.split(',').map((s) => s.trim())) {
let iface: unknown
try {
iface = await import(`./interfaces/${ifaceName} | {
"filepath": "turbopack/packages/devlow-bench/src/describe.ts",
"language": "typescript",
"file_size": 4687,
"cut_index": 614,
"middle_length": 229
} |
extends string
? string[]
: P[K] extends number
? number[]
: P[K] extends boolean
? boolean[] | boolean
: never
}
export interface Scenario {
name: string
config: Record<string, (string | number | boolean)[]>
only: boolean
fn: (props: Record<string, string | number | boolea... | t: string
relativeTo?: string
mean: number
p50: number
p90: number
}
export interface FullInterface {
filterScenarios(scenarios: Scenario[]): Promise<Scenario[]>
filterScenarioVariants(
scenarioVariants: ScenarioVariant[]
): Promise<Scen | iant
iface: FullInterface
measurements: Map<
string,
{
value: number
unit: string
}
>
}
export type Interface = Partial<FullInterface>
export interface VariantStatistic {
samples: number[]
uni | {
"filepath": "turbopack/packages/devlow-bench/src/index.ts",
"language": "typescript",
"file_size": 2668,
"cut_index": 563,
"middle_length": 229
} |
rt { Link, Typography, SvgIcon, type SvgIconProps } from '@mui/joy'
function LightBulbIcon(props: SvgIconProps) {
return (
<SvgIcon {...props}>
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3... | color: 'text.secondary' }}>
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
{'Pro tip: See more '}
<Link href="https://mui.com/material-ui/getting-started/templates/">
templates
</Link>
{' in the Material UI | p() {
return (
<Typography sx={{ mt: 6, mb: 3, | {
"filepath": "turbopack/benchmark-apps/joy/ProTip.tsx",
"language": "tsx",
"file_size": 898,
"cut_index": 547,
"middle_length": 52
} |
er (scenario, variant, metric, sample). Long-format so the same
// file can store mixed-unit metrics (ms, MB, requests, ...) without sparse
// columns. Consumers can filter by `unit` and pivot downstream.
export interface SnapshotRow {
timestamp: string
scenario: string
variant: string
metric: string
sample_i... | em-safe, lexicographic-sortable.
const stamp = now.toISOString().replace(/[:.]/g, '-').replace(/Z$/, 'Z')
return resolve(join(dir, `${stamp}.csv`))
}
export async function writeSnapshot(
path: string,
rows: SnapshotRow[]
): Promise<void> {
await | metric',
'sample_idx',
'value',
'unit',
'relative_to',
'git_sha',
'git_branch',
]
export function defaultSnapshotPath(
dir: string = DEFAULT_SNAPSHOT_DIR,
now: Date = new Date()
): string {
// ISO-ish, filesyst | {
"filepath": "turbopack/packages/devlow-bench/src/snapshot.ts",
"language": "typescript",
"file_size": 5224,
"cut_index": 716,
"middle_length": 229
} |
esponse Work
*
* Tests whether the agent uses after() from next/server to schedule work
* (logging, analytics) after the response is sent, without blocking it.
*
* Tricky because agents use fire-and-forget promises, setTimeout, or
* Vercel-specific waitUntil() instead of the built-in after() API.
*/
import { ex... | in(appDir, f), 'utf-8')).join('\n')
}
test('Component imports after from next/server', () => {
const content = readAppFiles()
expect(content).toMatch(/import.*after.*from\s+['"]next\/server['"]/)
})
test('Component uses after() with callback', () => |
if (!existsSync(appDir)) return ''
const entries = readdirSync(appDir, { recursive: true }) as string[]
const files = entries.filter((f) => f.endsWith('.tsx') || f.endsWith('.ts'))
return files.map((f) => readFileSync(jo | {
"filepath": "evals/evals/agent-036-after-response/EVAL.ts",
"language": "typescript",
"file_size": 1850,
"cut_index": 537,
"middle_length": 229
} |
eTracePluginOptions {
cwd?: string
// relative to cwd
contextDirectory?: string
// additional PATH environment variable to use for spawning the `node-file-trace` process
path?: string
// control the maximum number of files that are passed to the `node-file-trace` command
// default is 128
maxFiles?: num... | nstructor(private readonly options?: NodeModuleTracePluginOptions) {}
apply(compiler: Compiler) {
compiler.hooks.compilation.tap(
NodeModuleTracePlugin.PluginName,
(compilation) => {
compilation.hooks.processAssets.tap(
| | 'note'
| 'suggestions'
| 'info'
}
}
export class NodeModuleTracePlugin implements WebpackPluginInstance {
static PluginName = 'NodeModuleTracePlugin'
private readonly chunksToTrace = new Set<string>()
co | {
"filepath": "turbopack/packages/webpack-nmt/src/index.ts",
"language": "typescript",
"file_size": 5102,
"cut_index": 716,
"middle_length": 229
} |
arguments: args,
};
},
peg$c31 = "{",
peg$c32 = peg$literalExpectation("{", false),
peg$c33 = "}",
peg$c34 = peg$literalExpectation("}", false),
peg$c35 = function (head, tail) {
return {
type: "scalar_object_expression",
properties: head ? [head, ...tail] : [],... | ined_constant" };
},
peg$c44 = function () {
return { type: "null_constant" };
},
peg$c45 = function () {
return {
type: "boolean_constant",
value: false,
};
},
peg$c46 = function () {
return | return {
type: "scalar_array_expression",
elements,
};
},
peg$c41 = "undefined",
peg$c42 = peg$literalExpectation("undefined", false),
peg$c43 = function () {
return { type: "undef | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/peg/input.js",
"language": "javascript",
"file_size": 169962,
"cut_index": 7068,
"middle_length": 229
} |
;
var b = 4;
var b = 5;
var b = 6;
var b = c;
var c = 7;
var c = 8;
var c = 9;
var c = a;
// cached
var x = a;
var x = b;
var x = c;
var y = a;
var y = b;
var y = c;
var z = a;
var z = b;
var z = c;
// chaining
var y = x;
var z = y;
var z1 = z;
var z2 = z1;
var z3 = z2;
var z4 = z3;
var z5 = z4;
var z6 = z5;
var z7 =... | 42;
var f52 = f42;
var f52 = f41;
var f61 = f51;
var f61 = f52;
var f62 = f52;
var f62 = f51;
var f71 = f61;
var f71 = f62;
var f72 = f62;
var f72 = f61;
var f81 = f71;
var f81 = f72;
var f82 = f72;
var f82 = f71;
var f91 = f81;
var f91 = f82;
var f92 = f8 | > () => () => () => 1;
var f21 = f11;
var f21 = f12;
var f22 = f12;
var f22 = f11;
var f31 = f21;
var f31 = f22;
var f32 = f22;
var f32 = f21;
var f41 = f31;
var f41 = f32;
var f42 = f32;
var f42 = f31;
var f51 = f41;
var f51 = f | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/cycle-cache/input.js",
"language": "javascript",
"file_size": 2544,
"cut_index": 563,
"middle_length": 229
} |
ns) {
// Convert to byte array
if (message.constructor == String)
if (options && options.encoding === "binary")
message = bin.stringToBytes(message);
else message = utf8.stringToBytes(message);
else if (isBuffer(message))
message = Array.prototype.slice.call(message, ... | |
(((m[i] << 24) | (m[i] >>> 8)) & 0xff00ff00);
}
// Padding
m[l >>> 5] |= 0x80 << l % 32;
m[(((l + 64) >>> 9) << 4) + 14] = l;
// Method shortcuts
var FF = md5._ff,
GG = md5._gg,
HH = md5._h | a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
// Swap endian
for (var i = 0; i < m.length; i++) {
m[i] =
(((m[i] << 8) | (m[i] >>> 24)) & 0x00ff00ff) | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/md5_2/input.js",
"language": "javascript",
"file_size": 6068,
"cut_index": 716,
"middle_length": 229
} |
inferred as not having non-root assignments
export function named_function_export_const_after_eval() {
}
if (true) {
named_function_export_const_after_eval = 2
}
// should be inferred as not having non-root assignments
export default function default_function_export_const_after_eval() {
}
for (let i = 0; i < 10; ... | eval_2 = 1
export {named_let_export_not_const_after_eval as e4, named_let_export_const_after_eval_2}
named_let_export_const_after_eval_2 = 5
setTimeout(() => {
named_let_export_not_const_after_eval = 5
}, 1);
export class ConstAfterEvalClass {
named_ | hould be inferred as not having non-root assignments
let named_let_export_const_after_eval_2
// should be inferred as having non-root assignments
let named_let_export_not_const_after_eval = 1
let named_let_export_not_const_after_ | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/non-root-assignments/input.js",
"language": "javascript",
"file_size": 1313,
"cut_index": 524,
"middle_length": 229
} |
ettier-ignore
const object = { a: 1, 'b': 2, ['c']: 3 };
const a1 = object.a;
const a2 = object["a"];
const b1 = object.b;
const b2 = object["b"];
const c1 = object.c;
const c2 = object["c"];
const d1 = object.d;
const d2 = object["d"];
const object_spread = { a: 11, ...object, b: 22 };
const a3 = object_spread.a;
c... | a5 = unknown_spread.a;
const b5 = unknown_spread.b;
const c5 = unknown_spread.c;
const object2 = { a: 1, [global]: 2, c: 3, [global]: 4, e: 5 };
const a6 = object2.a;
const b6 = object2.b;
const c6 = object2.c;
const d6 = object2.d;
const e6 = object2.e; | t unknown_spread = { a: 1, ...global, b: 2 };
const | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/object/input.js",
"language": "javascript",
"file_size": 826,
"cut_index": 517,
"middle_length": 52
} |
ort { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import Document, { Html, Head, Main, NextScript } from 'next/document';
class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return {
... | (Html, {
children: [
_jsx(Head, {}),
_jsxs("body", {
children: [
_jsx(Main, {}),
_jsx(NextScript, {})
]
})
| dangerouslySetInnerHTML: {
__html: `html { background: hotpink; }`
}
})
]
})
};
}
render() {
return _jsxs | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/amphtml-document/input.js",
"language": "javascript",
"file_size": 1060,
"cut_index": 515,
"middle_length": 229
} |
peof exports === 'object' && typeof module !== 'undefined') {
module.exports = f()
} else if (typeof define === 'function' && define.amd) {
define([], f)
} else {
var g
if (typeof window !== 'undefined') {
g = window
} else if (typeof global !== 'undefined') {
g = global
} else i... | var a = new Error("Cannot find module '" + i + "'")
throw ((a.code = 'MODULE_NOT_FOUND'), a)
}
var p = (n[i] = { exports: {} })
e[i][0].call(
p.exports,
function (r) {
var n = | (e, n, t) {
function o(i, f) {
if (!n[i]) {
if (!e[i]) {
var c = 'function' == typeof require && require
if (!f && c) return c(i, !0)
if (u) return u(i, !0)
| {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/browserify-uglify/input.js",
"language": "javascript",
"file_size": 1646,
"cut_index": 537,
"middle_length": 229
} |
'node_modules/object-assign/index.js',
'node_modules/object-assign/package.json',
'node_modules/prop-types/checkPropTypes.js',
'node_modules/prop-types/factoryWithThrowingShims.js',
'node_modules/prop-types/factoryWithTypeCheckers.js',
'node_modules/prop-types/index.js',
'node_modules/prop-types/lib/React... | evelopment.js',
'node_modules/react/cjs/react.production.min.js',
'node_modules/react/index.js',
'node_modules/react/package.json',
'package.json',
'test/unit/webpack-wrapper-strs-namespaces-large/content/guides/index.md',
'test/unit/webpack-wr | /react-is.production.min.js',
'node_modules/prop-types/node_modules/react-is/index.js',
'node_modules/prop-types/node_modules/react-is/package.json',
'node_modules/prop-types/package.json',
'node_modules/react/cjs/react.d | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper-strs-namespaces-large/output.js",
"language": "javascript",
"file_size": 1116,
"cut_index": 515,
"middle_length": 229
} |
peof exports === 'object' && typeof module !== 'undefined') {
module.exports = f()
} else if (typeof define === 'function' && define.amd) {
define([], f)
} else {
var g
if (typeof window !== 'undefined') {
g = window
} else if (typeof global !== 'undefined') {
g = global
} else i... | var a = new Error("Cannot find module '" + i + "'")
throw ((a.code = 'MODULE_NOT_FOUND'), a)
}
var p = (n[i] = { exports: {} })
e[i][0].call(
p.exports,
function (r) {
var n = | (e, n, t) {
function o(i, f) {
if (!n[i]) {
if (!e[i]) {
var c = 'function' == typeof require && require
if (!f && c) return c(i, !0)
if (u) return u(i, !0)
| {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/browserify/input.js",
"language": "javascript",
"file_size": 1646,
"cut_index": 537,
"middle_length": 229
} |
any
import type { Processor } from 'postcss'
// @ts-ignore
import postcss from '@vercel/turbopack/postcss'
// @ts-ignore
import importedConfig from 'CONFIG'
import { getReadEnvVariables, toPath, type TransformIpc } from './transforms'
let processor: Processor | undefined
export const init = async (ipc: TransformIp... | | any) => {
if (Array.isArray(plugin)) {
return plugin
} else if (typeof plugin === 'string') {
return [plugin, {}]
} else {
return plugin
}
})
} else if (typeof config.plugins === 'object') {
plug | 'PostCSS config is undefined (make sure to export an function or object from config file)'
)
}
let plugins: any[]
if (Array.isArray(config.plugins)) {
plugins = config.plugins.map((plugin: [string, any] | string | {
"filepath": "turbopack/crates/turbopack-node/js/src/transforms/postcss.ts",
"language": "typescript",
"file_size": 3314,
"cut_index": 614,
"middle_length": 229
} |
ode.js bundle (runtime + module chunks + entry
* chunk) and sends the chunk code via IPC. This evaluator loads them in memory
* using vm.compileFunction, wiring up a minimal CJS require that resolves
* relative paths against an in-memory chunk map and delegates external packages
* to the real Node.js require.
*/
... | rface ImportModuleResult {
entryPath: string
chunks: Array<{
path: string
code?: string
binary?: string
sourceMap?: string
}>
}
export function evaluateBundle(result: ImportModuleResult): any {
const chunkMap = new Map<string, stri | t the project directory.
// This bypasses Turbopack's module analysis (which can't handle dynamic
// require calls) while still resolving npm packages correctly.
const nodeRequire = createRequire(process.cwd() + '/')
export inte | {
"filepath": "turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders-runtime.ts",
"language": "typescript",
"file_size": 3411,
"cut_index": 614,
"middle_length": 229
} |
_nccwpck_require__.ab = __dirname + "/";
var n = "<unknown>";
export function parse(e) {
var r = e.split("\n");
return r.reduce(function (e, r) {
var n =
parseChrome(r) ||
parseWinjs(r) ||
parseGecko(r) ||
parseNode(r) ||
parseJSC(r);
if (n) {
e.push(n);
}
return... | null) {
r[2] = i[1];
r[3] = i[2];
r[4] = i[3];
}
return {
file: !u ? r[2] : null,
methodName: r[1] || n,
arguments: u ? [r[2]] : [],
lineNumber: r[3] ? +r[3] : null,
column: r[4] ? +r[4] : null,
};
}
var u =
/^\s*at | )(?::(\d+))\)/;
function parseChrome(e) {
var r = a.exec(e);
if (!r) {
return null;
}
var u = r[2] && r[2].indexOf("native") === 0;
var t = r[2] && r[2].indexOf("eval") === 0;
var i = l.exec(r[2]);
if (t && i != | {
"filepath": "turbopack/crates/turbopack-node/js/src/compiled/stacktrace-parser/index.js",
"language": "javascript",
"file_size": 2578,
"cut_index": 563,
"middle_length": 229
} |
length: number
}
export type Ipc<TIncoming, TOutgoing> = {
recv(): Promise<TIncoming>
send(message: TOutgoing): Promise<void>
sendError(error: Error | string): Promise<never>
sendReady(): Promise<void>
}
function createIpc<TIncoming, TOutgoing>(
port: number
): Ipc<TIncoming, TOutgoing> {
const soc... | ocket.once('drain', cb)
}
},
final(cb) {
socket.end(cb)
},
})
const packetQueue: Buffer[] = []
const recvPromiseResolveQueue: Array<(message: TIncoming) => void> = []
function pushPacket(packet: Buffer) {
const recvPro | e backpressure and wait for the socket to be drained
* before writing more data.
*/
const socketWritable = new Writable({
write(chunk, _enc, cb) {
if (socket.write(chunk)) {
cb()
} else {
s | {
"filepath": "turbopack/crates/turbopack-node/js/src/child_process/index.ts",
"language": "typescript",
"file_size": 6241,
"cut_index": 716,
"middle_length": 229
} |
} from '../error'
export const TEXT_ENCODER = new TextEncoder()
export const TEXT_DECODER = new TextDecoder()
export interface TaskMessage {
taskId: number
data: Uint8Array
}
export interface Binding {
recvTaskMessageInWorker(workerId: number): Promise<TaskMessage>
sendTaskMessage(msg: TaskMessage): Promise<... | XT_ENCODER.encode(
JSON.stringify({
type: 'info',
data: message,
})
),
})
}
async sendRequest(message: any) {
const id = TaskChannel.nextId++
let resolve, reject
const promise = new Promise((re | atic requests = new Map()
constructor(
private binding: Binding,
private taskId: number
) {}
async sendInfo(message: any) {
return await this.binding.sendTaskMessage({
taskId: this.taskId,
data: TE | {
"filepath": "turbopack/crates/turbopack-node/js/src/worker_thread/taskChannel.ts",
"language": "typescript",
"file_size": 1863,
"cut_index": 537,
"middle_length": 229
} |
}}return a}},773:(e,r,t)=>{e.exports={verify:t(624),sign:t(743),JsonWebTokenError:t(131),NotBeforeError:t(422),TokenExpiredError:t(794)};Object.defineProperty(e.exports,"decode",{enumerable:false,value:t(443)})},131:e=>{var JsonWebTokenError=function(e,r){Error.call(this,e);if(Error.captureStackTrace){Error.captureStac... | .prototype.constructor=NotBeforeError;e.exports=NotBeforeError},794:(e,r,t)=>{var n=t(131);var TokenExpiredError=function(e,r){n.call(this,e);this.name="TokenExpiredError";this.expiredAt=r};TokenExpiredError.prototype=Object.create(n.prototype);TokenExpire | =JsonWebTokenError;e.exports=JsonWebTokenError},422:(e,r,t)=>{var n=t(131);var NotBeforeError=function(e,r){n.call(this,e);this.name="NotBeforeError";this.date=r};NotBeforeError.prototype=Object.create(n.prototype);NotBeforeError | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/benches/jsonwebtoken.js",
"language": "javascript",
"file_size": 120724,
"cut_index": 3790,
"middle_length": 229
} |
f an array of little-endian words, and a bit length.
*/
function wordsToMd5(x, len) {
/* append padding */
x[len >> 5] |= 0x80 << len % 32;
x[(((len + 64) >>> 9) << 4) + 14] = len;
var i;
var olda;
var oldb;
var oldc;
var oldd;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var ... | );
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5ff(c, d, a, b, x[i + 10], 17, | 1], 12, -389564586);
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426 | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/md5-reduced/input.js",
"language": "javascript",
"file_size": 1643,
"cut_index": 537,
"middle_length": 229
} |
(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-in... | ine-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity str | style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overl | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/react-dom-production/input.js",
"language": "javascript",
"file_size": 131737,
"cut_index": 3790,
"middle_length": 229
} |
tests_snapshot_scope-hoisting_split-shared_input_0-l1v8m._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/x/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
setTimeout(()=>__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests... | e.js [test] (ecmascript, async loader)"), 1000);
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var _ | ed/input/y/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
setTimeout(()=>__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/middl | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/1do3_crates_turbopack-tests_tests_snapshot_scope-hoisting_split-shared_input_0-l1v8m._.js",
"language": "javascript",
"file_size": 3260,
"cut_index": 614,
"middle_length": 229
} |
pshot/scope-hoisting/split-shared/input/big/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// MERGED MODULE: [project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/big/index.js [test] (ecmascript)
;
__turbopack_context__.s([
"default",
()=>__TURB... | w5FDmaTfLPdX4NfEzJYzehn
T6Qw1dW8tnJ3VJUHHE0QUch181CwhbSHbRvzCzwJ66gJ5PWLzpCit6mZ2ZaGuM3kg6Gmmj301bwKWvY0EhFLW26YiDJYyFeb8uR6
NqBFFqm409pvFhfRdyZWWdBuEdd2TTdQxUgpBd6d147SKeRDj0HyrXKZNc0gd5Cj9pX8grD16fThjEE1uvkn3vPS8HkB7VXcC2Vq
UebF0aQGxrMnWffrjvxme63giD0ZTx | ack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/big/other.js [test] (ecmascript)
;
const __TURBOPACK__default__export__ = `
v8XyDjNBXwWR6pNaTwYLp5bfUJ1P8nN4Yigyk9c9S9Xt5JHt28veqF0SRPGEmShfRPTn2LnHWZbPW | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/1jsg_tests_snapshot_scope-hoisting_split-shared_input_big_index_194gu9x.js",
"language": "javascript",
"file_size": 6312,
"cut_index": 716,
"middle_length": 229
} |
obalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_scope-hoisting_split-shared_input_x_inner_09sg0bz.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/x/inner.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__t... | __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$scope$2d$hoisting$2f$split$2d$shared$2f$input$2f$big$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"]);
}),
]);
//# sourceMappi | $big$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/big/index.js [test] (ecmascript)");
;
console.log('x', | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/1jsg_tests_snapshot_scope-hoisting_split-shared_input_x_inner_09sg0bz.js",
"language": "javascript",
"file_size": 1082,
"cut_index": 515,
"middle_length": 229
} |
"TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_scope-hoisting_split-shared_input_y_middle_1inkhp4.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/middle.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// MERGED ... | mascript)
;
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$scope$2d$hoisting$2f$split$2d$shared$2f$input$2f$big$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context_ | rbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/middle.js [test] (ecmascript)");
// MERGED MODULE: [project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/inner.js [test] (ec | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/1jsg_tests_snapshot_scope-hoisting_split-shared_input_y_middle_1inkhp4.js",
"language": "javascript",
"file_size": 1501,
"cut_index": 524,
"middle_length": 229
} |
6YiDJYyFeb8uR6
NqBFFqm409pvFhfRdyZWWdBuEdd2TTdQxUgpBd6d147SKeRDj0HyrXKZNc0gd5Cj9pX8grD16fThjEE1uvkn3vPS8HkB7VXcC2Vq
UebF0aQGxrMnWffrjvxme63giD0ZTxeVGtmC5ZqeLyPEeCb2Lm2zuBdRnGNSk3JTNgM71FA7xTGyZZunNFS4bNkcJi5RB9AiteZE
Nz718p8qXRG1iZKnQZ8em8dwn1kb5qgggB2qqywKBXupBz3ebCWVMvE15AeDUNZaMuWZvQFMvBykkACHF6keYBEHVJtAyHndnEdp
Tp... | N1peK6G3bGEf5L03uxa6khMAjjN6zQbGi2HZTNv9wfYVn4QTbeBXTcWQgDnCZzE9WaBXhWcrS0GfiQD8m
vbFQXik86nXtAhiNtu0g560xUCXZJbz5D9W31cg80UnReCDTLibP1D3JMbndT7J7ANSG82t8bjkNkaUi43xp6uinnMXQFhH1vk1c
1rrhV0jLndXicquu3CDQBycRPV2ZSXtwgnaD2YWZdcpCTky7bAEq3NuxSYutTr0cD2YkeJJc9 | yCCrREa
LpmSKuP2JpbqCgc3ewnhkD87TRu1rEaXfFFgvw6ZhwGHf2bAJKJ7GA9QGzGBmrmRPHprjUnfzGMaSxUCxHmftAPTm2L644neCXuj
3f8z9EY7Bqa1nagKyPi9DpZyDAGe2i0NzugGhB8xbW3K7xAKCEmhf5wZJ6RnQZDa4mqiLSxSz8gqGBu8Q5ALg4ybkbK6McwgR5QV
A0ag6Fb9dRV3Au8DPzK | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/big/other.js",
"language": "javascript",
"file_size": 5271,
"cut_index": 716,
"middle_length": 229
} |
napshot_scope-hoisting_duplicate-imports_input_11zbkdc._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/shared.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
module.exports = 'shared';
}),
"[project]/turbopack/crates/turbopack-tests/tests... | ipt)");
// MERGED MODULE: [project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/c.js [test] (ecmascript)
;
// MERGED MODULE: [project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-impor | snapshot/scope-hoisting/duplicate-imports/input/index.js [test] (ecmascript)
;
__turbopack_context__.s([], "[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/index.js [test] (ecmascr | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/output/0_9x_turbopack-tests_tests_snapshot_scope-hoisting_duplicate-imports_input_11zbkdc._.js",
"language": "javascript",
"file_size": 3415,
"cut_index": 614,
"middle_length": 229
} |
ction toFixed(value, maxDecimals, roundingFunction, optionals) {
var splitValue = value.toString().split('.'),
minDecimals = maxDecimals - (optionals || 0),
optionalsRegExp,
power,
output
var boundedPrecisions
// var unused = 'xxxx';
// Use the smallest precision value possible to avoid errors ... | / power).toFixed(
boundedPrecisions
)
if (optionals > maxDecimals - boundedPrecisions) {
optionalsRegExp = new RegExp(
'\\.?0{1,' + (optionals - (maxDecimals - boundedPrecisions)) + '}$'
)
output = output.replace(optionalsRegExp | boundedPrecisions = minDecimals
}
power = Math.pow(10, boundedPrecisions)
// Multiply up by precision, round accurately, then divide and use native toFixed():
output = (roundingFunction(value + 'e+' + boundedPrecisions) | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/minification/paren-remover/input/index.js",
"language": "javascript",
"file_size": 1063,
"cut_index": 515,
"middle_length": 229
} |
ests_snapshot_bd603f1a._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/component/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>MyApp
]);
var __TURBOPACK__imported__module__$5b$p... | 2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$test$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
children: "App"
}, void 0, false, {
fileName: "[project]/turbopack/crat | ("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/react/jsx-dev-runtime.js [test] (ecmascript)");
;
function MyApp() {
return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$ | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/output/turbopack_crates_turbopack-tests_tests_snapshot_bd603f1a._.js",
"language": "javascript",
"file_size": 3636,
"cut_index": 614,
"middle_length": 229
} |
] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [
op[0] & 2,
t.value
];
switch(op[0]){
case 0:
case 1:
t = op;
... | op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = | };
case 5:
_.label++;
y = op[1];
op = [
0
];
continue;
case 7:
| {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/0rv8_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_04jskxh.js",
"language": "javascript",
"file_size": 76432,
"cut_index": 3790,
"middle_length": 229
} |
|| (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_1v9rcb0._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/input/index.js [test] (ecmascript)", (function(__turbopack_context__){
"use strict";
__turbopack_context__.s([
"defaul... | ;
;
var Foo = function Foo() {
"use strict";
(0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$swc$2f$helpers$2f$_$2f$_class_call_check$2e$js__$5b$test$5d$__$28$e | lpers$2f$_$2f$_class_call_check$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js [test] (ecmascript)") | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/turbopack_crates_turbopack-tests_tests_snapshot_1v9rcb0._.js",
"language": "javascript",
"file_size": 1560,
"cut_index": 537,
"middle_length": 229
} |
] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_swc_transforms_preset_env_modern_input_1utkugv._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env_modern/input/Tokenizer.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
... | _transforms$2f$preset_env_modern$2f$input$2f$Tokenizer$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env_modern/input/Tokenizer.js [test] (ecmascript)"); | , ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"comment",
()=>comment
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$swc | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env_modern/output/0_9x_turbopack-tests_tests_snapshot_swc_transforms_preset_env_modern_input_1utkugv._.js",
"language": "javascript",
"file_size": 2266,
"cut_index": 563,
"middle_length": 229
} |
ests_tests_snapshot_1xzb8po._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$te... | snapshot$2f$node_modules$2f40$emotion$2f$react$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js [test] (ecmascript)");
var __TURBOPA | ests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js [test] (ecmascript)");
/** @jsxImportSource @emotion/react */ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$ | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_1xzb8po._.js",
"language": "javascript",
"file_size": 3349,
"cut_index": 614,
"middle_length": 229
} |
"TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_basic_shebang_input_02e38zh._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context_... | $project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$shebang$2f$input$2f$node_modules$2f$foo$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["foo"])(true);
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapsho | $5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/node_modules/foo/index.js [test] (ecmascript)");
;
(0, __TURBOPACK__imported__module__$5b | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_shebang_input_02e38zh._.js",
"language": "javascript",
"file_size": 1342,
"cut_index": 524,
"middle_length": 229
} |
lThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_ts-parse-error_input_04t2r94._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/ts-parse-error/input/other.ts [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
va... | ed__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$ts$2d$parse$2d$error$2f$input$2f$other$2e$ts__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/t | ;
throw e;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/ts-parse-error/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__import | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/basic/ts-parse-error/output/1do3_crates_turbopack-tests_tests_snapshot_basic_ts-parse-error_input_04t2r94._.js",
"language": "javascript",
"file_size": 1194,
"cut_index": 518,
"middle_length": 229
} |
opack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/foo/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"foo",
()=>foo
]);
function foo(value) {
console.assert(value);
}
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/bas... | ack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/foo/index.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$async_chunk_build$2f$inpu | ck$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$async_chunk_build$2f$input$2f$node_modules$2f$foo$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbop | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/1do3_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_0aldyki._.js",
"language": "javascript",
"file_size": 2252,
"cut_index": 563,
"middle_length": 229
} |
opack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/bar/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"bar",
()=>bar
]);
function bar(value) {
console.assert(value);
}
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/bas... | ests$2f$snapshot$2f$basic$2f$async_chunk_build$2f$input$2f$node_modules$2f$bar$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/node_module | c/async_chunk_build/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$t | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/1do3_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_1a38y3r._.js",
"language": "javascript",
"file_size": 2562,
"cut_index": 563,
"middle_length": 229
} |
ort { getPathname } from '../../lib/url';
const hasPostpone = typeof React.unstable_postpone === 'function';
export function createPrerenderState(isDebugSkeleton) {
return {
isDebugSkeleton,
dynamicAccesses: []
};
}
export function markCurrentScopeAsDynamic(store, expression) {
const pathnam... | se if (store.prerenderState) {
postponeWithTracking(store.prerenderState, expression, pathname);
} else {
store.revalidate = 0;
if (store.isStaticGeneration) {
const err = new DynamicServerError(`Route ${pathname} co | e} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
} el | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/failed-2/input.js",
"language": "javascript",
"file_size": 5101,
"cut_index": 716,
"middle_length": 229
} |
= getProperError(e);
return {
name: e.name,
message: e.message,
stack: typeof e.stack === "string" ? parseStackTrace(e.stack) : []
};
}
function createIpc(port) {
const socket = createConnection(port, "127.0.0.1");
const packetQueue = [];
const recvPromiseResolveQueue = [];
... | a", (chunk)=>{
buffer = Buffer.concat([
buffer,
chunk
]);
loop: while(true){
switch(state.type){
case "waiting":
{
| toString("utf8")));
} else {
packetQueue.push(packet);
}
}
let state = {
type: "waiting"
};
let buffer = Buffer.alloc(0);
socket.once("connect", ()=>{
socket.on("dat | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/failed-3/input.js",
"language": "javascript",
"file_size": 5775,
"cut_index": 716,
"middle_length": 229
} |
mponentLoadStart = 0;
let clientComponentLoadTimes = 0;
let clientComponentLoadCount = 0;
export function wrapClientComponentLoader(ComponentMod) {
if (!('performance' in globalThis)) {
return ComponentMod.__next_app__;
}
return {
require: (...args)=>{
if (clientComponentLoadStar... | {
const startTime = performance.now();
try {
clientComponentLoadCount += 1;
return ComponentMod.__next_app__.loadChunk(...args);
} finally{
clientComponentLoadTimes += perf | nt += 1;
return ComponentMod.__next_app__.require(...args);
} finally{
clientComponentLoadTimes += performance.now() - startTime;
}
},
loadChunk: (...args)=> | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/logger/input.js",
"language": "javascript",
"file_size": 1475,
"cut_index": 524,
"middle_length": 229
} |
RouteRouteModule } from '../../server/future/route-modules/app-route/module.compiled';
import { RouteKind } from '../../server/future/route-kind';
import { patchFetch as _patchFetch } from '../../server/lib/patch-fetch';
import * as userland from 'VAR_USERLAND';
// We inject the nextConfigOutput here so that we can use... |
});
// Pull out the exports that we need to expose from the module. This should
// be eliminated when we've moved the other routes to the new format. These
// are used to hook into the route.
const { requestAsyncStorage, workAsyncStorage, serverHooks } = |
pathname: 'VAR_DEFINITION_PATHNAME',
filename: 'VAR_DEFINITION_FILENAME',
bundlePath: 'VAR_DEFINITION_BUNDLE_PATH'
},
resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',
nextConfigOutput,
userland | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/app-route/input.js",
"language": "javascript",
"file_size": 1285,
"cut_index": 524,
"middle_length": 229
} |
rl';
import { toNodeOutgoingHttpHeaders, validateURL } from '../utils';
import { ReflectAdapter } from './adapters/reflect';
import { ResponseCookies } from './cookies';
const INTERNALS = Symbol('internal response');
const REDIRECTS = new Set([
301,
302,
303,
307,
308
]);
function handleMiddlewareFi... | quest-' + key, value);
keys.push(key);
}
headers.set('x-middleware-override-headers', keys.join(','));
}
}
/**
* This class extends the [Web `Response` API](https://developer.mozilla.org/docs/Web/API/Response) with addition | ceof Headers)) {
throw new Error('request.headers must be an instance of Headers');
}
const keys = [];
for (const [key, value] of init.request.headers){
headers.set('x-middleware-re | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/next-response/input.js",
"language": "javascript",
"file_size": 4665,
"cut_index": 614,
"middle_length": 229
} |
pes.d.ts" />
const jest = require('jest-circus')
const expectMod = require('expect')
function setupGlobals() {
globalThis.describe = jest.describe
globalThis.it = jest.it
globalThis.test = jest.test
// @ts-ignore Property 'expect' does not exist on type 'typeof globalThis'
globalThis.expect = expectMod.expe... | value: 'Module',
})
return obj
}
}
const uncaughtExceptions: string[] = []
const unhandledRejections: string[] = []
process.on('uncaughtException', (e) => {
uncaughtExceptions.push(String(e))
})
process.on('unhandledRejection', (e) => {
| 11' }
// From https://github.com/webpack/webpack/blob/9fcaa243573005d6fdece9a3f8d89a0e8b399613/test/TestCases.template.js#L422
globalThis.nsObj = function nsObj(obj) {
Object.defineProperty(obj, Symbol.toStringTag, {
| {
"filepath": "turbopack/crates/turbopack-tests/js/jest-entry.ts",
"language": "typescript",
"file_size": 1893,
"cut_index": 537,
"middle_length": 229
} |
|| (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_cssmodules_relative-uri-import_input_0hybzim._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/other.module.css [test] (css module)", ((__turbopack_context__) => {
__turbopack_conte... | ule.css [test] (css module)")["foo"],
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TUR | __turbopack_context__) => {
__turbopack_context__.v({
"bar": "index-module__jZ0vmq__bar" + " " + __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/other.mod | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/output/0_9x_turbopack-tests_tests_snapshot_cssmodules_relative-uri-import_input_0hybzim._.js",
"language": "javascript",
"file_size": 1526,
"cut_index": 537,
"middle_length": 229
} |
the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distri... | );
}
/*
* Convert an array of little-endian words to an array of bytes
*/
function md5ToHexEncodedArray(input) {
var i;
var x;
var output = [];
var length32 = input.length * 32;
var hexTab = "0123456789abcdef";
var hex;
for (i = 0; i < l | mponent(bytes)); // UTF8 escape
bytes = new Array(msg.length);
for (var i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);
}
return md5ToHexEncodedArray(
wordsToMd5(bytesToWords(bytes), bytes.length * 8)
| {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/md5/input.js",
"language": "javascript",
"file_size": 6826,
"cut_index": 716,
"middle_length": 229
} |
(var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key])
})
} else if (Object.getOwnPropertyDescriptors... | n target
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
| ch(function (key) {
Object.defineProperty(
target,
key,
Object.getOwnPropertyDescriptor(source, key)
)
})
}
}
retur | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper-strs-namespaces-large/input.js",
"language": "javascript",
"file_size": 175723,
"cut_index": 7068,
"middle_length": 229
} |
ace-parser'
import { parse as parseStackTrace } from './compiled/stacktrace-parser'
// merged from next.js
// https://github.com/vercel/next.js/blob/e657741b9908cf0044aaef959c0c4defb19ed6d8/packages/next/src/lib/is-error.ts
// https://github.com/vercel/next.js/blob/e657741b9908cf0044aaef959c0c4defb19ed6d8/packages/nex... | is called in development
if (typeof err === 'undefined') {
return new Error('`undefined` was thrown instead of a real error')
}
if (err === null) {
return new Error('`null` was thrown instead of a real error')
}
}
return n | )
}
export function getProperError(err: unknown): Error {
if (isError(err)) {
return err
}
if (process.env.NODE_ENV === 'development') {
// Provide a better error message for cases where `throw undefined`
// | {
"filepath": "turbopack/crates/turbopack-node/js/src/error.ts",
"language": "typescript",
"file_size": 2202,
"cut_index": 563,
"middle_length": 229
} |
s?: string[]
buildFilePaths?: string[]
}
| {
type: 'emittedError'
severity: 'warning' | 'error'
error: StructuredError
}
| {
type: 'log'
logs: Array<{
time: number
logType: string
args: any[]
trace?: StackFrame[]
}>
}
export type... | contextDir = process.cwd()
const LogType = Object.freeze({
error: 'error',
warn: 'warn',
info: 'info',
log: 'log',
debug: 'debug',
trace: 'trace',
group: 'group',
groupCollapsed: 'groupCollapsed',
groupEnd: 'groupEnd',
profile: 'pro | : string
}
type LoaderConfig =
| string
| {
loader: string
options: { [k: string]: unknown }
}
const {
runLoaders,
}: typeof import('loader-runner') = require('@vercel/turbopack/loader-runner')
const | {
"filepath": "turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts",
"language": "typescript",
"file_size": 20784,
"cut_index": 1331,
"middle_length": 229
} |
error'
import type { Channel } from '../types'
import { Binding, TaskChannel, TEXT_ENCODER, TEXT_DECODER } from './taskChannel'
if (!workerData.hasOwnProperty('bindingPath')) {
throw new Error('bindingPath not set in loader worker thread')
}
const binding: Binding = require(
/* turbopackIgnore: true */ workerData... | kId: number, args: string[]) => {
try {
if (typeof getValue !== 'function') {
const module = await moduleFactory()
if (typeof module.init === 'function') {
await module.init()
}
getValue = module.default
| lizedArgs: any[]) => any
}>
) => {
let getValue: (channel: Channel<any, any>, ...deserializedArgs: any[]) => any
let isRunning = false
const queue: Array<{ taskId: number; args: string[] }> = []
const run = async (tas | {
"filepath": "turbopack/crates/turbopack-node/js/src/worker_thread/evaluate.ts",
"language": "typescript",
"file_size": 3313,
"cut_index": 614,
"middle_length": 229
} |
;
(() => {
var exports = {};
exports.id = 829;
exports.ids = [829];
exports.modules = {
/***/ 5166: /***/ (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__
) => {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webp... | async function handler(_req, res) {
const hello = await (0, promises_namespaceObject.readFile)(
"./hello.txt",
"utf-8"
);
// Get data from your database
res.status(200).json({
users,
| s/promises"); // CONCATENATED MODULE: ./pages/api/users.ts
// Fake users data
const users = [
{
id: 1,
},
{
id: 2,
},
{
id: 3,
},
];
| {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/webpack-target-node/input.js",
"language": "javascript",
"file_size": 1385,
"cut_index": 524,
"middle_length": 229
} |
t, and if it fails we fall back to the
// version that is bundled with Next.js
// this is because @opentelemetry/api has to be synced with the version of
// @opentelemetry/tracing that is used, and we don't want to force users to use
// the version that is bundled with Next.js.
// the API is ~stable, so this should be ... | = 'function';
};
export class BubbledError extends Error {
constructor(bubble, result){
super();
this.bubble = bubble;
this.result = result;
}
}
export function isBubbledError(error) {
if (typeof error !== 'object' || er | re('next/dist/compiled/@opentelemetry/api');
}
}
const { context, propagation, trace, SpanStatusCode, SpanKind, ROOT_CONTEXT } = api;
const isPromise = (p)=>{
return p !== null && typeof p === 'object' && typeof p.then == | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nextjs-tracer/input.js",
"language": "javascript",
"file_size": 8693,
"cut_index": 716,
"middle_length": 229
} |
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | ts the environment variables
*/
export function getEnv() {
var globalEnv = parseEnvironment(_globalThis);
return Object.assign({}, DEFAULT_ENVIRONMENT, globalEnv);
}
export function getEnvWithoutDefaults() {
return parseEnvironment(_globalThis | nse for the specific language governing permissions and
* limitations under the License.
*/
import { DEFAULT_ENVIRONMENT, parseEnvironment, } from '../../utils/environment';
import { _globalThis } from './globalThis';
/**
* Ge | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/otel-core/input.js",
"language": "javascript",
"file_size": 1002,
"cut_index": 512,
"middle_length": 229
} |
= getProperError(e);
return {
name: e.name,
message: e.message,
stack: typeof e.stack === "string" ? parseStackTrace(e.stack) : []
};
}
function createIpc(port) {
const socket = createConnection(port, "127.0.0.1");
const packetQueue = [];
const recvPromiseResolveQueue = [];
... | a", (chunk)=>{
buffer = Buffer.concat([
buffer,
chunk
]);
loop: while(true){
switch(state.type){
case "waiting":
{
| toString("utf8")));
} else {
packetQueue.push(packet);
}
}
let state = {
type: "waiting"
};
let buffer = Buffer.alloc(0);
socket.once("connect", ()=>{
socket.on("dat | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/ipc-index/input.js",
"language": "javascript",
"file_size": 5775,
"cut_index": 716,
"middle_length": 229
} |
mponentLoadStart = 0;
let clientComponentLoadTimes = 0;
let clientComponentLoadCount = 0;
export function wrapClientComponentLoader(ComponentMod) {
if (!('performance' in globalThis)) {
return ComponentMod.__next_app__;
}
return {
require: (...args)=>{
const startTime = performan... | const startTime = performance.now();
try {
clientComponentLoadCount += 1;
return ComponentMod.__next_app__.loadChunk(...args);
} finally{
clientComponentLoadTimes += performance. |
return ComponentMod.__next_app__.require(...args);
} finally{
clientComponentLoadTimes += performance.now() - startTime;
}
},
loadChunk: (...args)=>{
| {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/let-bug-1/input.js",
"language": "javascript",
"file_size": 1467,
"cut_index": 524,
"middle_length": 229
} |
/compose';
import { createUnaryUnit, getValue } from './spacing';
import { handleBreakpoints } from './breakpoints';
import responsivePropType from './responsivePropType';
export const gap = props => {
if (props.gap !== undefined && props.gap !== null) {
const transformer = createUnaryUnit(props.theme, 'spacing',... | l) {
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');
const styleFromPropValue = propValue => ({
columnGap: getValue(transformer, propValue)
});
return handleBreakpoints(props, props.columnGap, styleFromP | rn null;
};
gap.propTypes = process.env.NODE_ENV !== 'production' ? {
gap: responsivePropType
} : {};
gap.filterProps = ['gap'];
export const columnGap = props => {
if (props.columnGap !== undefined && props.columnGap !== nul | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/mui-sys/input.js",
"language": "javascript",
"file_size": 2510,
"cut_index": 563,
"middle_length": 229
} |
"TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_0ie4tr8._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_contex... | oject$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f$styled$2d$components$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"].button.withConfig({
displayName: "input__MyButton",
componentId: "sc-829 | d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/styled-components/index.js [test] (ecmascript)");
;
const MyButton = __TURBOPACK__imported__module__$5b$pr | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/output/turbopack_crates_turbopack-tests_tests_snapshot_0ie4tr8._.js",
"language": "javascript",
"file_size": 1392,
"cut_index": 524,
"middle_length": 229
} |
} from '../../server/future/route-modules/pages/module.compiled'
import { RouteKind } from '../../server/future/route-kind'
import { hoist } from './helpers'
// Import the app and document modules.
import Document from 'VAR_MODULE_DOCUMENT'
import App from 'VAR_MODULE_APP'
// Import the userland code.
import * as us... | bVitals = hoist(userland, 'reportWebVitals')
// Re-export legacy methods.
export const unstable_getStaticProps = hoist(
userland,
'unstable_getStaticProps'
)
export const unstable_getStaticPaths = hoist(
userland,
'unstable_getStaticPaths'
)
expor | land, 'getStaticProps')
export const getStaticPaths = hoist(userland, 'getStaticPaths')
export const getServerSideProps = hoist(userland, 'getServerSideProps')
export const config = hoist(userland, 'config')
export const reportWe | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/template-pages/input.js",
"language": "javascript",
"file_size": 1670,
"cut_index": 537,
"middle_length": 229
} |
uire function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if (installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports
/******/
}
/******/ // Create a new module (and put it into the cache)
/***... | false
/******/
} finally {
/******/ if (threw) delete installedModules[moduleId]
/******/
}
/******/
/******/ // Flag the module as loaded
/******/ module.l = true
/******/
/******/ // Return the exports of the | e module function
/******/ var threw = true
/******/ try {
/******/ modules[moduleId].call(
module.exports,
module,
module.exports,
__webpack_require__
)
/******/ threw = | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper-dirname-inject/input.js",
"language": "javascript",
"file_size": 6022,
"cut_index": 716,
"middle_length": 229
} |
GenericIpc } from './index'
import type { Channel as Ipc } from '../types'
type IpcIncomingMessage =
| {
type: 'evaluate'
args: string[]
}
| {
type: 'result'
id: number
error: string | null
data: any | null
}
type IpcOutgoingMessage =
| {
type: 'end'
data... | any
}>
) => {
let nextId = 1
const requests = new Map()
const internalIpc = {
sendInfo: (message: any) =>
ipc.send({
type: 'info',
data: message,
}),
sendRequest: (message: any) => {
const id = nextId++
| pc<IpcIncomingMessage, IpcOutgoingMessage>
const queue: string[][] = []
export const run = async (
moduleFactory: () => Promise<{
init?: () => Promise<void>
default: (ipc: Ipc<any, any>, ...deserializedArgs: any[]) => | {
"filepath": "turbopack/crates/turbopack-node/js/src/child_process/evaluate.ts",
"language": "typescript",
"file_size": 3023,
"cut_index": 563,
"middle_length": 229
} |
ages = {
"win32 arm64 LE": "esbuild-windows-arm64",
"win32 ia32 LE": "esbuild-windows-32",
"win32 x64 LE": "esbuild-windows-64",
};
var knownUnixlikePackages = {
"android arm64 LE": "esbuild-android-arm64",
"darwin arm64 LE": "esbuild-darwin-arm64",
"darwin x64 LE": "esbuild-darwin-64",
"freebsd arm64 LE"... | E": "esbuild-openbsd-64",
"sunos x64 LE": "esbuild-sunos-64",
};
function pkgAndSubpathForCurrentPlatform() {
let pkg;
let subpath;
let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
if (platformKey in knownWindowsPackages) | "linux mips64el LE": "esbuild-linux-mips64le",
"linux ppc64 LE": "esbuild-linux-ppc64le",
"linux s390x BE": "esbuild-linux-s390x",
"linux x64 LE": "esbuild-linux-64",
"netbsd x64 LE": "esbuild-netbsd-64",
"openbsd x64 L | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/esbuild/input.js",
"language": "javascript",
"file_size": 3719,
"cut_index": 614,
"middle_length": 229
} |
o from 'crypto'
import { urlAlphabet } from './url-alphabet/index.js'
const POOL_SIZE_MULTIPLIER = 128
let pool, poolOffset
let fillPool = bytes => {
if (!pool || pool.length < bytes) {
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
crypto.randomFillSync(pool)
poolOffset = 0
} else if (poolOffs... | id = ''
while (true) {
let bytes = getRandom(step)
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length === size) return id
}
}
}
}
let customAlphabet = (alphabet, size) => customR | bytes, poolOffset)
}
let customRandom = (alphabet, size, getRandom) => {
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
let step = Math.ceil((1.6 * mask * size) / alphabet.length)
return () => {
let | {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nanoid/input.js",
"language": "javascript",
"file_size": 1287,
"cut_index": 524,
"middle_length": 229
} |
lThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_cssmodules_composes_input_0-092p2._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css [test] (css module)", ((__turbopack_context__) => {
__turbopack_c... | s$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$cssmodules$2f$composes$2f$input$2f$index$2e$module$2e$css__$5b$test$5d$__$28$css__module$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/in | bopack-tests/tests/snapshot/cssmodules/composes/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crate | {
"filepath": "turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/output/1do3_crates_turbopack-tests_tests_snapshot_cssmodules_composes_input_0-092p2._.js",
"language": "javascript",
"file_size": 1158,
"cut_index": 518,
"middle_length": 229
} |
ntations.
*/
import type { Channel as Ipc } from '../types'
import { relative, isAbsolute, join, sep } from 'path'
import { type StructuredError } from '../error'
import { type StackFrame } from '../compiled/stacktrace-parser'
export type IpcInfoMessage =
| {
type: 'dependencies'
envVariables?: string[... | esolve'
options: any
lookupPath: string
request: string
}
| {
type: 'trackFileRead'
file: string
}
| {
type: 'importModule'
lookupPath: string
request: string
}
export type TransformIpc = Ipc | StructuredError
}
| {
type: 'log'
logs: Array<{
time: number
logType: string
args: any[]
trace?: StackFrame[]
}>
}
export type IpcRequestMessage =
| {
type: 'r | {
"filepath": "turbopack/crates/turbopack-node/js/src/transforms/transforms.ts",
"language": "typescript",
"file_size": 2234,
"cut_index": 563,
"middle_length": 229
} |
that implements the turbopack-node pool wire protocol.
// Used by pool.rs integration tests.
//
// Wire protocol:
// - Messages are framed as [u32 BE length][payload bytes]
// - The ready signal is a 0-length message
// - After each TCP send, write "TURBOPACK_OUTPUT_D\n" to both stdout and stderr
// to signa... | ket closes, exit cleanly.
socket.once('close', () => {
process.exit(0)
})
function signalOutputDone() {
process.stdout.write('TURBOPACK_OUTPUT_D\n')
process.stderr.write('TURBOPACK_OUTPUT_D\n')
}
function sendMessage(obj) {
const json = JSON.stri | '127.0.0.1' }, () => {
socket.setNoDelay(true)
// Send empty ready signal (0-length message).
const readyBuf = Buffer.alloc(4)
readyBuf.writeUInt32BE(0, 0)
socket.write(readyBuf)
signalOutputDone()
})
// When the soc | {
"filepath": "turbopack/crates/turbopack-node/tests/pool_test_worker.js",
"language": "javascript",
"file_size": 1968,
"cut_index": 537,
"middle_length": 229
} |
/***/ 912: /***/ function () {
/*!
* fullpage.js Fading Effect Extension 0.1.2 for fullPage.js v3
* https://github.com/alvarotrigo/fullPage.js
*
* @license This code has been bought from www.alvarotrigo.com/fullPage/extensions/ and it is not free to use or distribute.
* Copyrigh... | ed,
u = '.fullpage-wrapper',
p = '.active',
m = '.fp-section',
v = m + p,
g = '.fp-slide',
w = '.fp-slidesContainer',
E = g + p,
h = 'fp-fading-animations',
y = '#' + | l,
e = this,
r = window.fp_utils,
s = window.fullpage_api,
c = r.$,
t = s.getFullpageData(),
f = t.options,
d = t.internals,
i = f.scrollingSpe | {
"filepath": "turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/webpack-wrapper-name/mangled.js",
"language": "javascript",
"file_size": 4701,
"cut_index": 614,
"middle_length": 229
} |
st queue = [];
export const run = async (moduleFactory)=>{
let nextId = 1;
const requests = new Map();
const internalIpc = {
sendInfo: (message)=>ipc.send({
type: "info",
data: message
}),
sendRequest: (message)=>{
const id = nextId++;
... | sendError: (error)=>{
return ipc.sendError(error);
}
};
let getValue;
try {
const module = await moduleFactory();
if (typeof module.init === "function") {
await module.init();
}
| {
resolve,
reject
});
return ipc.send({
type: "request",
id,
data: message
}).then(()=>promise);
},
| {
"filepath": "turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/ipc-evaluate/input.js",
"language": "javascript",
"file_size": 2755,
"cut_index": 563,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.