Skip to content

Commit 60aa398

Browse files
authored
Merge pull request #4 from 921starfish/feat/refine-type
Changed the type from never to unknown to hide the implementation.
2 parents 2df0199 + cfefa1f commit 60aa398

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ A minimal `Unit` type implementation for Luau.
44

55
Primarily targets Roblox. It will probably work elsewhere, but it has not been tested on [Luau](https://github.com/luau-lang/luau), [Lute](https://github.com/luau-lang/lute), or [Lune](https://github.com/lune-org/lune).
66

7-
> [!WARNING]
8-
> This library is currently in **beta**.
9-
107
## What is Unit Type?
118

129
Unit type is a type that has exactly one value. It is useful when you need to represent "no meaningful value" in a type-safe way, similar to `void` in other languages but as an actual value.
@@ -19,15 +16,15 @@ Add the following to your `wally.toml`:
1916

2017
```toml
2118
[dependencies]
22-
Unit = "921starfish/unit@0.9.9"
19+
Unit = "921starfish/unit@1.0.0"
2320
```
2421

2522
> [!NOTE]
2623
> Due to a Wally limitation, you need to run [Wally Package Types Fixer](https://github.com/JohnnyMorganz/wally-package-types) to use the [`Unit.Unit` type](#type-annotation).
2724
2825
### GitHub
2926

30-
Download `Unit.luau` from the [latest release](https://github.com/921starfish/unit-for-luau/releases/latest) and place it wherever you like.
27+
Download `src.zip` from the [latest release](https://github.com/921starfish/unit-for-luau/releases/latest) and place it wherever you like.
3128

3229
## Usage
3330

src/init.luau

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--!strict
22
local UnitModule = require(script.Unit)
33

4-
export type Unit = never
4+
export type Unit = unknown
55

66
return (UnitModule :: unknown) :: {
77
new: () -> Unit,

wally.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "921starfish/unit"
33
description = "A minimal Unit type for Luau"
4-
version = "0.9.9"
4+
version = "1.0.0"
55
license = "MIT"
66
authors = ["Yūya Hoshino <7694387+921starfish@users.noreply.github.com>"]
77
registry = "https://github.com/UpliftGames/wally-index"

0 commit comments

Comments
 (0)