mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
NSEdoc cleanup.
1. The first paragraph of a function's NSEdoc is used as a short summary. Some of these were very long, so I split off a shorter summary. 2. Use asterisks (*) to denote bulletted lists, not 'o' 3. Wrap lines at 80 columns 4. a couple other spelling and formatting fixes
This commit is contained in:
@@ -81,8 +81,9 @@ local function escape(str)
|
||||
end
|
||||
|
||||
--- Makes a table be treated as a JSON Array when generating JSON
|
||||
-- A table treated as an Array has all non-number indices ignored.
|
||||
-- () param t a table to be treated as an array
|
||||
--
|
||||
-- A table treated as an Array has all non-number indices ignored.
|
||||
-- @param t a table to be treated as an array
|
||||
function make_array(t)
|
||||
local mt = getmetatable(t) or {}
|
||||
mt["json"] = "array"
|
||||
@@ -90,8 +91,9 @@ function make_array(t)
|
||||
end
|
||||
|
||||
--- Makes a table be treated as a JSON Object when generating JSON
|
||||
-- A table treated as an Object has all non-number indices ignored.
|
||||
-- () param t a table to be treated as an object
|
||||
--
|
||||
-- A table treated as an Object has all non-number indices ignored.
|
||||
-- @param t a table to be treated as an object
|
||||
function make_object(t)
|
||||
local mt = getmetatable(t) or {}
|
||||
mt["json"] = "object"
|
||||
@@ -99,8 +101,8 @@ function make_object(t)
|
||||
end
|
||||
|
||||
--- Checks what JSON type a variable will be treated as when generating JSON
|
||||
-- () param var a variable to inspect
|
||||
-- () return a string containing the JSON type. Valid values are "array",
|
||||
-- @param var a variable to inspect
|
||||
-- @return a string containing the JSON type. Valid values are "array",
|
||||
-- "object", "number", "string", "boolean", and "null"
|
||||
function typeof(var)
|
||||
local t = type(var)
|
||||
@@ -437,6 +439,7 @@ end
|
||||
return val
|
||||
end
|
||||
--- Parses json data into an object form
|
||||
--
|
||||
-- This is the method you probably want to use if you
|
||||
-- use this library from a script.
|
||||
--@param data a json string
|
||||
|
||||
Reference in New Issue
Block a user