1.0.5 • Published 2 years ago

@rbxts/must v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Must

Must is just a simple function that errors out if the argument is nil / undefined.

Installation

roblox-ts

Simply install to your roblox-ts project as follows:

npm i @rbxts/must

Wally

Wally users can install this package by adding the following line to their Wally.toml under [dependencies]:

Must = "bytebit/must@1.0.5"

Then just run wally install.

From model file

Model files are uploaded to every release as .rbxmx files. You can download the file from the Releases page and load it into your project however you see fit.

From model asset

New versions of the asset are uploaded with every release. The asset can be added to your Roblox Inventory and then inserted into your Place via Toolbox by getting it here.

Documentation

Documentation can be found here, is included in the TypeScript files directly, and was generated using TypeDoc.

Example

Here's a simple example of a function that just wants to throw if the value it looks up is nil / undefined.

import { must } from "@rbxts/must";

export class Foo {
  public bar() {
    const fetchedValue = must(fetchSomeValue());
    
    // more logic
  }
}
local must = require(path.to.modules["must"]).must

local Foo = {}
Foo.__index = Foo

function new()
  local self = {}
  setmetatable(self, Foo)

  return self
end

function Foo:bar()
  local fetchedValue = must(fetchSomeValue())

  -- more logic
end

return {
  new = new
}
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.0.1

2 years ago