Noir
  • πŸšΆβ€β™‚οΈIntro
  • πŸ“Tutorials
    • πŸŽ“Starting Noir
    • πŸ“–Libraries
    • πŸ–₯️Services
    • ❔Libraries VS Services
    • πŸ’¬Callbacks
    • πŸ’₯Classes
    • πŸ”ŽDebugging
  • πŸ“šExamples
  • β˜„οΈAPI Reference
    • Bootstrapper
    • Built-Ins
      • Classes
        • AITarget
        • Body
        • Command
        • Connection
        • Event
        • HTTPRequest
        • HTTPResponse
        • Library
        • Message
        • Object
        • Player
        • Service
        • Task
        • TickIterationProcess
        • Tracker
        • Vehicle
        • Widgets
          • MapLabelWidget
          • MapLineWidget
          • MapObjectWidget
          • PopupWidget
          • ScreenPopupWidget
          • Widget
      • Libraries
        • Base64
        • Dataclasses
        • Deprecation
        • Events
        • HTTP
        • JSON
        • Logging
        • Matrix
        • Number
        • String
        • Table
      • Services
        • CommandService
        • GameSettingsService
        • HTTPService
        • MessageService
        • NotificationService
        • ObjectService
        • PlayerService
        • TaskService
        • TPSService
        • UIService
        • VehicleService
    • Callbacks
    • Class
    • Classes
    • Debugging
    • Definition
    • Libraries
    • Noir
    • Services
    • TypeChecking
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
Edit on GitHub
  1. API Reference
  2. Built-Ins
  3. Libraries

JSON

Noir.Libraries.JSON: NoirLibrary

A library containing helper methods to serialize Lua objects into JSON and back.

This code is from https://gist.github.com/tylerneylon/59f4bcf316be525b30ab


Noir.Libraries.JSON._Null: table

Represents a null value.

You do not need to reference this. Null values will just be nil in a decoded JSON object.

Used internally. Do not use this in your code.


Noir.Libraries.JSON:KindOf(obj)

Returns the type of the provided object.

Used internally. Do not use in your code.

Parameters

  • obj: any

Returns

  • "nil"|"boolean"|"number"|"string"|"table"|"function"|"array"


Noir.Libraries.JSON:EscapeString(str)

Escapes a string for JSON.

Used internally. Do not use in your code.

Parameters

  • str: string

Returns

  • string


Noir.Libraries.JSON:SkipDelim(str, pos, delim, errIfMissing)

Finds the point where a delimiter is and simply returns the point after.

Used internally. Do not use in your code.

Parameters

  • str: string

  • pos: integer

  • delim: string

  • errIfMissing: boolean|nil

Returns

  • integer

  • boolean


Noir.Libraries.JSON:ParseStringValue(str, pos, val)

Parses a string.

Used internally. Do not use in your code.

Parameters

  • str: string

  • pos: integer

  • val: string|nil

Returns

  • string

  • integer


Noir.Libraries.JSON:ParseNumberValue(str, pos)

Parses a number.

Used internally. Do not use in your code.

Parameters

  • str: string

  • pos: integer

Returns

  • integer

  • integer


Noir.Libraries.JSON:Encode(obj, asKey)

Encodes a Lua object as a JSON string.

Parameters

  • obj: table|number|string|boolean|nil

  • asKey: boolean|nil

Returns

  • string


Noir.Libraries.JSON:Decode(str, pos, endDelim)

Decodes a JSON string into a Lua object.

Parameters

  • str: string

  • pos: integer|nil

  • endDelim: string|nil

Returns

  • any

  • integer

PreviousHTTPNextLogging

Last updated 2 months ago

β˜„οΈ