New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rbx-enum

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rbx-enum

Raw Enum access support for roblox-ts. This gives you access to things like the `Value` property on EnumItems and the `GetEnumItems` function of Enums.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

rbx-enum

Raw Enum access support for roblox-ts. This gives you access to things like the Value property on EnumItems and the GetEnumItems function of Enums.

The module exports three functions:

getEnumItem

Accepts a roblox-ts enum value and results in the raw EnumItem object which is typed as:

interface RbxEnumItem {
  Name: string
  Value: number
  EnumType: RbxEnum
}

Note: This function accepts a number because TypeScript sees enums as numbers. Attempting to pass a member of a non-Roblox enum or a number will result in a runtime error.

Example

print(getEnumItem(Enum.RenderPriority.Camera).Value) // 200

getEnumItems

Accepts a roblox-ts enum and results in an array of EnumItems (RbxEnumItem[] internally).

Example

getEnumItems(Enum.KeyCode).forEach(e => print(e.Name))

getEnums

Returns an array of all Roblox Enums (RbxEnum[] internally). RbxEnum is typed as:

type RbxEnum = { [index: string]: RbxEnumItem }

You can also call tostring on RbxEnum objects to get their human-readable name.

Keywords

FAQs

Package last updated on 18 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc