ProductPromotion
Logo

Lua

made by https://0x3d.site

GitHub - harningt/luajson: JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible.
JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible. - harningt/luajson
Visit Site

GitHub - harningt/luajson: JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible.

GitHub - harningt/luajson: JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible.

LuaJSON

JSON Parser/Constructor for Lua

Author:

Thomas Harning Jr. [email protected]

Source code:

http://repo.or.cz/luajson

Bug reports:

http://github.com/harningt/luajson [email protected]

Requirements

Lua 5.1, 5.2, 5.3, LuaJIT 2.0, or LuaJIT 2.1 LPeg (Tested with 0.7, 0.8, 0.9, 0.10, 0.12rc2, 1.0.1) For regressionTest: lfs (Tested with 1.6.3)

For lunit-tests:

lunitx >= 0.8

NOTE:

LPeg 0.11 may not work - it crashed during my initial tests, it is not in the test matrix.

Lua versions tested recently:

  • Lua 5.1.5
  • Lua 5.2.4
  • Lua 5.3.4
  • LuaJIT-2.0.4
  • LuaJIT-2.1.0-beta2

License

All-but tests: MIT-style, See LICENSE for details tests/*: Public Domain / MIT - whichever is least restrictive

Module/Function overview:

json.encode (callable module referencing json.encode.encode)

encode ( value : ANY-valid )

Takes in a JSON-encodable value and returns the JSON-encoded text Valid input types:

  • table
  • array-like table (spec below)
  • string
  • number
  • boolean
  • 'null' - represented by json.util.null

Table keys (string,number,boolean) are encoded as strings, others are erroneus Table values are any valid input-type Array-like tables are converted into JSON arrays... Position 1 maps to JSON Array position 0

json.decode (callable module referencing json.decode.decode)

decode (data : string, strict : optional boolean)

Takes in a string of JSON data and converts it into a Lua object If 'strict' is set, then the strict JSON rule-set is used

json.util

Useful utilities

null

Reference value to represent 'null' in a well-defined way to allow for null values to be inserted into an array/table

undefined

Reference value to represent 'undefined' in a well-defined way to allow for undefined values to be inserted into an array/table.

IsArray (t : ANY)

Checks if the passed in object is a plain-old-array based on whether or not is has the LuaJSON array metatable attached or the custom __is_luajson_array metadata key stored.

InitArray(t: table)

Sets the 'array' marker metatable to guarantee the table is represented as a LuaJSON array type.

isCall (t : ANY)

Checks if the passed in object is a LuaJSON call object.

buildCall(name : string, ... parameters)

Builds a call object with the given name and set of parameters. The name is stored in the 'name' field and the parameters in the 'parameters' field as an array.

Additional Utilities

clone (t : table)

Shallow-clones a table by iterating using pairs and assigning.

___printValue (tab : ANY, name : string)

recursively prints out all object values - if duplicates found, reference printed

___merge (t : table, ... : tables)

Shallow-merges a sequence of tables onto table t by iterating over each using pairs and assigning.

Internal Utilities - Not to Use

decodeCall doOptionMerge

Attribution

parsing test suite from JSON_checker project of http://www.json.org/ No listed license for these files in their package.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory