CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-ulid

tessl install tessl/npm-ulid@3.0.0

A universally-unique, lexicographically-sortable, identifier generator

Agent Success

Agent success rate when using this tile

78%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.34x

Baseline

Agent success rate without this tile

58%

task.mdevals/scenario-5/

ULID Validator Utility

A utility module for validating and filtering ULID strings in data processing pipelines.

Capabilities

Validates individual ULID strings

  • When given a valid ULID string "01HNZX8JGFACFA36RBXDHEQN6E", the validator returns true @test
  • When given an empty string, the validator returns false @test
  • When given a string with incorrect length "01HNZX8JGFACFA36RBXD", the validator returns false @test
  • When given a string with invalid characters "01HNZX8JGFACFA36RBXDHEQN6U", the validator returns false @test

Filters arrays of ULID strings

  • When given an array containing both valid and invalid ULID strings, the filter returns only the valid ones @test
  • When given an array with all invalid strings, the filter returns an empty array @test
  • When given an empty array, the filter returns an empty array @test

Counts valid ULIDs in collections

  • When given an array of strings, the counter returns the number of valid ULIDs @test

Implementation

@generates

API

/**
 * Validates whether a given string is a valid ULID
 * @param id - The string to validate
 * @returns true if valid ULID, false otherwise
 */
export function validateULID(id: string): boolean;

/**
 * Filters an array of strings, returning only valid ULIDs
 * @param ids - Array of strings to filter
 * @returns Array containing only valid ULID strings
 */
export function filterValidULIDs(ids: string[]): string[];

/**
 * Counts the number of valid ULIDs in an array
 * @param ids - Array of strings to check
 * @returns The count of valid ULIDs
 */
export function countValidULIDs(ids: string[]): number;

Dependencies { .dependencies }

ulid { .dependency }

Provides ULID validation functionality.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/ulid@3.0.x
tile.json