Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
howmanysmall committed Dec 27, 2023
1 parent 24d9ad2 commit 3708f13
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 deletions.
5 changes: 2 additions & 3 deletions aftman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

# To add a new tool, add an entry to this table.
[tools]
rojo = "rojo-rbx/[email protected]"
wally = "UpliftGames/[email protected]"
# rojo = "rojo-rbx/[email protected]"
rojo = "rojo-rbx/[email protected]"
wally = "UpliftGames/[email protected]"
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.15.7] - 2023-12-27

### Added

- Added `Janitor.instanceof` for rbxts usage.

### Changed

- Made the Promise dependency "optional". It's still required in the Wally file, but it's not actually required if it can't detect it.
- Updated the dependencies in the aftman file.
- Changed one of the tests to use itSKIP.

## [1.15.6] - 2023-08-09

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ HttpService.HttpEnabled = HttpEnabled`}

```toml
[dependencies]
Janitor = "howmanysmall/janitor@^1.15.6"
Janitor = "howmanysmall/janitor@^1.15.7"
```

## Next
Expand Down
18 changes: 17 additions & 1 deletion src/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
--!optimize 2
--!strict
-- Compiled with L+ C Edition
-- Janitor
-- Original by Validark
Expand All @@ -6,7 +8,7 @@
-- LinkToInstance fixed by Elttob.
-- Cleanup edge cases fixed by codesenseAye.

local Promise = require(script.Parent.Promise)
local Promise = if script.Parent:FindFirstChild("Promise") then require(script.Parent.Promise) else nil

local IndicesReference = setmetatable({}, {
__tostring = function()
Expand Down Expand Up @@ -84,6 +86,16 @@ function Janitor.Is(Object: any): boolean
return type(Object) == "table" and getmetatable(Object) == Janitor
end

--[=[
An alias for [Janitor.Is](#Is). This is intended for roblox-ts support.
@function instanceof
@within Janitor
@param Object any -- The object you are checking.
@return boolean -- `true` if `Object` is a Janitor.
]=]
Janitor.instanceof = Janitor.Is

type BooleanOrString = boolean | string

--[=[
Expand Down Expand Up @@ -228,6 +240,10 @@ end
@return Promise
]=]
function Janitor:AddPromise(PromiseObject)
if not Promise then
return PromiseObject
end

if not Promise.is(PromiseObject) then
error(string.format(NOT_A_PROMISE, typeof(PromiseObject), tostring(PromiseObject), debug.traceback(nil, 2)))
end
Expand Down
2 changes: 1 addition & 1 deletion test/Janitor.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ return function()
end)

describe("LinkToInstances", function()
it("should not be tested", function()
itSKIP("should not be tested", function()
expect(not not "i should do this later").to.equal(true)
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion wally.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ dependencies = []

[[package]]
name = "howmanysmall/janitor"
version = "1.15.6"
version = "1.15.7"
dependencies = [["Promise", "evaera/[email protected]"]]
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "A garbage collector object implementation for Roblox, featuring s
license = "MIT"
realm = "shared"
registry = "https://github.com/UpliftGames/wally-index"
version = "1.15.6"
version = "1.15.7"
exclude = [
"docs",
".moonwave",
Expand Down

0 comments on commit 3708f13

Please sign in to comment.