StatichasStaticregisterRegisters a new discriminator and its associated validation function.
+The registration details for the discriminator.
+If the DiscriminatorRegistration.discriminator is not a non-empty single line trimmed string.
+If the DiscriminatorRegistration.validator property is not a function.
+If the DiscriminatorRegistration.discriminator is already registered.
+StaticvalidateValidates an input against a specific discriminator.
+The input to validate.
+The discriminator value to check.
+true if the input matches the type associated with the discriminator, false otherwise.Static properties and methods for validating number types.
+StaticisStaticisStaticisIs the given input a positive integer?
+The input to check.
+true if zero should be considered a valid input.
+false if zero should be considered an invalid input.
+Default value is false.
true if the given input is a positive integer, or zero when zeroInclusive is true; false otherwise.
Static properties and methods for generating random numbers and booleans, and for selecting random elements from arrays.
+StaticrandomStaticrandomStaticrandomStaticrandomStaticrandomGet a random floating-point number within the given range.
+The minimum value (inclusive).
+The maximum value (exclusive).
+A random floating-point number in the range [min, max) (min inclusive, max exclusive).
+ +StaticrandomGet a random integer within the given range.
+If min or max is not an integer, it is rounded down with Math.floor before a value is generated.
The minimum value (inclusive).
+Non-integer values are rounded down with Math.floor.
The maximum value (exclusive).
+Non-integer values are rounded down with Math.floor.
A random integer in the range [Math.floor(min), Math.floor(max)) (min inclusive, max exclusive).
+ +StaticrandomGet a random integer within the given range.
+If min or max is not an integer, it is rounded down with Math.floor before a value is generated.
The minimum value (inclusive).
+Non-integer values are rounded down with Math.floor.
The maximum value (exclusive).
+Non-integer values are rounded down with Math.floor.
A random integer in the range [Math.floor(min), Math.floor(max)) (min inclusive, max exclusive).
+ +StaticrandomGet a random element from the given WeightedList.
+The WeightedList to select a random element from.
+A random element from the given WeightedList, where the selection probability is equal to the WeightedElement.weight of each element.
+ +A static factory class for creating a SeededRandomNumberGenerator object.
+StaticasyncBuild a SeededRandomNumberGenerator object with the given seed and namespace from an asynchronous hashing algorithm.
+The primary input to determine the random number sequence.
+Optionalnamespace: string
+Namespace to create different sequences from the same seed.
+StaticbuildBuild a SeededRandomNumberGenerator object with the given seed, namespace, and version.
+The primary input to determine the random number sequence.
+Optionalnamespace: string
+Namespace to create different sequences from the same seed.
+Optionalversion: number
+The SeedVersions index to use for selecting the offsets for hashing. +Changing the version number will result in a different sequence of random numbers for the same seed and namespace.
+A static class for accessing different seed versions. +Each seed version index is guaranteed to always return the same seed version object, so that the same seed and version will always produce the same sequence of pseudorandom numbers.
+StaticgetGet a SeedVersion object.
+The index of the seed version to retrieve. +Must be a valid SeedVersions index.
+StaticisDeterministic seeded pseudorandom number generator. +This generator utilizes the xoshiro128** algorithm, which is a pseudorandom number generator suitable for general-purpose use.
+SeededRandomNumberGenerator constructor.
+Initial 128-bit state. +Must be an array with 4 32-bit unsigned integers, where at least one element is greater than 0.
+Static methods and properties for building and validating WeightedElement and WeightedList objects.
+StaticbuildBuilds a WeightedElement object with a value of the given type.
+The input to build the WeightedElement from.
+The value to be selected from the weighted list.
+The probability weight of the element. Should be a number between 0 and 1, inclusive.
+A WeightedElement object with a value of the given type.
+ +StaticbuildBuilds a WeightedList object from the given elements list.
+The elements to build the WeightedList from. +Each element will be converted into a WeightedElement using WeightedElementUtility.buildWeightedElement.
+A WeightedList object containing the given elements.
+ +StaticisIs the given input a WeightedElement object? +This method does not enforce type checking for WeightedElement.value.
+The input to check.
+true if the given input is a WeightedElement object; false otherwise.StaticisIs the given input a WeightedList object? +This method does not enforce type checking for the WeightedElement.value property of the list elements.
+The input to check.
+true if the given input is a valid WeightedList object; false otherwise.
+For a WeightedList to be valid, it must be a non-empty array of WeightedElement objects, where the sum of WeightedElement.weight properties in the array is equal to 1.StaticisIs the given input a WeightedElement object, whose WeightedElement.value property passes the given type guard function?
+The input to check.
+The method used to validate the type of WeightedElement.value.
+This method should return true if the value is of the expected type, and false otherwise.
+The type validated by the function should match the assigned type of the WeightedElement.
true if the given input is a WeightedElement object with a value of the correct type; false otherwise.StaticisIs the given input a WeightedList object, where each WeightedElement object in the array contains a WeightedElement.value property that passes the given type guard function?
+The input to check.
+The method used to validate the type of each WeightedElement.value in the array.
+This method should return true if the value is of the expected type, and false otherwise.
+The type validated by the function should match the assigned type of the WeightedList.
true if the given input is a WeightedList object with elements of the correct type; false otherwise.
+For a WeightedList to be valid, it must be a non-empty array of WeightedElement objects, where the sum of WeightedElement.weight properties in the array is equal to 1.StaticvalidateValidate that an object is a valid WeightedList. +This method does not enforce type checking for the WeightedElement.value property of the given elements in the list.
+The list to validate.
+Static properties and methods for validating formatted color strings.
+StatichexStatichexStatichexStaticisIs the given input a string matching the ColorStringUtility.hexColorPattern pattern?
+The input to check.
+true if the given input matches the ColorStringUtility.hexColorPattern pattern; false otherwise.
StaticisIs the given input a string matching the ColorStringUtility.hexColorPatternRGB pattern?
+The input to check.
+true if the given input matches the ColorStringUtility.hexColorPatternRGB pattern; false otherwise.
StaticisIs the given input a string matching the ColorStringUtility.hexColorPatternRGBA pattern?
+The input to check.
+true if the given input matches the ColorStringUtility.hexColorPatternRGBA pattern; false otherwise.
Static properties and methods for validating string types.
+StaticsingleGet the regular expression for single-line lowercase strings.
+Regular expression pattern for validating single-line lowercase strings.
+ +StaticsingleGet the regular expression for single-line mixed-case strings.
+Regular expression pattern for validating single-line mixed-case strings.
+ +StaticsingleGet the regular expression for single-line uppercase strings.
+Regular expression pattern for validating single-line uppercase strings.
+ +StaticisStaticisIs the given input a single-line lowercase string that is trimmed (no leading or trailing whitespace)?
+The input to check.
+true if the given input is a single-line lowercase string that is trimmed; false otherwise.StaticisIs the given input a single-line string that is trimmed (no leading or trailing whitespace)?
+The input to check.
+true if the given input is a single-line string that is trimmed; false otherwise.StaticisIs the given input a single-line uppercase string that is trimmed (no leading or trailing whitespace)?
+The input to check.
+true if the given input is a single-line uppercase string that is trimmed; false otherwise.StaticisA growing toolkit of reusable TypeScript and JavaScript utilities for number checks, string checks, random number and element selection (including weighted selection), deterministic seeded pseudorandom number generation, and a discriminator-based type guard registry.
+Development for this project originally began in March 2022 when I started creating utility classes in JavaScript to use across my personal algorithmic generative art projects. +Over the years, the utilities have been refined, expanded, updated, and organized into a series of cohesive libraries that can be used in a variety of projects.
+The source code of this project is licensed under the MIT License. +The full text of the license is included with the project source code.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A huge thank you to all the open source contributors who have made this project possible by creating and maintaining the libraries and tools used in this project, and to the open source community for fostering collaboration and innovation.
+A special thank you to all the educators, mentors, and content creators who have shared their knowledge and expertise in the fields of algorithmic art, web development, and computer science. +Thank you for giving me the tools, resources, opportunities, support, and inspiration to learn and grow as a developer.
+Copyright © 2022-2026 Brittni Watkins.
+A registration for a discriminator to the DiscriminatorRegistry.
+ReadonlydiscriminatorThe discriminator value that identifies the type of a Discriminated object. +This value must be unique across all registered discriminators.
+ReadonlyvalidatorA method that validates whether an input matches the type associated with the discriminator.
+The input to validate.
+true if the input matches the type associated with the discriminator, false otherwise.A seed version defines a specific set of offsets for the FNV-1a hashing algorithm. +A different set of offsets results in a different hash for the same input, which results in a different initial state for the seeded random number generator, which results in a different sequence of pseudorandom numbers.
+Interface for a weighted element, which can be used for non-uniform random selection from a list.
+Discriminated objects can be type checked using the discriminator registry.
+A type guard function that checks if an input is of a specific Discriminated type.
+Type alias for a list of WeightedElement objects.
+ConstTypeBox schema for validating that an object implements the Discriminated type.
+ConstTypeBox schema to validate a WeightedElement object.
+
Static registry for managing discriminators and their associated type guards. +Discriminators are used to identify the type of a Discriminated object and validate it using a registered type guard function.
+Since
0.1.0
+