1.0.3 • Published 3 months ago

yeet-ts v1.0.3

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
3 months ago

Yeet

One day, JavaScript will have throw expressions. Until then, yeet!

function save(filename = yeet("Argument required")) { ... }

const encoder = encoding === "utf8" ? new UTF8Encoder() 
              : encoding === "utf16le" ? new UTF16Encoder(false) 
              : encoding === "utf16be" ? new UTF16Encoder(true) 
              : yeet(TypeError, "Unsupported encoding");

class Product {
  get id() { return this._id; }
  set id(value) { this._id = value ?? yeet("Invalid value"); }
}

Install

NPM

npm install yeet-ts
# or
pnpm install yeet-ts
# or
bun install yeet-ts

... and then

import { yeet } from "yeet-ts";

Deno

import { yeet } from "https://deno.land/x/yeet@v1.0.3/src/mod.ts";

Contribute

To install dependencies:

bun install

To build:

bun run build

To publish:

bun run pub
1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago