샘플
unicode-property-aliases-ecmascript 2.2.0: convert Unicode property aliases to canonical names in ECMAScript RegExp
검증된 샘플 — npm unicode-property-aliases-ecmascript 2.2.0: convert Unicode property aliases to canonical names in ECMAScript RegExp. node 22 · linux alpine/x64…
sha256:bb9762de2c2f10d0f4f250db33917b91709aa9eb1f23932532896ef12ff99c04
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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-27 |
케이스
HOW- 목표
- convert Unicode property aliases to canonical names in ECMAScript RegExp
- 심벌
-
- propertyAliases.get
- 생성일
- 2026-08-27T12:36:56Z
컨트랙트
- propertyAliases is an instance of Map exported by unicode-property-aliases-ecmascript
- propertyAliases.get maps property alias scx to canonical name Script_Extensions
- propertyAliases.get maps property alias gc to canonical name General_Category
- propertyAliases.get maps property aliases WSpace and space to canonical name White_Space
- propertyAliases.get returns undefined for unmapped or non-existent property aliases
- propertyAliases.has accurately reports existence of property aliases
- propertyAliases contains exactly 54 property alias entries
파일
- 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: convert Unicode property aliases to canonical names in ECMAScript RegExp
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/unicode-property-aliases-ecmascript@2.2.0
Demonstrate these symbols/APIs:
- propertyAliases.get
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:5f3068ce6f9340e42d701b576b47b061bc4351a306615a28de1f394ee1c4f7cb","contract":["propertyAliases is an instance of Map exported by unicode-property-aliases-ecmascript","propertyAliases.get maps property alias scx to canonical name Script_Extensions","propertyAliases.get maps property alias gc to canonical name General_Category","propertyAliases.get maps property aliases WSpace and space to canonical name White_Space","propertyAliases.get returns undefined for unmapped or non-existent property aliases","propertyAliases.has accurately reports existence of property aliases","propertyAliases contains exactly 54 property alias entries"],"goal":"convert Unicode property aliases to canonical names in ECMAScript RegExp","kind":"HOW","packages":["pkg:npm/unicode-property-aliases-ecmascript@2.2.0"],"schemaVersion":1,"symbols":["propertyAliases.get"]},"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/unicode-property-aliases-ecmascript@2.2.0"],"schemaVersion":1,"subject":"pkg:npm/unicode-property-aliases-ecmascript@2.2.0","symbols":["propertyAliases.get"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-unicode-property-aliases-ecmascript",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-unicode-property-aliases-ecmascript",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"unicode-property-aliases-ecmascript": "2.2.0"
}
},
"node_modules/unicode-property-aliases-ecmascript": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz",
"integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==",
"license": "MIT",
"engines": {
"node": ">=4"
}
}
}
}
{
"name": "sample-unicode-property-aliases-ecmascript",
"version": "1.0.0",
"private": true,
"description": "Clean-room code sample for propertyAliases.get in unicode-property-aliases-ecmascript@2.2.0",
"main": "src/index.js",
"license": "MIT-0",
"dependencies": {
"unicode-property-aliases-ecmascript": "2.2.0"
}
}
{
"schemaVersion": 1,
"goal": "convert Unicode property aliases to canonical names in ECMAScript RegExp",
"kind": "HOW",
"packages": [
"pkg:npm/unicode-property-aliases-ecmascript@2.2.0"
],
"symbols": [
"propertyAliases.get"
]
}
const propertyAliases = require('unicode-property-aliases-ecmascript');
/**
* Look up the canonical Unicode property name for a given alias.
*
* @param {string} alias - Short Unicode property alias (e.g. 'scx', 'gc', 'Alpha').
* @returns {string|undefined} Canonical Unicode property name or undefined if not recognized.
*/
function getCanonicalPropertyName(alias) {
return propertyAliases.get(alias);
}
/**
* Check whether a given property alias exists in the ECMAScript Unicode property aliases map.
*
* @param {string} alias - Short Unicode property alias.
* @returns {boolean} True if the alias exists in the mapping.
*/
function hasPropertyAlias(alias) {
return propertyAliases.has(alias);
}
/**
* Resolve a property name or alias to its canonical name.
* If the input is already in the aliases map, its canonical name is returned;
* otherwise undefined is returned.
*
* @param {string} alias - Property alias to resolve.
* @returns {string|undefined} Canonical name or undefined.
*/
function resolvePropertyAlias(alias) {
return propertyAliases.get(alias);
}
/**
* Returns the total count of supported property aliases.
*
* @returns {number} The size of the property aliases Map.
*/
function getSupportedAliasCount() {
return propertyAliases.size;
}
module.exports = {
propertyAliases,
getCanonicalPropertyName,
hasPropertyAlias,
resolvePropertyAlias,
getSupportedAliasCount
};
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const {
propertyAliases,
getCanonicalPropertyName,
hasPropertyAlias,
resolvePropertyAlias,
getSupportedAliasCount
} = require('../src/index.js');
async function runTests() {
// 1. propertyAliases is an instance of Map exported by unicode-property-aliases-ecmascript
assert.ok(propertyAliases instanceof Map, 'propertyAliases must be an instance of Map');
assert.equal(typeof propertyAliases.get, 'function', 'propertyAliases.get must be a function');
assert.equal(typeof propertyAliases.has, 'function', 'propertyAliases.has must be a function');
// 2. propertyAliases.get maps property alias scx to canonical name Script_Extensions
assert.equal(propertyAliases.get('scx'), 'Script_Extensions', 'scx should map to Script_Extensions');
assert.equal(getCanonicalPropertyName('scx'), 'Script_Extensions', 'helper getCanonicalPropertyName(scx) should map to Script_Extensions');
// 3. propertyAliases.get maps property alias gc to canonical name General_Category
assert.equal(propertyAliases.get('sc'), 'Script', 'sc should map to Script');
assert.equal(propertyAliases.get('gc'), 'General_Category', 'gc should map to General_Category');
assert.equal(getCanonicalPropertyName('gc'), 'General_Category', 'helper getCanonicalPropertyName(gc) should map to General_Category');
// 4. propertyAliases.get maps property aliases WSpace and space to canonical name White_Space
assert.equal(propertyAliases.get('WSpace'), 'White_Space', 'WSpace should map to White_Space');
assert.equal(propertyAliases.get('space'), 'White_Space', 'space should map to White_Space');
assert.equal(propertyAliases.get('Alpha'), 'Alphabetic', 'Alpha should map to Alphabetic');
assert.equal(propertyAliases.get('ExtPict'), 'Extended_Pictographic', 'ExtPict should map to Extended_Pictographic');
// 5. propertyAliases.get returns undefined for unmapped or non-existent property aliases
assert.equal(propertyAliases.get('unknown_alias'), undefined, 'unknown alias should return undefined');
assert.equal(propertyAliases.get(''), undefined, 'empty string should return undefined');
assert.equal(getCanonicalPropertyName('invalid'), undefined, 'helper with invalid alias should return undefined');
// 6. propertyAliases.has accurately reports existence of property aliases
assert.equal(propertyAliases.has('scx'), true, 'scx must exist in propertyAliases');
assert.equal(propertyAliases.has('gc'), true, 'gc must exist in propertyAliases');
assert.equal(propertyAliases.has('unknown_alias'), false, 'unknown_alias must not exist in propertyAliases');
assert.equal(hasPropertyAlias('WSpace'), true, 'helper hasPropertyAlias(WSpace) must be true');
assert.equal(hasPropertyAlias('nonexistent'), false, 'helper hasPropertyAlias(nonexistent) must be false');
// 7. propertyAliases contains exactly 54 property alias entries
assert.equal(propertyAliases.size, 54, 'propertyAliases size must be 54');
assert.equal(getSupportedAliasCount(), 54, 'helper getSupportedAliasCount must return 54');
console.log('All contract assertions for unicode-property-aliases-ecmascript passed successfully.');
}
runTests().catch((err) => {
console.error('Contract test failed:', err);
process.exit(1);
});
오리진 시더
익명