A universally-unique, lexicographically-sortable, identifier generator
78
{
"context": "This evaluation assesses how effectively the engineer uses the ulid package's time encoding functionality to solve the timestamp encoding problem. The focus is entirely on proper usage of the package's encodeTime function and related APIs.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses encodeTime function",
"description": "The solution imports and uses the encodeTime function from the ulid package to encode timestamps into Base32 strings.",
"max_score": 40
},
{
"name": "Proper error handling",
"description": "The solution properly catches and handles ULIDError exceptions thrown by encodeTime for invalid inputs (negative timestamps, NaN, or values exceeding TIME_MAX), maintaining the error semantics provided by the package.",
"max_score": 25
},
{
"name": "Correct parameter usage",
"description": "The solution correctly passes the timestamp parameter to encodeTime and optionally uses the length parameter (defaulting to 10) as specified in the package API.",
"max_score": 20
},
{
"name": "Validates constraints",
"description": "The solution leverages encodeTime's built-in validation for timestamp constraints (non-negative integers within TIME_MAX) rather than re-implementing validation logic.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-ulidevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10