@quenty/ugcsanitize 1.4.3 → 1.4.4-canary.11a5dcf.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
+ ## [1.4.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ugcsanitize@1.4.3...@quenty/ugcsanitize@1.4.4-canary.11a5dcf.0) (2025-05-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.4.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ugcsanitize@1.4.2...@quenty/ugcsanitize@1.4.3) (2025-04-10)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/ugcsanitize
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/ugcsanitize",
3
- "version": "1.4.3",
3
+ "version": "1.4.4-canary.11a5dcf.0",
4
4
  "description": "Sanitizes UGC hats and other items",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,14 +25,14 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/baseobject": "^10.8.3",
29
- "@quenty/instanceutils": "^13.17.3",
30
- "@quenty/loader": "^10.8.3",
31
- "@quenty/maid": "^3.4.3",
32
- "@quenty/string": "^3.3.3"
28
+ "@quenty/baseobject": "10.8.4-canary.11a5dcf.0",
29
+ "@quenty/instanceutils": "13.17.4-canary.11a5dcf.0",
30
+ "@quenty/loader": "10.8.4-canary.11a5dcf.0",
31
+ "@quenty/maid": "3.4.4-canary.11a5dcf.0",
32
+ "@quenty/string": "3.3.3"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
37
+ "gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
38
38
  }
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class DisableHatParticles
3
4
  ]=]
@@ -5,6 +6,7 @@
5
6
  local require = require(script.Parent.loader).load(script)
6
7
 
7
8
  local BaseObject = require("BaseObject")
9
+ local Maid = require("Maid")
8
10
  local RxInstanceUtils = require("RxInstanceUtils")
9
11
  local String = require("String")
10
12
 
@@ -12,8 +14,21 @@ local DisableHatParticles = setmetatable({}, BaseObject)
12
14
  DisableHatParticles.ClassName = "DisableHatParticles"
13
15
  DisableHatParticles.__index = DisableHatParticles
14
16
 
15
- function DisableHatParticles.new(character: Model)
16
- local self = setmetatable(BaseObject.new(character), DisableHatParticles)
17
+ export type DisableHatParticles = typeof(setmetatable(
18
+ {} :: {
19
+ _obj: Model,
20
+ },
21
+ {} :: typeof({ __index = DisableHatParticles })
22
+ )) & BaseObject.BaseObject
23
+
24
+ --[=[
25
+ Disables all particles and sounds in hats for the lifetime of the object
26
+
27
+ @param character Model -- The character to disable particles for
28
+ @return DisableHatParticles
29
+ ]=]
30
+ function DisableHatParticles.new(character: Model): DisableHatParticles
31
+ local self: DisableHatParticles = setmetatable(BaseObject.new(character) :: any, DisableHatParticles)
17
32
 
18
33
  self._maid:GiveTask(RxInstanceUtils.observeChildrenOfClassBrio(self._obj, "Accessory"):Subscribe(function(brio)
19
34
  if brio:IsDead() then
@@ -21,13 +36,15 @@ function DisableHatParticles.new(character: Model)
21
36
  end
22
37
 
23
38
  local maid, accessory = brio:ToMaidAndValue()
39
+ assert(accessory:IsA("Accessory"), "Expected accessory")
40
+
24
41
  self:_handleAccessory(maid, accessory)
25
42
  end))
26
43
 
27
44
  return self
28
45
  end
29
46
 
30
- function DisableHatParticles:_handleAccessory(maid, accessory: Accessory)
47
+ function DisableHatParticles._handleAccessory(self: DisableHatParticles, maid: Maid.Maid, accessory: Accessory)
31
48
  maid:GiveTask(accessory.DescendantAdded:Connect(function(descendant)
32
49
  self:_handleAccessoryDescendant(maid, descendant)
33
50
  end))
@@ -40,7 +57,7 @@ function DisableHatParticles:_handleAccessory(maid, accessory: Accessory)
40
57
  end
41
58
  end
42
59
 
43
- function DisableHatParticles:_handleAccessoryDescendant(maid, descendant)
60
+ function DisableHatParticles._handleAccessoryDescendant(self: DisableHatParticles, maid: Maid.Maid, descendant: any)
44
61
  if
45
62
  descendant:IsA("Fire")
46
63
  or descendant:IsA("Sparkles")
@@ -75,7 +92,7 @@ function DisableHatParticles:_handleAccessoryDescendant(maid, descendant)
75
92
  end
76
93
  end
77
94
 
78
- function DisableHatParticles:_isASoundScript(descendant)
95
+ function DisableHatParticles._isASoundScript(_self: DisableHatParticles, descendant: Instance)
79
96
  if not descendant:IsA("LocalScript") then
80
97
  return false
81
98
  end
@@ -95,7 +112,7 @@ function DisableHatParticles:_isASoundScript(descendant)
95
112
  return false
96
113
  end
97
114
 
98
- function DisableHatParticles:_isSound(descendant)
115
+ function DisableHatParticles._isSound(_self: DisableHatParticles, descendant: Instance): boolean
99
116
  -- Sound group check is paranoid but likely to be valid as to identify hat-sounds
100
117
  return descendant:IsA("Sound") and descendant.SoundGroup == nil
101
118
  end