샘플
picomatch 2.3.2
검증된 샘플 — npm picomatch 2.3.2. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: picomatch creates compiled matcher functions supporting wildcards…
sha256:25d40cbbc2f3e20cbc753bb393104c57f0b7f2178c74ab89c044c78fb20d7aed
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-19 |
케이스
HOW- 목표
- verify pkg:npm/picomatch@2.3.2
- 패키지
- 환경
- node 22.23.2
- 생성일
- 2026-08-19T19:02:46Z
컨트랙트
- picomatch creates compiled matcher functions supporting wildcards, brace expansions, and negated patterns
- picomatch.isMatch evaluates paths against glob patterns with support for case-insensitivity, dotfiles, and ignore rules
- picomatch.scan parses glob patterns into components including static base directory, glob portion, and isGlob metadata
- picomatch.makeRe compiles glob patterns into RegExp instances for regular expression matching
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
소스
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/picomatch@2.3.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/picomatch@2.3.2
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:4c8d305f92c97cfc254d87f30ab3ec866843a00e18d6b707d97faac9407398f1","constraints":{"executionContext":"node"},"contract":["picomatch creates compiled matcher functions supporting wildcards, brace expansions, and negated patterns","picomatch.isMatch evaluates paths against glob patterns with support for case-insensitivity, dotfiles, and ignore rules","picomatch.scan parses glob patterns into components including static base directory, glob portion, and isGlob metadata","picomatch.makeRe compiles glob patterns into RegExp instances for regular expression matching"],"goal":"verify pkg:npm/picomatch@2.3.2","kind":"HOW","packages":["pkg:npm/picomatch@2.3.2"],"schemaVersion":1},"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/picomatch@2.3.2"],"schemaVersion":1,"verifierAdapter":"node-typescript@1"}
{
"name": "picomatch-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "picomatch-sample",
"version": "1.0.0",
"dependencies": {
"picomatch": "2.3.2"
}
},
"node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
}
}
}
{
"name": "picomatch-sample",
"version": "1.0.0",
"dependencies": {
"picomatch": "2.3.2"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/picomatch@2.3.2",
"kind": "HOW",
"packages": [
"pkg:npm/picomatch@2.3.2"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
const picomatch = require('picomatch');
/**
* Creates a compiled matcher function for one or more glob patterns.
*
* @param {string|string[]} patterns - Glob pattern or array of patterns.
* @param {object} [options] - Picomatch options.
* @returns {(input: string) => boolean} Matcher function.
*/
function createMatcher(patterns, options) {
return picomatch(patterns, options);
}
/**
* Tests whether a path string matches a glob pattern.
*
* @param {string} input - Path string to test.
* @param {string|string[]} patterns - Glob pattern or patterns.
* @param {object} [options] - Options such as ignore, nocase, dot.
* @returns {boolean} True if matched.
*/
function matchPath(input, patterns, options) {
return picomatch.isMatch(input, patterns, options);
}
/**
* Scans a glob pattern string to extract static base path, glob component, and metadata.
*
* @param {string} pattern - Glob pattern to analyze.
* @param {object} [options] - Scan options.
* @returns {object} Scan result object.
*/
function scanPattern(pattern, options) {
return picomatch.scan(pattern, options);
}
/**
* Compiles a glob pattern into a regular expression.
*
* @param {string} pattern - Glob pattern.
* @param {object} [options] - Regex options.
* @returns {RegExp} Compiled RegExp.
*/
function compilePattern(pattern, options) {
return picomatch.makeRe(pattern, options);
}
module.exports = {
createMatcher,
matchPath,
scanPattern,
compilePattern,
picomatch,
};
const assert = require('node:assert/strict');
const {
createMatcher,
matchPath,
scanPattern,
compilePattern,
} = require('../src/index.js');
// Contract 1: picomatch creates compiled matcher functions supporting wildcards, brace expansions, and negated patterns
{
const isImage = createMatcher('*.{png,jpg,webp}');
assert.strictEqual(isImage('photo.jpg'), true, 'Should match jpg via brace expansion');
assert.strictEqual(isImage('banner.webp'), true, 'Should match webp via brace expansion');
assert.strictEqual(isImage('vector.svg'), false, 'Should not match non-listed extension');
const isSource = createMatcher(['src/**/*.js', 'src/**/*.ts']);
assert.strictEqual(isSource('src/index.js'), true, 'Should match js file in src');
assert.strictEqual(isSource('src/components/App.ts'), true, 'Should match ts file in nested src');
assert.strictEqual(isSource('docs/readme.md'), false, 'Should not match md file outside src');
const notTest = createMatcher('!**/*.test.js');
assert.strictEqual(notTest('src/index.js'), true, 'Negated pattern matches non-test file');
assert.strictEqual(notTest('src/index.test.js'), false, 'Negated pattern rejects test file');
}
// Contract 2: picomatch.isMatch evaluates paths against glob patterns with support for case-insensitivity, dotfiles, and ignore rules
{
assert.strictEqual(matchPath('lib/utils.js', 'lib/*.js'), true, 'Direct match in lib directory');
assert.strictEqual(matchPath('lib/sub/utils.js', 'lib/*.js'), false, 'Single star should not cross directory boundaries');
assert.strictEqual(matchPath('README.MD', '*.md', { nocase: true }), true, 'nocase: true allows case-insensitive match');
assert.strictEqual(matchPath('README.MD', '*.md', { nocase: false }), false, 'nocase: false enforces case sensitivity');
assert.strictEqual(matchPath('.env', '*.env', { dot: true }), true, 'dot: true matches dotfiles');
assert.strictEqual(matchPath('.env', '*.env', { dot: false }), false, 'dot: false ignores dotfiles by default');
assert.strictEqual(
matchPath('node_modules/pkg/index.js', '**/*.js', { ignore: '**/node_modules/**' }),
false,
'ignore option excludes matching paths'
);
}
// Contract 3: picomatch.scan parses glob patterns into components including static base directory, glob portion, and isGlob metadata
{
const scanned = scanPattern('src/assets/**/*.svg');
assert.strictEqual(scanned.base, 'src/assets', 'Base directory before any glob characters');
assert.strictEqual(scanned.glob, '**/*.svg', 'Glob portion extracted');
assert.strictEqual(scanned.isGlob, true, 'isGlob should be true for wildcard pattern');
const staticScan = scanPattern('src/config/settings.json');
assert.strictEqual(staticScan.base, 'src/config/settings.json', 'Static path base equals full input');
assert.strictEqual(staticScan.glob, '', 'Static path has empty glob portion');
assert.strictEqual(staticScan.isGlob, false, 'isGlob should be false for static path');
}
// Contract 4: picomatch.makeRe compiles glob patterns into RegExp instances for regular expression matching
{
const re = compilePattern('build/*.min.js');
assert.ok(re instanceof RegExp, 'Should return a RegExp instance');
assert.strictEqual(re.test('build/app.min.js'), true, 'Compiled regex matches expected target');
assert.strictEqual(re.test('build/app.js'), false, 'Compiled regex rejects unmatched target');
assert.strictEqual(re.test('dist/app.min.js'), false, 'Compiled regex respects directory prefix');
}
console.log('All pkg:npm/picomatch@2.3.2 contracts passed successfully.');
오리진 시더
익명