Socket
Book a DemoInstallSign in
Socket

@rbxts-js/pretty-format

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

@rbxts-js/pretty-format

Upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/pretty-format

latest
Source
npmnpm
Version
3.13.2-ts.3
Version published
Weekly downloads
467
36.95%
Maintainers
1
Weekly downloads
 
Created
Source

pretty-format

Upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/pretty-format

Stringify any Luau value

  • Supports Luau builtins and Roblox Instances.
  • Can be extended with user defined plugins.

:pencil2: Notes

  • :warning: Our prettyFormat doesn't distinguish between Tables, Arrays, Objects, etc. and prints out all Lua table-like types as Table.
    • For example, an empty array is printed as Table {} and an array with values is printed as Table {1, 2, 3,}.
    • printComplexValue is reduced to just arrays and tables.
  • :x: Color formatting isn't supported so all related methods are omitted.
  • :hammer: Built-in plugins for prettyFormat are not implemented yet.
  • prettyFormat formats Roblox DateTime objects as a replacement for JS Date.
  • Formats using the Lua native string representations of primitives like nil, nan and inf over the JS null, NaN and Infinity. The tests are modified accordingly.
  • Formatting for any Javascript specific types in are omitted, Symbol, named Function, Error, Date, BigInt, etc.
  • getConfig is rewritten to avoid ternary operators. loop is rewritten with a for loop instead of an iterator.next().
  • Collections.lua deviates from upstream substantially since Lua only has tables. We only have two functions: printTableEntries for formatting key, value pairs and printListItems for formatting arrays.

FAQs

Package last updated on 13 May 2025

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