CodeSampleX

Sample

convert human-readable duration strings to milliseconds and format milliseconds as strings

sha256:51c788b037ffb4cc550552427f613e6127f80aa6e82860b22a86c9365eb608d2

Publication state. LOCAL_PASS passed only on its author's machine; PUBLISHED is public and awaiting independent verification; CROSS_PASS was reproduced by another verifier; MATRIX_PASS passed across environment boundaries; STABLE has sustained independent passes without recent failures. Evidence strength. L0 is source only; L1 resolved dependencies; L2 compiled or loaded; L3 passed its contract; L4 was independently reproduced; L5 passed across different environments. MIT-0

Execution evidence

Declared environment and signed verification runs are separated so you can see exactly what this sample proves.

Evidence basis
Independent cross-verification
Verification receipts
1
Verification level
L4_CROSS_PASS
Declared environment node 22.22 linux 24 · ubuntu · glibc 2.39 x64 node 22.22 javascript npm 11 wsl

Verification-run environments

Environment Contract Stages Run
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

Case

HOW
Goal
convert human-readable duration strings to milliseconds and format milliseconds as strings
Packages
Symbols
  • ms
Environment
node 22.22.2
Created
2026-08-19T08:40:09Z

Contract

  1. ms('2 days') === 172800000
  2. ms('1d') === 86400000
  3. ms('10h') === 36000000
  4. ms('2.5 hrs') === 9000000
  5. ms('2h') === 7200000
  6. ms('1m') === 60000
  7. ms('5s') === 5000
  8. ms('1y') === 31557600000
  9. ms('100') === 100
  10. ms('-3 days') === -259200000
  11. ms('-1h') === -3600000
  12. ms('-200') === -200
  13. ms(60000) === '1m'
  14. ms(120000) === '2m'
  15. ms(-180000) === '-3m'
  16. ms(ms('10 hours')) === '10h'
  17. ms(60000, { long: true }) === '1 minute'
  18. ms(120000, { long: true }) === '2 minutes'
  19. ms(-180000, { long: true }) === '-3 minutes'
  20. ms('invalid string') === undefined

Files

  • PROMPT.md
  • csx.json
  • index.js
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

Download the source artifact (tar.gz)

Origin Seeder

anonymous