Sample
is-extglob 2.1.1: is-extglob
Verified sample for npm is-extglob 2.1.1: is-extglob. The contract ran on node 22 · linux debian/x64 · docker and passed: isExtglob returns true for extended…
sha256:ed00d6a2c6ade8cfe8a0cb8975ed27144e0e186dd60b588bd160211c56d36b28
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| 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-01 |
Case
HOW- Goal
- verify is-extglob in pkg:npm/is-extglob@2.1.1
- Packages
- Symbols
-
- is-extglob
- Environment
- node 22.23.2
- Created
- 2026-09-01T11:48:43Z
Contract
- isExtglob returns true for extended glob patterns containing @, !, ?, *, and + prefix operators
- isExtglob returns false for regular file paths and non-extglob standard glob patterns
- isExtglob returns false for escaped extglob patterns where the operator is preceded by a backslash
- isExtglob returns false when provided non-string values or empty strings
- filterExtglobs filters an array of pattern strings and returns only those matching extglob syntax
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
Source
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 is-extglob in pkg:npm/is-extglob@2.1.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/is-extglob@2.1.1
Demonstrate these symbols/APIs:
- is-extglob
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.
{"case":{"caseId":"case:sha256:5073e892e53e57b8347023f178d2ad5b17e7a7c0263865be199a26afc87d127f","contract":["isExtglob returns true for extended glob patterns containing @, !, ?, *, and + prefix operators","isExtglob returns false for regular file paths and non-extglob standard glob patterns","isExtglob returns false for escaped extglob patterns where the operator is preceded by a backslash","isExtglob returns false when provided non-string values or empty strings","filterExtglobs filters an array of pattern strings and returns only those matching extglob syntax"],"goal":"verify is-extglob in pkg:npm/is-extglob@2.1.1","kind":"HOW","packages":["pkg:npm/is-extglob@2.1.1"],"schemaVersion":1,"symbols":["is-extglob"]},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/is-extglob@2.1.1"],"schemaVersion":1,"subject":"pkg:npm/is-extglob@2.1.1","symbols":["is-extglob"],"verifierAdapter":"node-typescript@1"}
{
"name": "is-extglob-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "is-extglob-sample",
"version": "1.0.0",
"dependencies": {
"is-extglob": "2.1.1"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
}
}
}
{
"name": "is-extglob-sample",
"version": "1.0.0",
"dependencies": {
"is-extglob": "2.1.1"
}
}
{
"schemaVersion": 1,
"goal": "verify is-extglob in pkg:npm/is-extglob@2.1.1",
"kind": "HOW",
"packages": [
"pkg:npm/is-extglob@2.1.1"
],
"symbols": [
"is-extglob"
]
}
const isExtglob = require('is-extglob');
/**
* Checks whether a given string contains an extended glob pattern.
*
* @param {any} pattern - The pattern or value to test.
* @returns {boolean} True if the pattern contains an extglob, false otherwise.
*/
function checkIsExtglob(pattern) {
return isExtglob(pattern);
}
/**
* Filters a list of pattern strings, returning only those that contain extglobs.
*
* @param {string[]} patterns - Array of pattern strings.
* @returns {string[]} Filtered array of extglob patterns.
*/
function filterExtglobs(patterns) {
if (!Array.isArray(patterns)) {
return [];
}
return patterns.filter((p) => isExtglob(p));
}
module.exports = {
isExtglob,
checkIsExtglob,
filterExtglobs,
};
const assert = require('node:assert/strict');
const { isExtglob, checkIsExtglob, filterExtglobs } = require('../src/index.js');
function testExtglobPatterns() {
// @(pattern) - matches one of the given patterns
assert.strictEqual(isExtglob('@(a|b)'), true);
assert.strictEqual(isExtglob('src/@(foo|bar).js'), true);
assert.strictEqual(checkIsExtglob('@(a|b)'), true);
// !(pattern) - matches anything except one of the given patterns
assert.strictEqual(isExtglob('!(a|b)'), true);
assert.strictEqual(isExtglob('src/!(foo|bar).js'), true);
assert.strictEqual(checkIsExtglob('!(a|b)'), true);
// ?(pattern) - matches zero or one occurrence of the given patterns
assert.strictEqual(isExtglob('?(a|b)'), true);
assert.strictEqual(isExtglob('src/?(foo|bar).js'), true);
assert.strictEqual(checkIsExtglob('?(a|b)'), true);
// *(pattern) - matches zero or more occurrences of the given patterns
assert.strictEqual(isExtglob('*(a|b)'), true);
assert.strictEqual(isExtglob('src/*(foo|bar).js'), true);
assert.strictEqual(checkIsExtglob('*(a|b)'), true);
// +(pattern) - matches one or more occurrences of the given patterns
assert.strictEqual(isExtglob('+(a|b)'), true);
assert.strictEqual(isExtglob('src/+(foo|bar).js'), true);
assert.strictEqual(checkIsExtglob('+(a|b)'), true);
}
function testNonExtglobPatterns() {
// Plain paths and file names
assert.strictEqual(isExtglob('foo.js'), false);
assert.strictEqual(isExtglob('src/components/button.tsx'), false);
assert.strictEqual(checkIsExtglob('foo.js'), false);
// Standard globs (not extglobs)
assert.strictEqual(isExtglob('*.js'), false);
assert.strictEqual(isExtglob('**/*.js'), false);
assert.strictEqual(isExtglob('foo-?.js'), false);
assert.strictEqual(isExtglob('[a-z].js'), false);
assert.strictEqual(isExtglob('{a,b}.js'), false);
}
function testEscapedExtglobs() {
// Escaped extglob prefix should not be treated as extglob
assert.strictEqual(isExtglob('\\@(a|b)'), false);
assert.strictEqual(isExtglob('\\!(a|b)'), false);
assert.strictEqual(isExtglob('\\?(a|b)'), false);
assert.strictEqual(isExtglob('\\*(a|b)'), false);
assert.strictEqual(isExtglob('\\+(a|b)'), false);
}
function testInvalidAndNonStringTypes() {
// Empty string
assert.strictEqual(isExtglob(''), false);
// Non-string types
assert.strictEqual(isExtglob(null), false);
assert.strictEqual(isExtglob(undefined), false);
assert.strictEqual(isExtglob(123), false);
assert.strictEqual(isExtglob(true), false);
assert.strictEqual(isExtglob(false), false);
assert.strictEqual(isExtglob({}), false);
assert.strictEqual(isExtglob([]), false);
assert.strictEqual(isExtglob(Symbol('glob')), false);
}
function testFilterExtglobs() {
const list = ['foo.js', '@(a|b)', '*.js', '!(x|y)', 'bar/baz.ts'];
const filtered = filterExtglobs(list);
assert.deepStrictEqual(filtered, ['@(a|b)', '!(x|y)']);
assert.deepStrictEqual(filterExtglobs(null), []);
assert.deepStrictEqual(filterExtglobs(undefined), []);
}
function main() {
testExtglobPatterns();
testNonExtglobPatterns();
testEscapedExtglobs();
testInvalidAndNonStringTypes();
testFilterExtglobs();
console.log('All pkg:npm/is-extglob@2.1.1 contracts passed successfully.');
}
main();
Origin Seeder
anonymous