Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@spectacles/util
Advanced tools
Various utilities for interacting with Discord and using Spectacles.
encode
and decode
convenience functions for JSON de/serializing arbitrary data.
A Permissions
class with methods for dealing with Discord permissions.
FLAGS
: each individual Discord permission flag.ALL
: every permission flag OR'd togetherNONE
: 0constructor(bitfield: number = Permissions.NONE)
add(perms: number): this
: adds a bitfield to the permissionsremove(perms: number): this
: removes permissionshas(perms: number): this
: checks if permissions existapply(data: { guild: AvailableGuild, channel?: Channel, member?: GuildMember }): this
: applies guild and optionally channel and member permissions to the bitfield. After this method, the bitfield will represent the final permissions for the given guild & channel and/or member with appropriate overrides. Operates in accordance with Discord recommendations.isAdmin: boolean
: whether this bitfield contains the administrator flagclone(): Permissions
: create a new permissions instance from this bitfieldvalueOf(): number
: the bitfieldtoJSON(): string[]
: an array of readable strings representing the permissions in this bitfieldA Snowflake
class with methods for creating/inspecting Discord snowflakes. Requires BigInt support.
EPOCH: number
: the epoch to use for snowflakes (defaults to Discord's)constructor(bin: bigint | string = 0n)
createdAt: Date
: get/set when the snowflake was createdworkerID: number
: get/set the worker IDprocessID: number
: get/set the process IDincrement: number
: get/set the incrementvalueOf(): bigint
: the raw snowflakeFAQs
Spectacles utility methods
We found that @spectacles/util demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.