@quenty/maid 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/maid@2.5.0...@quenty/maid@2.6.0) (2023-08-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add Maid:Add() which returns the task you pass into the maid ([bf9e3d6](https://github.com/Quenty/NevermoreEngine/commit/bf9e3d66e5c31ec0dafcc1c9e4142d963d309c65))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/maid@2.4.0...@quenty/maid@2.5.0) (2023-03-05)
7
18
 
8
19
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2014-2022 Quenty
3
+ Copyright (c) 2014-2023 James Onnen (Quenty)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/maid",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "Easily cleanup event listeners and objects in Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "e62b5eac2e5d9084ab9083f128452dd2d98b6f1a"
32
+ "gitHead": "2547e660a0333034a5b20ddd6b23e343bc01f7c6"
33
33
  }
@@ -135,6 +135,26 @@ function Maid:__newindex(index, newTask)
135
135
  end
136
136
  end
137
137
 
138
+ --[=[
139
+ Gives a task to the maid for cleanup and returnsthe resulting value
140
+
141
+ @param task MaidTask -- An item to clean
142
+ @return MaidTask
143
+ ]=]
144
+ function Maid:Add(task)
145
+ if not task then
146
+ error("Task cannot be false or nil", 2)
147
+ end
148
+
149
+ self[#self._tasks+1] = task
150
+
151
+ if type(task) == "table" and (not task.Destroy) then
152
+ warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
153
+ end
154
+
155
+ return task
156
+ end
157
+
138
158
  --[=[
139
159
  Gives a task to the maid for cleanup, but uses an incremented number as a key.
140
160