@rbxts/input-categorizer 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -3,4 +3,4 @@ Observe the preferred input category of the player.
3
3
 
4
4
  ## Install
5
5
  Install with [wally](https://wally.run/):\
6
- `InputCategorizer = "shouxtech/input-categorizer@0.0.1"`
6
+ `InputCategorizer = "shouxtech/input-categorizer@1.0.3"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/input-categorizer",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Observe the preferred input category of the player.",
5
5
  "main": "src/init.lua",
6
6
  "scripts": {},
package/src/init.lua CHANGED
@@ -1,8 +1,9 @@
1
1
  --!strict
2
2
  local UserInputService = game:GetService('UserInputService');
3
3
 
4
- local dependencies = script.Parent.Parent;
5
- local Charm = require(dependencies:FindFirstChild('charm') or dependencies.Charm);
4
+ local isTypeScriptEnv = script.Name == 'src';
5
+ local dependencies = if isTypeScriptEnv then script.Parent.Parent else script.Parent;
6
+ local Charm = require(isTypeScriptEnv and dependencies.charm or dependencies.Charm);
6
7
 
7
8
  export type InputCategory = 'KeyboardAndMouse' | 'Gamepad' | 'Touch' | 'Unknown'
8
9