diff --git a/doc/output/json-formula-specification-2.0.0-beta.1.html b/doc/output/json-formula-specification-2.0.0-beta.1.html index 746ae936..4f75ff60 100644 --- a/doc/output/json-formula-specification-2.0.0-beta.1.html +++ b/doc/output/json-formula-specification-2.0.0-beta.1.html @@ -4,7 +4,7 @@ - +
The intended audience are both end-users of json-formula as well as implementors; the contents are then both a user guide and a specification.
+The intended audience are both end-users of json-formula as well as implementers; the contents are then both a user guide and a specification.
In the specification, examples are shown through the use of a search function. The syntax for this function is:
In the specification, examples are shown through the use of a search function called eval. The syntax for this function is:
There is an additional type that is not a JSON type that’s used in -json-formula functions:
+There is an additional type that is not a JSON type that’s used in json-formula functions:
Functions are evaluated in applicative order:
- Each argument must be an expression
-- Each argument expression must be evaluated before evaluating the
-function
+- Each argument expression must be evaluated before evaluating the function
- Each argument expression result must be coerced to the expected type
- If coercion is not possible, a TypeError error is raised
- The function is then called with the evaluated function arguments.
Generates a lower-case string of the input string using
-locale-specific mappings. e.g. Strings with German letter ß (eszett) can
-be compared to "ss"
Generates a lower-case string of the input string
+using locale-specific mappings. e.g. Strings with German letter ß
+(eszett) can be compared to “ss”
Finds the next highest integer value of the argument num
-by rounding up if necessary. i.e. ceil() rounds toward positive
+
Finds the next highest integer value of the argument
+num by rounding up if necessary. i.e. ceil() rounds toward positive
infinity.
Determines if the given subject contains search. If
-subject is an array, this function returns true if one of the elements
-in the array is equal to the search value. If subject is a string,
-return true if the string contains the search value.
Determines if the given subject contains search.
+If subject is an array, this function returns true if one of the
+elements in the array is equal to the search value. If subject
+is a string, return true if the string contains the search value.
y the number of whole years between start_date and end_date
y the number of whole years between start_date and
+end_date
m the number of whole months between start_date and end_date.
m the number of whole months between start_date and
+end_date.
d the number of days between start_date and end_date
ym the number of whole months between start_date and end_date
-after subtracting whole years.
ym the number of whole months between start_date and
+end_date after subtracting whole years.
yd the number of days between start_date and end_date, assuming
-start_date and end_date were no more than one year apart
yd the number of days between start_date and end_date,
+assuming start_date and end_date were no more than one year
+apart
name
string | integer
The name (or index position) of the
-elements to find. If name is a string, search for nested objects with
-a matching key. If name is an integer, search for nested arrays with a
-matching index.
name is a string, search for nested objects
+with a matching key. If name is an integer, search for nested arrays
+with a matching index.
@@ -3658,8 +3657,8 @@ boolean | Array.<boolean> - true if the suffix value
-is at the end of the subject
boolean | Array.<boolean> - true if the suffix
+value is at the end of the subject
Returns an array of [key, value] pairs from an object or
-array. The fromEntries() function may be used to convert an array to
-an object.
Returns an array of [key, value] pairs from an object
+or array. The fromEntries() function may be used to convert an array
+to an object.
Return constant boolean false value. Expressions may also
-use the JSON literal: `false`
\'false\'
integer | Array.<integer>
0
zero-based position to
-start searching. If specified, start must be greater than or equal to
-0
start must be greater than or equal
+to 0
@@ -3974,8 +3973,8 @@ Calculates the next lowest integer value of the argument
-num by rounding down if necessary. i.e. floor() rounds toward negative
-infinity.
num by rounding down if necessary. i.e. floor() rounds toward
+negative infinity.
Returns an object by transforming a list of key-value
pairs into an object. fromEntries() is the inverse operation of
-entries(). If the nested arrays are not of the form: [key, value]
-(where key is a string), an error will be thrown.
entries(). If the nested arrays are not of the form:
+[key, value] (where key is a string), an error will be thrown.
name
string | integer
The name (or index position) of the
-element to find. if subject is an array, name must be an integer; if
-subject is an object, name must be a string.
subject is an array, name must be an
+integer; if subject is an object, name must be a string.
@@ -4307,8 +4306,8 @@ Return one of two values result1 or result2, depending
-on the condition
Return one of two values result1 or result2,
+depending on the condition
length
integer
The number of code points or elements to return from
-the string or array. If greater then the length of subject the length
-of the subject is used.
subject the
+length of the subject is used.
@@ -5281,8 +5280,8 @@ number | Array.<number> - Computes the remainder of
-dividend/divisor. If dividend is negative, the result will also be
-negative. If dividend is zero, an error is thrown.
dividend/divisor. If dividend is negative, the result will
+also be negative. If dividend is zero, an error is thrown.
Finds the first argument that does not resolve to null.
-This function accepts one or more arguments, and will evaluate them in
-order until a non-null argument is encountered. If all arguments values
-resolve to null, then return a null value.
Finds the first argument that does not resolve to
+null. This function accepts one or more arguments, and will evaluate
+them in order until a non-null argument is encountered. If all arguments
+values resolve to null, then return a null value.
Return constant null value. Expressions may also use the
-JSON literal: `null`
\'null\'
functionName
string
Name of the function to register. functionName
-must begin with an underscore or uppercase letter and follow the regular
-expression pattern:
-^[_A-Z][_a-zA-Z0-9$]*$
Name of the function to register.
+functionName must begin with an underscore or uppercase letter and
+follow the regular expression pattern:
+{caret}{startsb}_A-Z{endsb}{startsb}_a-zA-Z0-9${endsb}{asterisk}$
expr
functionName
string
Name of the function to register. functionName
-must begin with an underscore or uppercase letter and follow the regular
-expression pattern:
-^[_A-Z][_a-zA-Z0-9$]*$
Name of the function to register.
+functionName must begin with an underscore or uppercase letter and
+follow the regular expression pattern:
+{caret}{startsb}_A-Z{endsb}{startsb}_a-zA-Z0-9${endsb}{asterisk}$
expr
length
integer
number of code points to be replaced. If start
-length is greater than the length of subject, all text past start
-will be replaced.
length is greater than the length of subject, all text past
+start will be replaced.
replacement
any
Replacement to insert at the start index. If
-subject is an array, and replacement is an array, the replacement
-array elements will be inserted into the subject array. If subject
-is an array and replacement is not an array, the replacement will be
-inserted as a single element in subject If subject is a string, the
-replacement will be coerced to a string.
subject is an array, and replacement is an array, the
+replacement array elements will be inserted into the subject
+array. If subject is an array and replacement is not an array, the
+replacement will be inserted as a single element in subject If
+subject is a string, the replacement will be coerced to a
+string.
If precision is greater than zero, round to the specified number of
-decimal places.
If precision is greater than zero, round to the specified number
+of decimal places.
If precision is 0, round to the nearest integer.
If precision is less than 0, round to the left of the decimal point.
If precision is less than 0, round to the left of the decimal
+point.
Perform a wildcard search. The search is case-sensitive
-and supports two forms of wildcards: * finds a sequence of
-code points and ? finds a single code point. To use * or
-? or \ as text values, precede them with an escape
-(\) character. Note that the wildcard search is not greedy.
-e.g. search("a*b", "abb") will return [0, "ab"] Not
-[0, "abb"]
{asterisk} finds a sequence of
+code points and ? finds a single code point. To use {asterisk}
+or ? or {backslash} as text values, precede them with an escape
+({backslash}) character. Note that the wildcard search is not
+greedy. e.g. search("a{asterisk}b", "abb") will return [0, "ab"]
+Not [0, "abb"]
number | Array.<number> - The sine of angle, between
--1 and 1, inclusive
number | Array.<number> - The sine of angle,
+between -1 and 1, inclusive
Calculates standard deviation based on the entire
-population given as arguments. stdevpA assumes that its arguments are
-the entire population. If your data represents a sample of the
+population given as arguments. stdevpA assumes that its arguments
+are the entire population. If your data represents a sample of the
population, then compute the standard deviation using
[_stdevA]. Nested arrays are flattened. Null values are
ignored. All other parameters are converted to number. If conversion to
@@ -7032,10 +7033,10 @@
Generates a string from the input text, with text old
-replaced by text new (when searching from the left). If there is no
-match, or if old has length 0, text is returned unchanged. Note that
-old and new may have different lengths.
Generates a string from the input text, with text
+old replaced by text new (when searching from the left). If
+there is no match, or if old has length 0, text is returned
+unchanged. Note that old and new may have different lengths.
new
string | Array.<string>
The text to replace old with. If
-new is an empty string, then occurrences of old are removed from
-text.
The text to replace old with.
+If new is an empty string, then occurrences of old are removed
+from text.
[which]
integer | Array.<integer>
The zero-based occurrence of
-old text to replace with new text. If which parameter is omitted,
-every occurrence of old is replaced with new.
old text to replace with new text. If which parameter is
+omitted, every occurrence of old is replaced with new.
Return constant boolean true value. Expressions may also
-use the JSON literal: `true`
\'true\'
index
string | integer
if subject is an object, index must
-be a string indicating the key name to search for. If subject is an
-array, then index must be an integer indicating the offset into the
-array
if subject is an object, index
+must be a string indicating the key name to search for. If subject
+is an array, then index must be an integer indicating the offset into
+the array