샘플
luxon 3.6.1: Info
검증된 샘플 — npm luxon 3.6.1: Info. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: Info.months returns localized month names for specified length…
sha256:565c62b3f299afcc86b437452aa2f52ce2c3ad914cccb7a3e6dcd72762184fb8
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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- 목표
- verify luxon.Info in pkg:npm/luxon@3.6.1
- 패키지
- 심벌
-
- luxon.Info
- 생성일
- 2026-08-27T23:48:10Z
컨트랙트
- Info.months returns localized month names for specified length formats
- Info.weekdays returns localized weekday names starting on Monday
- Info.eras and Info.meridiems return localized era and meridiem strings
- Info.features reports runtime capabilities for relative and localeWeek formatting
- Info.isValidIANAZone validates standard and invalid IANA time zone identifiers
- Info.normalizeZone converts string identifiers into Zone objects and handles default zones
- Info.hasDST identifies whether a given time zone observes daylight saving time
파일
- PROMPT.md
- csx.json
- index.mjs
- package-lock.json
- package.json
- spec.json
- 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 luxon.Info in pkg:npm/luxon@3.6.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/luxon@3.6.1
Demonstrate these symbols/APIs:
- luxon.Info
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:cef74cb4497598bafe23f9dc227e62dcf9201ddf353df52dd849f38e897a7bf7","contract":["Info.months returns localized month names for specified length formats","Info.weekdays returns localized weekday names starting on Monday","Info.eras and Info.meridiems return localized era and meridiem strings","Info.features reports runtime capabilities for relative and localeWeek formatting","Info.isValidIANAZone validates standard and invalid IANA time zone identifiers","Info.normalizeZone converts string identifiers into Zone objects and handles default zones","Info.hasDST identifies whether a given time zone observes daylight saving time"],"goal":"verify luxon.Info in pkg:npm/luxon@3.6.1","kind":"HOW","packages":["pkg:npm/luxon@3.6.1"],"schemaVersion":1,"symbols":["luxon.Info"]},"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/luxon@3.6.1"],"schemaVersion":1,"subject":"pkg:npm/luxon@3.6.1","symbols":["luxon.Info"],"verifierAdapter":"node-typescript@1"}
import { Info } from 'luxon';
export { Info };
/**
* Returns formatted month names for a given format and options.
*
* @param {string} [format='long'] - 'long', 'short', 'narrow', 'numeric', '2-digit'
* @param {object} [options={}] - Options including locale and numberingSystem
* @returns {string[]} Array of month names
*/
export function getMonths(format = 'long', options = {}) {
return Info.months(format, options);
}
/**
* Returns formatted weekday names for a given format and options.
*
* @param {string} [format='long'] - 'long', 'short', 'narrow', 'numeric'
* @param {object} [options={}] - Options including locale and numberingSystem
* @returns {string[]} Array of weekday names (Monday to Sunday)
*/
export function getWeekdays(format = 'long', options = {}) {
return Info.weekdays(format, options);
}
/**
* Returns era names for a given format and options.
*
* @param {string} [format='short'] - 'long', 'short', 'narrow'
* @param {object} [options={}] - Options including locale
* @returns {string[]} Array of era names
*/
export function getEras(format = 'short', options = {}) {
return Info.eras(format, options);
}
/**
* Returns meridiem tokens for a given locale.
*
* @param {object} [options={}] - Options including locale
* @returns {string[]} Array of meridiem strings (e.g. ['AM', 'PM'])
*/
export function getMeridiems(options = {}) {
return Info.meridiems(options);
}
/**
* Returns available feature flags in the current environment.
*
* @returns {object} Feature flags object
*/
export function getFeatures() {
return Info.features();
}
/**
* Checks if a zone identifier is a valid IANA time zone.
*
* @param {string} zone - IANA time zone identifier
* @returns {boolean} True if valid IANA zone
*/
export function isIANAZone(zone) {
return Info.isValidIANAZone(zone);
}
/**
* Normalizes a time zone identifier or Zone object into a Zone instance.
*
* @param {string|object} zone - Zone identifier or Zone object
* @returns {object} Normalized Zone instance
*/
export function normalizeZone(zone) {
return Info.normalizeZone(zone);
}
/**
* Checks if a time zone observes Daylight Saving Time (DST).
*
* @param {string} [zone='system'] - Zone identifier
* @returns {boolean} True if the zone observes DST
*/
export function hasDST(zone = 'system') {
return Info.hasDST(zone);
}
export default {
Info,
getMonths,
getWeekdays,
getEras,
getMeridiems,
getFeatures,
isIANAZone,
normalizeZone,
hasDST,
};
{
"name": "sample-luxon-info",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-luxon-info",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"luxon": "3.6.1"
}
},
"node_modules/luxon": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
"integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
"license": "MIT",
"engines": {
"node": ">=12"
}
}
}
}
{
"name": "sample-luxon-info",
"version": "1.0.0",
"type": "module",
"private": true,
"license": "MIT-0",
"dependencies": {
"luxon": "3.6.1"
}
}
{
"schemaVersion": 1,
"goal": "verify luxon.Info in pkg:npm/luxon@3.6.1",
"kind": "HOW",
"packages": [
"pkg:npm/luxon@3.6.1"
],
"symbols": [
"luxon.Info"
]
}
import assert from 'node:assert/strict';
import {
Info,
getMonths,
getWeekdays,
getEras,
getMeridiems,
getFeatures,
isIANAZone,
normalizeZone,
hasDST,
} from '../index.mjs';
// Contract 1: Info.months returns localized month names for specified length formats
{
const longMonths = getMonths('long', { locale: 'en' });
assert.strictEqual(Array.isArray(longMonths), true);
assert.strictEqual(longMonths.length, 12);
assert.strictEqual(longMonths[0], 'January');
assert.strictEqual(longMonths[11], 'December');
const shortMonths = getMonths('short', { locale: 'en' });
assert.strictEqual(shortMonths.length, 12);
assert.strictEqual(shortMonths[0], 'Jan');
assert.strictEqual(shortMonths[6], 'Jul');
const numericMonths = getMonths('numeric', { locale: 'en' });
assert.strictEqual(numericMonths.length, 12);
assert.strictEqual(numericMonths[0], '1');
assert.strictEqual(numericMonths[11], '12');
}
// Contract 2: Info.weekdays returns localized weekday names starting on Monday
{
const longWeekdays = getWeekdays('long', { locale: 'en' });
assert.strictEqual(Array.isArray(longWeekdays), true);
assert.strictEqual(longWeekdays.length, 7);
assert.strictEqual(longWeekdays[0], 'Monday');
assert.strictEqual(longWeekdays[6], 'Sunday');
const shortWeekdays = getWeekdays('short', { locale: 'en' });
assert.strictEqual(shortWeekdays.length, 7);
assert.strictEqual(shortWeekdays[0], 'Mon');
assert.strictEqual(shortWeekdays[4], 'Fri');
assert.strictEqual(shortWeekdays[6], 'Sun');
}
// Contract 3: Info.eras and Info.meridiems return localized era and meridiem strings
{
const eras = getEras('short', { locale: 'en' });
assert.strictEqual(Array.isArray(eras), true);
assert.strictEqual(eras.length, 2);
assert.strictEqual(eras[0], 'BC');
assert.strictEqual(eras[1], 'AD');
const meridiems = getMeridiems({ locale: 'en' });
assert.strictEqual(Array.isArray(meridiems), true);
assert.strictEqual(meridiems.length, 2);
assert.strictEqual(meridiems[0], 'AM');
assert.strictEqual(meridiems[1], 'PM');
}
// Contract 4: Info.features reports runtime capabilities for relative and localeWeek formatting
{
const features = getFeatures();
assert.strictEqual(typeof features, 'object');
assert.strictEqual(typeof features.relative, 'boolean');
assert.strictEqual(typeof features.localeWeek, 'boolean');
assert.strictEqual(features.relative, true);
}
// Contract 5: Info.isValidIANAZone validates standard and invalid IANA time zone identifiers
{
assert.strictEqual(isIANAZone('UTC'), true);
assert.strictEqual(isIANAZone('America/New_York'), true);
assert.strictEqual(isIANAZone('Europe/London'), true);
assert.strictEqual(isIANAZone('Asia/Tokyo'), true);
assert.strictEqual(isIANAZone('Invalid/Zone_Name'), false);
assert.strictEqual(isIANAZone(''), false);
assert.strictEqual(isIANAZone(null), false);
}
// Contract 6: Info.normalizeZone converts string identifiers into Zone objects and handles default zones
{
const utcZone = normalizeZone('UTC');
assert.strictEqual(typeof utcZone, 'object');
assert.strictEqual(utcZone.name, 'UTC');
assert.strictEqual(utcZone.isValid, true);
const systemZone = normalizeZone('system');
assert.strictEqual(typeof systemZone, 'object');
assert.strictEqual(systemZone.isValid, true);
const defaultZone = normalizeZone(null);
assert.strictEqual(typeof defaultZone, 'object');
assert.strictEqual(defaultZone.isValid, true);
}
// Contract 7: Info.hasDST identifies whether a given time zone observes daylight saving time
{
assert.strictEqual(hasDST('UTC'), false);
assert.strictEqual(hasDST('America/New_York'), true);
}
console.log('Contract tests passed successfully.');
오리진 시더
익명