Skip to content
tutils / 6.0.0-alpha.10

tutils 6.0.0-alpha.10

Install from the command line:
Learn more about npm packages
$ npm install @flex-development/tutils@6.0.0-alpha.10
Install via package.json:
"@flex-development/tutils": "6.0.0-alpha.10"

About this version

tutils

npm codecov module type: cjs+esm license conventional commits typescript vitest yarn

TypeScript utilities.

Contents

What is this?

This package contains a set of general TypeScript utilities. It includes enums, interfaces, types, and type guards.

When should I use this?

TODO: when should i use this?

Install

yarn add @flex-development/tutils

From Git:

yarn add @flex-development/tutils@flex-development/tutils
See Git - Protocols | Yarn  for details on requesting a specific branch, commit, or tag.

Use

import type { Nullable, Path } from '@flex-development/tutils'

/**
 * Object representing a `User` entity **(from the database)**.
 *
 * **Does not include any [virtual fields][1]**.
 *
 * [1]: https://sequelize.org/v7/manual/getters-setters-virtuals#virtual-fields
 */
interface IUser {
  created_at: number
  email: Lowercase<string>
  id: number
  name: { first: Nullable<string>; last: Nullable<string> }
  updated_at: Nullable<number>
}

/** {@linkcode IUser} attributes. */
type UserAttribute = Path<IUser> // 'created_at' | 'email' | 'id' | 'name' | 'name.first' | 'name.last' | 'updated_at'

export type { IUser as default, UserAttribute }

Related

Details


Assets

  • tutils-6.0.0-alpha.10.tgz

Download activity

  • Total downloads 17,047
  • Last 30 days 707
  • Last week 224
  • Today 30