Skip to main content
Home

Built and signed on GitHub Actions

A collection of the most common types used across kz packages, adapted for API consistency and case-coverage, exhaustively tested, and documented thoroughly.

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
7 months ago (0.0.11)

kz logo common-types

kz is a library providing heavily tested and documented features with consistent and predictable APIs designed to simplify the development and maintenance of complex, performant, and scalable Deno applications.

@kz/common-types

The @kz/common-types module provides base type aliases, interfaces, and enums for the core modules and others commonly used across kz libraries and in general development.

Overview | API Docs

import type { IHelpful, Scalar } from './mod.ts';

const help: IHelpful = {
  helpUrl: 'https://example.com',
};

const pathId: Scalar = help.helpUrl;

Why are enums here?

Enums, as integereleven uses them, only have numeric values. Because of this, we can generally get away with using the enum only as a type and provide a matching number without referencing the enum itself.

We use the enums more as type documentation for developers.

import { assertEquals } from '@std/assert';
import type { ComparisonResult } from './mod.ts';

function compare(a: number, b: number): ComparisonResult {
  if (a === b) return 0;

  return a > b ? 1 : -1;
}

const result = compare(10, 9); // ComparisonResult.Greater

assertEquals(result, 1);

Contributing

Contributions are welcome! Take a look at our contributing guidelines to get started.

Contributor Covenant

License

The MIT License (MIT) 2022 integereleven. Refer to LICENSE for details.

Built with ❤ by integereleven

kz.io logo

GitHub commit activity GitHub issues

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@kz/common-types

Import symbol

import * as common_types from "@kz/common-types";
or

Import directly with a jsr specifier

import * as common_types from "jsr:@kz/common-types";

Add Package

pnpm i jsr:@kz/common-types
or (using pnpm 10.8 or older)
pnpm dlx jsr add @kz/common-types

Import symbol

import * as common_types from "@kz/common-types";

Add Package

yarn add jsr:@kz/common-types
or (using Yarn 4.8 or older)
yarn dlx jsr add @kz/common-types

Import symbol

import * as common_types from "@kz/common-types";

Add Package

npx jsr add @kz/common-types

Import symbol

import * as common_types from "@kz/common-types";

Add Package

bunx jsr add @kz/common-types

Import symbol

import * as common_types from "@kz/common-types";