샘플
micromatch 4.0.8: some
검증된 샘플 — npm micromatch 4.0.8: some. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: micromatch.some is exported as a function on the micromatch…
sha256:6044d202acd6d3dc52439e2dfedbef3e68e04b919ba55ade84f2b1766e8beb4f
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-28 |
케이스
HOW- 목표
- verify micromatch.some in pkg:npm/micromatch@4.0.8
- 패키지
- 심벌
-
- micromatch.some
- 생성일
- 2026-08-28T02:54:41Z
컨트랙트
- micromatch.some is exported as a function on the micromatch module
- micromatch.some returns true if a single string matches any pattern in an array
- micromatch.some returns true if any string in an array matches any pattern in an array
- micromatch.some returns false if no string matches any pattern
- micromatch.some supports single string pattern and custom options like nocase and dot
- micromatch.some throws TypeError when input is not a string or array of strings
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.mjs
소스
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 micromatch.some in pkg:npm/micromatch@4.0.8
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/micromatch@4.0.8
Demonstrate these symbols/APIs:
- micromatch.some
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:fb2a389bc03abde8404f9c77049c63d57e977b8ecccc9b494ad8b9fa8a106577","contract":["micromatch.some is exported as a function on the micromatch module","micromatch.some returns true if a single string matches any pattern in an array","micromatch.some returns true if any string in an array matches any pattern in an array","micromatch.some returns false if no string matches any pattern","micromatch.some supports single string pattern and custom options like nocase and dot","micromatch.some throws TypeError when input is not a string or array of strings"],"goal":"verify micromatch.some in pkg:npm/micromatch@4.0.8","kind":"HOW","packages":["pkg:npm/micromatch@4.0.8"],"schemaVersion":1,"symbols":["micromatch.some"]},"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/micromatch@4.0.8"],"schemaVersion":1,"subject":"pkg:npm/micromatch@4.0.8","symbols":["micromatch.some"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-micromatch-some",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-micromatch-some",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"micromatch": "4.0.8"
}
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"license": "MIT",
"dependencies": {
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"license": "MIT",
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"license": "MIT",
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"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"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
}
}
}
{
"name": "sample-micromatch-some",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of micromatch.some in micromatch@4.0.8",
"main": "src/index.js",
"license": "MIT-0",
"dependencies": {
"micromatch": "4.0.8"
}
}
{
"schemaVersion": 1,
"goal": "verify micromatch.some in pkg:npm/micromatch@4.0.8",
"kind": "HOW",
"packages": [
"pkg:npm/micromatch@4.0.8"
],
"symbols": [
"micromatch.some"
]
}
const micromatch = require('micromatch');
/**
* Check if any string in a list (or a single string) matches any of the glob patterns.
*
* @param {string|string[]} list - String or array of strings to test
* @param {string|string[]} patterns - Glob pattern or array of glob patterns
* @param {object} [options] - Micromatch options (e.g. nocase, dot)
* @returns {boolean} True if any string matches any pattern
*/
function someMatch(list, patterns, options) {
return micromatch.some(list, patterns, options);
}
/**
* Check if at least one file in a given list matches the target file extensions or patterns.
*
* @param {string[]} filepaths - List of file paths
* @param {string|string[]} patterns - Target patterns to check
* @param {object} [options] - Options passed to micromatch
* @returns {boolean} True if at least one file matches
*/
function hasMatchingFile(filepaths, patterns, options) {
if (!Array.isArray(filepaths) || filepaths.length === 0) {
return false;
}
return micromatch.some(filepaths, patterns, options);
}
module.exports = {
micromatch,
some: micromatch.some,
someMatch,
hasMatchingFile
};
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const {
micromatch,
some,
someMatch,
hasMatchingFile
} = require('../src/index.js');
// 1. Module and function export verification
assert.equal(typeof micromatch, 'function', 'micromatch must be a function');
assert.equal(typeof micromatch.some, 'function', 'micromatch.some must be a function');
assert.equal(typeof some, 'function', 'some must be a function');
assert.equal(typeof someMatch, 'function', 'someMatch must be a function');
assert.equal(typeof hasMatchingFile, 'function', 'hasMatchingFile must be a function');
assert.equal(some, micromatch.some, 'some should reference micromatch.some');
// 2. Returns true if a single string matches any pattern in an array
assert.equal(
micromatch.some('src/components/Button.tsx', ['**/*.js', '**/*.tsx']),
true,
'micromatch.some should return true when a string matches one of the patterns'
);
assert.equal(
someMatch('dist/bundle.min.js', ['**/*.min.js', '**/*.css']),
true,
'someMatch should return true when single string matches'
);
// 3. Returns true if any string in an array matches any pattern
assert.equal(
micromatch.some(['README.md', 'src/index.js', 'package.json'], ['*.js', '**/*.js']),
true,
'micromatch.some should return true if any element matches'
);
assert.equal(
hasMatchingFile(['images/logo.png', 'docs/guide.md', 'styles/main.css'], ['**/*.css']),
true,
'hasMatchingFile should return true when matching file is in list'
);
// 4. Returns false if no string matches any pattern
assert.equal(
micromatch.some('src/index.ts', ['**/*.js', '**/*.css']),
false,
'micromatch.some should return false when no pattern matches single string'
);
assert.equal(
micromatch.some(['docs/a.md', 'docs/b.md'], ['src/**', '**/*.js']),
false,
'micromatch.some should return false when no element matches pattern'
);
assert.equal(
hasMatchingFile([], ['*.js']),
false,
'hasMatchingFile should return false for empty list'
);
assert.equal(
micromatch.some([], ['*.js']),
false,
'micromatch.some should return false for empty array input'
);
// 5. Supports single string pattern and options (nocase, dot)
assert.equal(
micromatch.some('app.js', '*.js'),
true,
'micromatch.some should accept single string pattern'
);
assert.equal(
micromatch.some(['IMAGE.PNG', 'style.css'], '*.png', { nocase: true }),
true,
'micromatch.some should respect nocase option'
);
assert.equal(
micromatch.some(['.gitignore', '.env'], '.*', { dot: true }),
true,
'micromatch.some should respect dot option for hidden files'
);
assert.equal(
micromatch.some('.hidden', '*', { dot: false }),
false,
'micromatch.some should not match dotfiles when dot is false'
);
// 6. Throws TypeError when input is not a string or array of strings
assert.throws(
() => micromatch.some(123, ['*.js']),
{
name: 'TypeError',
message: /Expected input to be a string/
},
'micromatch.some should throw TypeError when input is a number'
);
assert.throws(
() => micromatch.some(null, ['*.js']),
{
name: 'TypeError',
message: /Expected input to be a string/
},
'micromatch.some should throw TypeError when input is null'
);
assert.throws(
() => micromatch.some({}, ['*.js']),
{
name: 'TypeError',
message: /Expected input to be a string/
},
'micromatch.some should throw TypeError when input is an object'
);
console.log('Contract tests passed successfully.');
오리진 시더
익명