Skip to content

isValidUnixUnit

  • The core functions, which every industry uses.
isValidUnixUnit(unit: unknown): unit is UnixUnit

Return true when unit is a valid UnixUnit.

  • Valid units are "seconds", "milliseconds" and their singular forms "second", "millisecond" (Temporal §13.17 GetTemporalUnitValuedOption accepts both).
  • Names are case-sensitive; any non-string input returns false.
ParameterTypeDescription
unitunknowncandidate value of any type

boolean indicating whether the unit is a valid UnixUnit

import { isValidUnixUnit } from "@northguild/gmt/unix/validate";
isValidUnixUnit("seconds") // true
output 

unix/validate/isValidUnixUnit.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.