CodeSampleX

Beispiel

@babel/helper-globals 7.29.7

Verifiziertes Beispiel für npm @babel/helper-globals 7.29.7. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand.

sha256:86bf4a0e1869ed81745f61fd778606e99c86c5b20e995281af611dbaed547078

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
1
Deklarierte Umgebung linux 24 · ubuntu · glibc 2.39 x64 npm

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5…
2026-08-23
node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-09-12

Fall

HOW
Ziel
verify pkg:npm/%40babel/helper-globals@7.29.7
Pakete
Erstellt
2026-08-23T06:28:14Z

Contract

  1. builtin-lower data contains standard lowercase ECMAScript global identifiers including eval, parseInt, and globalThis
  2. builtin-upper data contains standard uppercase ECMAScript built-in constructors and objects including Object, Array, Promise, and Map
  3. browser-upper data contains browser window and web API identifiers including AbortController, WebSocket, and Document
  4. isBuiltinGlobal identifies ECMAScript built-in global identifiers and rejects unknown or custom names
  5. isBrowserGlobal identifies standard browser environment globals and rejects non-browser names
  6. isJavaScriptGlobal checks across all built-in and browser global lists

Dateien

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • src/index.mjs
  • test/contract.mjs

Quellartefakt herunterladen (tar.gz)

Quelltext

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify pkg:npm/%40babel/helper-globals@7.29.7
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40babel/helper-globals@7.29.7

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:b04bbc89d5c5371673ee15108563e7411200e8e3588151e69500503dfcffcbf8","contract":["builtin-lower data contains standard lowercase ECMAScript global identifiers including eval, parseInt, and globalThis","builtin-upper data contains standard uppercase ECMAScript built-in constructors and objects including Object, Array, Promise, and Map","browser-upper data contains browser window and web API identifiers including AbortController, WebSocket, and Document","isBuiltinGlobal identifies ECMAScript built-in global identifiers and rejects unknown or custom names","isBrowserGlobal identifies standard browser environment globals and rejects non-browser names","isJavaScriptGlobal checks across all built-in and browser global lists"],"goal":"verify pkg:npm/%40babel/helper-globals@7.29.7","kind":"HOW","packages":["pkg:npm/%40babel/helper-globals@7.29.7"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40babel/helper-globals@7.29.7"],"schemaVersion":1,"subject":"pkg:npm/%40babel/helper-globals@7.29.7","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-babel-helper-globals",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-babel-helper-globals",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@babel/helper-globals": "7.29.7"
      }
    },
    "node_modules/@babel/helper-globals": {
      "version": "7.29.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
      "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
      "license": "MIT",
      "engines": {
        "node": ">=6.9.0"
      }
    }
  }
}
package.json
{
  "name": "sample-babel-helper-globals",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "license": "MIT-0",
  "dependencies": {
    "@babel/helper-globals": "7.29.7"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40babel/helper-globals@7.29.7",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40babel/helper-globals@7.29.7"
  ]
}
src/index.mjs
import { createRequire } from "node:module";

const require = createRequire(import.meta.url);

const builtinLower = require("@babel/helper-globals/data/builtin-lower.json");
const builtinUpper = require("@babel/helper-globals/data/builtin-upper.json");
const browserUpper = require("@babel/helper-globals/data/browser-upper.json");

const builtinLowerSet = new Set(builtinLower);
const builtinUpperSet = new Set(builtinUpper);
const browserUpperSet = new Set(browserUpper);

export function getBuiltinLowerGlobals() {
  return [...builtinLower];
}

export function getBuiltinUpperGlobals() {
  return [...builtinUpper];
}

export function getBrowserUpperGlobals() {
  return [...browserUpper];
}

export function isBuiltinGlobal(name) {
  return builtinLowerSet.has(name) || builtinUpperSet.has(name);
}

export function isBrowserGlobal(name) {
  return browserUpperSet.has(name);
}

export function isJavaScriptGlobal(name) {
  return builtinLowerSet.has(name) || builtinUpperSet.has(name) || browserUpperSet.has(name);
}
test/contract.mjs
import assert from "node:assert/strict";
import { createRequire } from "node:module";
import {
  getBuiltinLowerGlobals,
  getBuiltinUpperGlobals,
  getBrowserUpperGlobals,
  isBuiltinGlobal,
  isBrowserGlobal,
  isJavaScriptGlobal
} from "../src/index.mjs";

const require = createRequire(import.meta.url);

