https://github.com/bytebit-org/roblox-strictmap
A simple class that looks like a regular map but that throws if indexed by a missing key.
https://github.com/bytebit-org/roblox-strictmap
Last synced: 4 months ago
JSON representation
A simple class that looks like a regular map but that throws if indexed by a missing key.
- Host: GitHub
- URL: https://github.com/bytebit-org/roblox-strictmap
- Owner: Bytebit-Org
- License: mit
- Created: 2022-03-25T00:05:37.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T05:05:27.000Z (about 3 years ago)
- Last Synced: 2025-01-31T19:07:26.152Z (4 months ago)
- Language: TypeScript
- Size: 110 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Strict Map
Strict Map is a simple class that looks like a regular map but that throws if indexed by a missing key.
## Installation
### roblox-ts
Simply install to your [roblox-ts](https://roblox-ts.com/) project as follows:
```
npm i @rbxts/strict-map
```### Wally
[Wally](https://github.com/UpliftGames/wally/) users can install this package by adding the following line to their `Wally.toml` under `[dependencies]`:
```
StrictMap = "bytebit/[email protected]"
```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](https://github.com/Bytebit-Org/roblox-StrictMap/releases) 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.](https://www.roblox.com/library/1234567890/Strict-Map-Package)## Documentation
Documentation can be found [here](https://github.com/Bytebit-Org/roblox-StrictMap/tree/master/docs), is included in the TypeScript files directly, and was generated using [TypeDoc](https://typedoc.org/).## Example
A brief description of the exampleroblox-ts example
```ts
import { PackageClass, packageFunction } from "@rbxts/strict-map";export class PackageConsumer {
}
```Luau example
```lua
local PackageClass = require(path.to.modules["strict-map"]).PackageClass
local packageFunction = require(path.to.modules["strict-map"]).packageFunctionlocal PackageConsumer = {}
PackageConsumer.__index = PackageConsumerfunction new()
local self = {}
setmetatable(self, PackageConsumer)return self
end
return {
new = new
}
```