@flex-development/tutils
TypeScript icon, indicating that this package has built-in type declarations

5.0.1 • Public • Published

tutils

conventional commits code style: prettier module type: cjs+esm npm license typescript

TypeScript utilities.

Install

yarn add @flex-development/tutils

GitHub Package Registry

To install from the GitHub Package Registry, setup a .npmrc or .yarnrc.yml file to authenticate with the registry. A Personal Access Token with at least the read:packages scope is required.

.npmrc

//npm.pkg.github.com/:_authToken=${GH_PAT}
@flex-development:registry=https://npm.pkg.github.com/

.yarnrc.yml

npmRegistries:
  //npm.pkg.github.com:
    npmAlwaysAuth: true
    npmAuthToken: ${GH_PAT}

npmScopes:
  flex-development:
    npmRegistryServer: https://npm.pkg.github.com

Git

For details on requesting a specific branch, commit, or tag, see npm-install or Git - Protocols | Yarn.

NPM

npm i flex-development/tutils

Yarn

yarn add @flex-development/tutils@flex-development/tutils

Usage

import type {
  NullishNumber,
  NullishString,
  OrNull,
  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 IUserRaw {
  created_at: number
  email: Lowercase<string>
  id: number
  name: { first: NullishString; last: NullishString }
  updated_at: NullishNumber
}

/** {@link IUserRaw} attributes. */
type UserRawAttribute = Path<IUserRaw> // 'created_at' | 'email' | 'id' | 'name' | 'name.first' | 'name.last' | 'updated_at'

export { type IUserRaw as default, type UserRawAttribute }

Exports

Package Sidebar

Install

npm i @flex-development/tutils

Weekly Downloads

261

Version

5.0.1

License

BSD-3-Clause

Unpacked Size

292 kB

Total Files

565

Last publish

Collaborators

  • unicornware