// Test 1: builtin-lower data contains standard lowercase ECMAScript global identifiers including eval, parseInt, and globalThis
{
  const lowerGlobals = getBuiltinLowerGlobals();
  assert.ok(Array.isArray(lowerGlobals), "builtin-lower should export an array");
  assert.ok(lowerGlobals.length > 0, "builtin-lower should not be empty");

  const expectedLower = [
    "eval",
    "parseInt",
    "parseFloat",
    "decodeURI",
    "decodeURIComponent",
    "encodeURI",
    "encodeURIComponent",
    "globalThis",
    "isFinite",
    "isNaN",
    "undefined"
  ];
  for (const name of expectedLower) {
    assert.ok(lowerGlobals.includes(name), `builtin-lower should include ${name}`);
  }

  const direct = require("@babel/helper-globals/data/builtin-lower.json");
  assert.deepEqual(lowerGlobals, direct, "Exported array should match direct JSON data");
}

// Test 2: builtin-upper data contains standard uppercase ECMAScript built-in constructors and objects including Object, Array, Promise, and Map
{
  const upperGlobals = getBuiltinUpperGlobals();
  assert.ok(Array.isArray(upperGlobals), "builtin-upper should export an array");
  assert.ok(upperGlobals.length >= 40, "builtin-upper should contain standard uppercase globals");

  const expectedUpper = [
    "Object",
    "Array",
    "String",
    "Number",
    "Boolean",
    "Symbol",
    "Promise",
    "Map",
    "Set",
    "WeakMap",
    "WeakSet",
    "JSON",
    "Math",
    "Reflect",
    "Proxy",
    "Error",
    "SyntaxError",
    "TypeError"
  ];
  for (const name of expectedUpper) {
    assert.ok(upperGlobals.includes(name), `builtin-upper should include ${name}`);
  }

  const direct = require("@babel/helper-globals/data/builtin-upper.json");
  assert.deepEqual(upperGlobals, direct, "Exported array should match direct JSON data");
}

// Test 3: browser-upper data contains browser window and web API identifiers including AbortController, WebSocket, and Document
{
  const browserGlobals = getBrowserUpperGlobals();
  assert.ok(Array.isArray(browserGlobals), "browser-upper should export an array");
  assert.ok(browserGlobals.length > 500, "browser-upper should contain comprehensive browser globals");

  const expectedBrowser = [
    "AbortController",
    "AbortSignal",
    "Blob",
    "Document",
    "Element",
    "Event",
    "FormData",
    "Headers",
    "Request",
    "Response",
    "URL",
    "WebSocket",
    "Window",
    "Worker"
  ];
  for (const name of expectedBrowser) {
    assert.ok(browserGlobals.includes(name), `browser-upper should include ${name}`);
  }

  const direct = require("@babel/helper-globals/data/browser-upper.json");
  assert.deepEqual(browserGlobals, direct, "Exported array should match direct JSON data");
}

// Test 4: isBuiltinGlobal identifies ECMAScript built-in global identifiers and rejects unknown or custom names
{
  assert.equal(isBuiltinGlobal("parseInt"), true, "parseInt is a builtin lowercase global");
  assert.equal(isBuiltinGlobal("Promise"), true, "Promise is a builtin uppercase global");
  assert.equal(isBuiltinGlobal("Math"), true, "Math is a builtin uppercase global");
  assert.equal(isBuiltinGlobal("myCustomVariable"), false, "myCustomVariable is not a builtin global");
  assert.equal(isBuiltinGlobal("nonExistentGlobal"), false, "nonExistentGlobal is not a builtin global");
}

// Test 5: isBrowserGlobal identifies standard browser environment globals and rejects non-browser names
{
  assert.equal(isBrowserGlobal("AbortController"), true, "AbortController is a browser global");
  assert.equal(isBrowserGlobal("WebSocket"), true, "WebSocket is a browser global");
  assert.equal(isBrowserGlobal("FormData"), true, "FormData is a browser global");
  assert.equal(isBrowserGlobal("customNonBrowserName"), false, "custom name is not a browser global");
}

// Test 6: isJavaScriptGlobal checks across all built-in and browser global lists
{
  assert.equal(isJavaScriptGlobal("eval"), true, "eval should be detected as JavaScript global");
  assert.equal(isJavaScriptGlobal("Array"), true, "Array should be detected as JavaScript global");
  assert.equal(isJavaScriptGlobal("WebSocket"), true, "WebSocket should be detected as JavaScript global");
  assert.equal(isJavaScriptGlobal("unknownIdentifier123"), false, "unknown identifier should return false");
}

console.log("All @babel/helper-globals contract tests passed successfully.");

Ursprungs-Seeder

anonym