affinirum 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +174 -126
  2. package/dst/Affinirum.d.ts +1 -1
  3. package/dst/Affinirum.js +43 -47
  4. package/dst/Constants.js +2 -0
  5. package/dst/ParserState.js +2 -2
  6. package/dst/atom/ArrayAtom.d.ts +3 -3
  7. package/dst/atom/ArrayAtom.js +14 -13
  8. package/dst/atom/FunctionAtom.d.ts +1 -1
  9. package/dst/atom/FunctionAtom.js +11 -9
  10. package/dst/atom/ObjectAtom.d.ts +3 -3
  11. package/dst/atom/ObjectAtom.js +14 -18
  12. package/dst/atom/PrimitiveAtom.js +3 -3
  13. package/dst/cjs/Affinirum.js +43 -47
  14. package/dst/cjs/Constants.js +2 -0
  15. package/dst/cjs/ParserState.js +2 -2
  16. package/dst/cjs/atom/ArrayAtom.js +14 -13
  17. package/dst/cjs/atom/FunctionAtom.js +11 -9
  18. package/dst/cjs/atom/ObjectAtom.js +14 -18
  19. package/dst/cjs/atom/PrimitiveAtom.js +3 -3
  20. package/dst/cjs/native/Boolean.js +5 -2
  21. package/dst/cjs/native/Buffer.js +43 -11
  22. package/dst/cjs/native/Float.js +2 -5
  23. package/dst/cjs/native/Integer.js +8 -5
  24. package/dst/cjs/native/String.js +32 -15
  25. package/dst/cjs/native/Timestamp.js +25 -11
  26. package/dst/cjs/native/Unknown.js +10 -10
  27. package/dst/cjs/native/notation/AN.js +4 -4
  28. package/dst/cjs/native/notation/IP.js +239 -0
  29. package/dst/cjs/native/notation/JSON.js +3 -3
  30. package/dst/cjs/node/ArrayNode.js +7 -3
  31. package/dst/cjs/node/{FunctionNode.js → CallNode.js} +5 -4
  32. package/dst/cjs/node/ObjectNode.js +4 -2
  33. package/dst/native/Boolean.js +5 -2
  34. package/dst/native/Buffer.d.ts +3 -1
  35. package/dst/native/Buffer.js +41 -10
  36. package/dst/native/Float.d.ts +1 -1
  37. package/dst/native/Float.js +2 -5
  38. package/dst/native/Integer.d.ts +1 -1
  39. package/dst/native/Integer.js +8 -5
  40. package/dst/native/String.d.ts +2 -2
  41. package/dst/native/String.js +32 -15
  42. package/dst/native/Timestamp.d.ts +3 -3
  43. package/dst/native/Timestamp.js +25 -11
  44. package/dst/native/Unknown.js +11 -11
  45. package/dst/native/notation/AN.js +4 -4
  46. package/dst/native/notation/IP.d.ts +6 -0
  47. package/dst/native/notation/IP.js +236 -0
  48. package/dst/native/notation/JSON.js +3 -3
  49. package/dst/node/ArrayNode.d.ts +2 -1
  50. package/dst/node/ArrayNode.js +7 -3
  51. package/dst/node/{FunctionNode.d.ts → CallNode.d.ts} +1 -1
  52. package/dst/node/{FunctionNode.js → CallNode.js} +3 -2
  53. package/dst/node/ObjectNode.d.ts +1 -1
  54. package/dst/node/ObjectNode.js +4 -2
  55. package/package.json +1 -1
package/README.md CHANGED
@@ -76,24 +76,28 @@ Whitespace characters are ignored.
76
76
  - **array** for ordered sequences of values
77
77
  - **object** for collections of named values
78
78
  - **function** for built-in, injected or script-defined subroutines
79
-
80
- Type modifier **?** can be used to make any type optional (nullable).
81
- <br>Examples: *float?*, *array?*
82
-
83
- Unknown or variant type is declared as **??**.
79
+ - **??** for unknown or variant type
80
+ - Type grouping: **(...)**
81
+ - Type union: **|**
82
+ - Type optionality modifier: **?**
84
83
 
85
84
  ### Definitions
86
- - Value grouping: **(...)**
87
85
  - Unit grouping: **{...}**
88
- - Value and unit separator: **,**
86
+ - Unit separator: **;**
87
+ - Value grouping: **(...)**
88
+ - Value separator: **,**
89
89
  - Array element at numeric index, or object property by string key: **[]**
90
90
  - Object property by string key or method function call: **.**
91
91
  - Array definiton: **[item1, ...]**
92
92
  - Object definition: **[propery1-key: property1-value, ...]**
93
- - Subroutine definition: **~return-type(argument1-name: argument1-type, ...) {...}**
93
+ - Subroutine definition: **~(argument1-name: argument1-type, ...):return-type {...}**
94
94
  - Conditional switch definition, returns first or second value if prefix is true or false: **if condition {value1} else {value2}**,
95
- and if **else** clause is ommited second value deemed null
95
+ and if **else** clause is ommited second value deemed *null*
96
96
  - Loop definition, iteratively evaluates suffix while prefix is true, returns last evaluated value: **while condition {...}**
97
+ - Stop iteration: **stop**
98
+ - Proceed to next iteration: **next**
99
+ - Function return operator: **~>value**
100
+ - Execution exit operator: **=>value**
97
101
 
98
102
  ### Operators
99
103
  - Boolean negation (Logical NOT): **!**
@@ -112,8 +116,8 @@ Unknown or variant type is declared as **??**.
112
116
  - Arithmetic division: **/**
113
117
  - Arithmetic remainder: **%**
114
118
  - Exponentiation operator: **^**
115
- - Access operator: **.**
116
- - Presence operator: **?**
119
+ - Property access operator: **.**
120
+ - Property existance operator: **?**
117
121
  - Assignment: **=**
118
122
  - Boolean disjunction (Logical OR) assignment: **|=**
119
123
  - Boolean conjunction (Logical AND) assignment: **&=**
@@ -123,166 +127,210 @@ Unknown or variant type is declared as **??**.
123
127
  - Arithmetic division assignment: **/=**
124
128
  - Arithmetic remainder assignment: **%=**
125
129
 
126
- ### Predefined Constants
130
+ ### Native Global Functions
131
+
132
+ Native conversions use the following null handling:
133
+
134
+ - `Format` returns an empty string for a **null**.
135
+ - `Encode` returns a zero-length buffer for a **null**.
136
+ - `Decode` and `Parse` return **null** when their input value is **null**.
137
+
138
+ Empty strings and zero-length buffers remain ordinary values; they are not serialized null markers.
139
+ Invalid non-null inputs are function-specific and may raise an evaluation error.
127
140
 
128
141
  #### Boolean
129
- - **boolean Boolean.Or(values:...array)** — Boolean disjunction
130
- - **boolean Boolean.And(values: ...array)** — Boolean conjunction
131
- - **boolean Boolean.Not(value: boolean)** — Boolean negation
132
- - **boolean? Boolean.Decode(value: buffer, offset: integer?)** — Decode boolean from buffer
133
- - **boolean? Boolean.Parse()** — Parse boolean from string
142
+ - **Boolean.Or(values: ...(boolean | array)):boolean** — Boolean disjunction of booleans and arrays of booleans
143
+ - **Boolean.And(values: ...(boolean | array)):boolean** — Boolean conjunction of booleans and arrays of booleans
144
+ - **Boolean.Not(value: boolean):boolean** — Boolean negation
145
+ - **Boolean.Decode(value: buffer?, offset: integer?):boolean?** — Decode a byte at the optional offset; missing or out-of-range input returns **void**
146
+ - **Boolean.Parse(value: string?):boolean?** — Parse case-insensitive `true` or `false`; other values return **void**
134
147
 
135
148
  #### Timestamp
136
- - **timestamp Timestamp.Now()** — Current date and time
137
- - **timestamp Timestamp.Epoch(value: float | integer, epoch: timestamp?)** — Create timestamp from milliseconds
138
- - **timestamp? Timestamp.Decode(value: buffer, offset: integer?)** — Decode timestamp from buffer
139
- - **timestamp? Timestamp.Parse(value: string)** — Parse string to timestamp
149
+ - **Timestamp.Now():timestamp** — Current date and time
150
+ - **Timestamp.Epoch(value: float | integer, epoch: timestamp?):timestamp** — Create timestamp from milliseconds
151
+ - **Timestamp.Decode(value: buffer?, encoding: string?, offset: integer?):timestamp?** — Decode a timestamp using `i64` (default) or `i64le`
152
+ - **Timestamp.Parse(value: string?):timestamp?** — Parse a string as a timestamp
140
153
 
141
154
  #### Float
142
155
  - **Float.NAN** — Not-a-number
143
156
  - **Float.PositiveInfinity** — Positive infinity
144
157
  - **Float.NegativeInfinity** — Negative infinity
145
158
  - **Float.Epsilon** — Smallest positive float
146
- - **float Float.Sum(values: ...array)** — Numeric sum
147
- - **float Float.Min(values: ...array)** — Numeric minimum
148
- - **float Float.Max(values: ...array)** — Numeric maximum
149
- - **float Float.Exponent()** — Exponent
150
- - **float Float.Logarithm()** — Logarithm
151
- - **float Float.Abs()** — Absolute value
152
- - **float Float.Ceil()** — Ceil
153
- - **float Float.Floor()** — Floor
154
- - **float Float.Round()** — Rounded value
155
- - **float Float.Truncate()** — Truncated value
156
- - **float Float.Random(exclusiveTo: float)** — Random float up to value
157
- - **float? Float.Decode(value: buffer, encoding: string, offset: integer?)** — Decode float from buffer
158
- - **float? Float.Parse(value: string)** — Parse float from string
159
+ - **Float.Sum(values: ...(float | array)):float** — Numeric sum
160
+ - **Float.Min(values: ...(float | array)):float** — Numeric minimum
161
+ - **Float.Max(values: ...(float | array)):float** — Numeric maximum
162
+ - **Float.Exponent(value: float):float** — Natural exponential
163
+ - **Float.Logarithm(value: float):float** — Natural logarithm
164
+ - **Float.Abs(value: float):float** — Absolute value
165
+ - **Float.Ceil(value: float):float** — Smallest integer greater than or equal to the value
166
+ - **Float.Floor(value: float):float** — Largest integer less than or equal to the value
167
+ - **Float.Round(value: float):float** — Rounded value
168
+ - **Float.Truncate(value: float):float** — Integer portion of the value
169
+ - **Float.Random(exclusiveTo: float):float** — Random float up to value
170
+ - **Float.Decode(value: buffer?, encoding: string?, offset: integer?):float?** — Decode using `f64` (default), `f64le`, `f32`, or `f32le`
171
+ - **Float.Parse(value: string?):float?** — Parse a string as a float
159
172
 
160
173
  #### Integer
161
- - **integer Integer.Sum(values: ...array)** — Numeric sum
162
- - **integer Integer.Min(values: ...array)** — Numeric minimum
163
- - **integer Integer.Max(values: ...array)** — Numeric maximum
164
- - **integer Integer.Random(exclusiveTo: integer)** — Random integer up to value
165
- - **integer? Integer.Decode(value: buffer, encoding: string, offset: integer?)** — Decode integer from buffer
166
- - **integer? Integer.Parse(value: string)** — Parse integer from string
174
+ - **Integer.Sum(values: ...(integer | array)):integer** — Numeric sum
175
+ - **Integer.Min(values: ...(integer | array)):integer** — Numeric minimum
176
+ - **Integer.Max(values: ...(integer | array)):integer** — Numeric maximum
177
+ - **Integer.Random(exclusiveTo: integer):integer** — Random integer up to value
178
+ - **Integer.Decode(value: buffer?, encoding: string?, offset: integer?):integer?** — Decode using signed `i8`, `i16`, `i16le`, `i32`, `i32le`, `i64` (default), or `i64le`, or unsigned `n8`, `n16`, `n16le`, `n32`, `n32le`, `n64`, or `n64le`
179
+ - **Integer.Parse(value: string?):integer?** — Parse a string as an integer
167
180
 
168
181
  #### String
169
- - **string String.Random(length: integer)** — Random alphanumeric string
170
- - **string? String.Decode(value: buffer, encoding: string?, offset: integer?, length: integer?)** — Decode buffer to string
182
+ - **String.Alphanum(value: string):string** — Keep only ASCII letters and digits
183
+ - **String.Random(length: integer):string** — Random alphanumeric string
184
+ - **String.Decode(value: buffer?, encoding: string?, offset: integer?, length: integer?):string?** — Decode using `utf8` (default), `sbcs`, `ucs2`, or `ucs2le`
171
185
 
172
186
  #### Buffer
173
- - **buffer Buffer.Random(length: integer)** — Buffer of given length filled with random bytes
174
- - **buffer? Buffer.Parse(value: string)** — Parse buffer from hexadecimal string
187
+ - **Buffer.Random(length: integer):buffer** — Buffer of given length filled with random bytes
188
+ - **Buffer.Parse(value: string?):buffer?** — Parse a hexadecimal string as a buffer
175
189
 
176
190
  #### Array
177
- - **array Array.Join(values: ...array)** — Join arrays of any depths into a single array
178
- - **array Array.Range(inclusiveFrom: integer, exclusiveTo: integer)** — New array filled with integers in range
179
- - **array Array.Unique()** — Array of unique values
180
- - **array Array.Intersection(a1: array, a2: array)** — Common values from two arrays
181
- - **array Array.Difference(a1: array, a2: array)** — Symmetrical difference between arrays
191
+ - **Array.Join(values: ...array):array** — Join arrays of any depths into a single array
192
+ - **Array.Range(inclusiveFrom: integer, exclusiveTo: integer):array** — New array filled with integers in range
193
+ - **Array.Unique(value: array):array** — Array of unique values
194
+ - **Array.Intersection(a1: array, a2: array):array** — Common values from two arrays
195
+ - **Array.Difference(a1: array, a2: array):array** — Symmetrical difference between arrays
182
196
 
183
197
  #### Object
184
- - **object Object.Merge(values: ...array)** — Merge multiple objects
198
+ - **Object.Merge(values: ...(object | array)):object** — Merge objects and arrays of objects
185
199
 
186
200
  #### AN
187
- - **string AN.Format(value: ??, whitespace: string?)** — Format string as AN
201
+ - **AN.Format(value: ??, whitespace: string?):string** — Format a value as AN notation
188
202
 
189
203
  #### JSON
190
- - **string JSON.Format(value: void | boolean | float | string | array | object, whitespace: string?)** — Format as JSON string
191
- - **void | boolean | float | string | array | object JSON.Parse(value: string)** — Parse JSON-formatted string
204
+ - **JSON.Format(value: (void | boolean | timestamp | float | integer | string | array | object), whitespace: string?):string** — Format a value as JSON
205
+ - **JSON.Parse(value: string?):(void | boolean | timestamp | float | integer | string | array | object)** — Parse a JSON-formatted string; standard JSON values are not revived as timestamps or integers
192
206
 
207
+ #### IP
208
+ - **IP.Match(values: array, search: ...(string | array)):boolean** — Check whether any searched IPv4 or IPv6 address belongs to the supplied addresses or CIDR ranges
209
+ - **IP.Encode(value: string?):buffer** — Encode an IPv4, IPv6, or CIDR string as a network-byte-order buffer; malformed or **void** input returns a zero-length buffer
210
+ - **IP.Decode(value: buffer?):string?** — Decode a 4-, 5-, 16-, or 17-byte buffer as canonical IPv4, IPv6, or CIDR notation; malformed or **void** input returns **void**
193
211
 
194
- ### Predefined Functions
212
+ ### Native Method Functions
195
213
 
196
214
  #### General Functions
197
- - **?? ??.Coalesce(otherwise: ??)** — Null coalescence
198
- - **boolean ??.Equal(value: ??)** — Equals to
199
- - **boolean ??.Unequal(value: ??)** — Not equals to
200
- - **buffer ??.Encode(encoding: string?)** — Encode value to buffer
201
- - **string ??.Format(formatting: integer? | string?)** — Format value to string
215
+ - **??.Coalesce(otherwise: ??):??** — Null coalescence
216
+ - **??.Equal(value: ??):boolean** — Equals to
217
+ - **??.Unequal(value: ??):boolean** — Not equals to
218
+ - **(boolean | buffer | function).Encode():buffer** — Encode value to buffer
219
+ - **(void | timestamp | float | integer | string | array | object).Encode(encoding: string?):buffer** — Encode a value; defaults are `i64` for timestamps and integers, `f64` for floats, and `utf8` for strings
220
+ - **(boolean | string | function).Format():string** — Format value to string
221
+ - **(void | timestamp | float | integer | buffer | array | object).Format(formatting: string?):string** — Format a value; buffers use `hex` by default and also support `base64`
202
222
 
203
223
  #### Aggregable Functions
204
- - **float | integer | buffer | string | array float | integer | buffer | string | array.Add(values: ...array)** — Add or concatenate values
224
+ - **float.Add(value: integer):float** — Add an integer
225
+ - **integer.Add(value: float):float** — Add a float
226
+ - **integer.Add(value: integer):integer** — Add an integer
227
+ - **buffer.Add(value: buffer):buffer** — Concatenate buffers
228
+ - **string.Add(value: string):string** — Concatenate strings
229
+ - **array.Add(value: array):array** — Concatenate arrays
205
230
 
206
231
  #### Array Functions
207
- - **?? array.First(condition: function)** — First item satisfying condition
208
- - **?? array.Last(condition: function)** — Last item satisfying condition
209
- - **integer array.FirstIndex(condition: function)** — First index satisfying condition
210
- - **integer array.LastIndex(condition: function)** — Last index satisfying condition
211
- - **boolean array.Every(condition: function)** — All items satisfy condition
212
- - **boolean array.Any(condition: function)** — Any item satisfies condition
213
- - **array array.Reverse()** — Reversed array
214
- - **array array.Flatten(depth: integer = 1)** — Flatten array
215
- - **array array.Derive(transformation: function)** — Derived array
216
- - **array array.Filter(condition: function)** — Filtered array
217
- - **?? array.Reduce(reducer: function)** — Reduced value
218
- - **object array.Compose(generator: function)** — Compose object from array
219
- - **array array.Prepend(items: ...array)** — Prepend items
220
- - **array array.Append(items: ...array)** — Append items
232
+ - **array.First(condition: function):??** — First item satisfying condition
233
+ - **array.Last(condition: function):??** — Last item satisfying condition
234
+ - **array.FirstIndex(condition: function):integer?** — First index satisfying condition, or **void** if none does
235
+ - **array.LastIndex(condition: function):integer?** — Last index satisfying condition, or **void** if none does
236
+ - **array.Every(condition: function):boolean** — All items satisfy condition
237
+ - **array.Any(condition: function):boolean** — Any item satisfies condition
238
+ - **array.Reverse():array** — Reversed array
239
+ - **array.Flatten(depth: integer = 1):array** — Flatten array
240
+ - **array.Derive(transformation: function):array** — Derived array
241
+ - **array.Filter(condition: function):array** — Filtered array
242
+ - **array.Reduce(reducer: function, initial: ?? = void):??** — Reduced value
243
+ - **array.Compose(generator: function):object** — Compose object from array
244
+ - **array.Prepend(items: ...??):array** — Prepend items
245
+ - **array.Append(items: ...??):array** — Append items
221
246
 
222
247
  #### Buffer Functions
223
- - **buffer buffer.Byte(pos: integer)** — Byte at position
224
- - **string Buffer.FormatBuffer(value: buffer)** — Hexadecimal string from buffer
248
+ - **buffer.Byte(pos: integer):buffer?** — Byte at position, or **void** when unavailable
225
249
 
226
250
  #### Enumerable Functions
227
- - **buffer | string | array.Slice(start: integer?, end: integer?)** — Slice section
228
- - **buffer | string | array.Splice(start: integer, remove: integer, inject: ...array)** — Splice section
229
- - **buffer | string | array.Inject(start: integer, inject: ...array)** — Inject section
251
+ - **buffer.Slice(start: integer?, end: integer?):buffer** — Slice section
252
+ - **string.Slice(start: integer?, end: integer?):string** — Slice section
253
+ - **array.Slice(start: integer?, end: integer?):array** — Slice section
254
+ - **buffer.Splice(start: integer, remove: integer, inject: ...array):buffer** — Splice section
255
+ - **string.Splice(start: integer, remove: integer, inject: ...array):string** — Splice section
256
+ - **array.Splice(start: integer, remove: integer, inject: ...array):array** — Splice section
257
+ - **buffer.Inject(start: integer, inject: ...array):buffer** — Inject section
258
+ - **string.Inject(start: integer, inject: ...array):string** — Inject section
259
+ - **array.Inject(start: integer, inject: ...array):array** — Inject section
230
260
 
231
261
  #### Iterable Functions
232
- - **integer buffer | string | array | object.Length()** — Get length
233
- - **boolean buffer | string | array | object.Contains(search: buffer | string | ??, startPos: integer?, ignoreCaseSpaceEtc: boolean?)** — Substring check
234
- - **?? void | array | object.At(index: integer | string)** — Access item in array or object by index or key
235
- - **?? void | array | object.Has(index: integer | string)** — Identify if array or object has index or key
262
+ - **(buffer | string | array | object).Length():integer** — Get length
263
+ - **buffer.Contains(search: buffer, startPos: integer?):boolean** — Check if buffer contains another buffer
264
+ - **string.Contains(search: string, startPos: integer?, ignoreCaseSpaceEtc: boolean?):boolean** — Check if string contains another string
265
+ - **array.Contains(search: ??, startPos: integer?):boolean** — Check if array contains value
266
+ - **object.Contains(search: ??):boolean** — Check if object contains value
267
+ - **array.At(index: integer):??** — Access item in array by index
268
+ - **object.At(index: string):??** — Access item in object by key
269
+ - **array.Has(index: integer):boolean** — Identify if array has index
270
+ - **object.Has(index: string):boolean** — Identify if object has key
236
271
 
237
272
  #### Number Functions
238
- - **boolean float | integer.GreaterThan(value)** — Greater than
239
- - **boolean float | integer.LessThan(value)** — Less than
240
- - **boolean float | integer.GreaterOrEqual(value)** — Greater or equal
241
- - **boolean float | integer.LessOrEqual(value)** — Less or equal
242
- - **float | integer float | integer.Subtract(subtrahend)** — Subtract value
243
- - **float | integer float | integer.Negate()** — Negate number
244
- - **float | integer float | integer.Multiply(values: ...array)** — Multiply values
245
- - **float | integer float | integer.Divide(divisor)** — Divide value
246
- - **float | integer float | integer.Remainder(divisor)** — Remainder
247
- - **float | integer float | integer.Modulo(divisor)** — Modulo
248
- - **float | integer float | integer.Power(exponent)** — Power
249
- - **float | integer float | integer.Root(index)** — Root
250
- - **float | integer float | integer.Cast()** — Cast to integer or float
251
- - **float integer.CastToFloat()** — Cast to float
252
- - **integer float.CastToInteger()** — Cast to integer
273
+ - **(float | integer).GreaterThan(value):boolean** — Greater than
274
+ - **(float | integer).LessThan(value):boolean** — Less than
275
+ - **(float | integer).GreaterOrEqual(value):boolean** — Greater or equal
276
+ - **(float | integer).LessOrEqual(value):boolean** — Less or equal
277
+ - **float.Subtract(subtrahend):float** — Subtract value
278
+ - **integer.Subtract(subtrahend):integer** — Subtract value
279
+ - **float.Negate():float** — Negate number
280
+ - **integer.Negate():integer** — Negate number
281
+ - **float.Multiply(value: integer):float** — Multiply by an integer
282
+ - **integer.Multiply(value: float):float** — Multiply by a float
283
+ - **integer.Multiply(value: integer):integer** — Multiply by an integer
284
+ - **float.Divide(divisor):float** — Divide value
285
+ - **integer.Divide(divisor):integer** — Divide value
286
+ - **float.Remainder(divisor):float** — Remainder
287
+ - **integer.Remainder(divisor):integer** — Remainder
288
+ - **float.Modulo(divisor):float** — Modulo
289
+ - **integer.Modulo(divisor):integer** — Modulo
290
+ - **float.Power(exponent):float** — Power
291
+ - **integer.Power(exponent):integer** — Power
292
+ - **float.Root(index):float** — Root
293
+ - **integer.Root(index):integer** — Root
294
+ - **float.Cast():integer** — Cast to integer
295
+ - **integer.Cast():float** — Cast to float
296
+ - **integer.CastToFloat():float** — Cast to float
297
+ - **float.CastToInteger():integer** — Cast to integer
253
298
 
254
299
  #### Object Functions
255
- - **array object.Entries()** — Key-value pairs
256
- - **array object.Keys()** — Object keys
257
- - **array object.Values()** — Object values
300
+ - **object.Entries():array** — Key-value pairs
301
+ - **object.Keys():array** — Object keys
302
+ - **object.Values():array** — Object values
258
303
 
259
304
  #### String Functions
260
- - **boolean string.Like(value: string)** — Alphanumeric equality
261
- - **boolean string.Unlike(value: string)** — Alphanumeric inequality
262
- - **boolean string.StartsWith(search: string, startPos: integer?, ignoreCaseSpaceEtc: boolean?)** — Prefix check
263
- - **boolean string.EndsWith(search: string, endPos: integer?, ignoreCaseSpaceEtc: boolean?)** — Suffix check
264
- - **string string.Char(pos: integer)** — Character at position
265
- - **integer string.CharCode(pos: integer)** — Character code
266
- - **string string.Alphanum()** — Alphanumeric digest
267
- - **string string.Trim()** — Trim whitespace
268
- - **string string.TrimStart()** — Trim leading whitespace
269
- - **string string.TrimEnd()** — Trim trailing whitespace
270
- - **string string.LowerCase()** — To lowercase
271
- - **string string.UpperCase()** — To uppercase
272
- - **array string.Split(separator: string = ' ')** — Split into array
273
- - **string string.ReplaceWith(replacement: string, search: ...array)** — Replace all instances of substring with another
305
+ - **string.Like(value: string):boolean** — Alphanumeric equality
306
+ - **string.Unlike(value: string):boolean** — Alphanumeric inequality
307
+ - **string.StartsWith(search: string, startPos: integer?, ignoreCaseSpaceEtc: boolean?):boolean** — Prefix check
308
+ - **string.EndsWith(search: string, endPos: integer?, ignoreCaseSpaceEtc: boolean?):boolean** — Suffix check
309
+ - **string.Char(pos: integer):string** — Character at position
310
+ - **string.CharCode(pos: integer):integer** — Character code
311
+ - **string.Trim():string** — Trim whitespace
312
+ - **string.TrimStart():string** — Trim leading whitespace
313
+ - **string.TrimEnd():string** — Trim trailing whitespace
314
+ - **string.LowerCase():string** — To lowercase
315
+ - **string.UpperCase():string** — To uppercase
316
+ - **string.Split(separator: string = ' '):array** — Split into array
317
+ - **string.ReplaceWith(replacement: string, search: ...(string | array)):string** — Replace all instances of the searched strings
274
318
 
275
319
  #### Timestamp Functions
276
- - **integer timestamp.Year(utc: boolean?)** — Get year
277
- - **integer timestamp.Month(utc: boolean?)** — Get month
278
- - **integer timestamp.MonthIndex(utc: boolean?)** — Month index
279
- - **integer timestamp.WeekdayIndex(utc: boolean?)** — Weekday index
280
- - **integer timestamp.Day(utc: boolean?)** — Day of month
281
- - **integer timestamp.Hour(utc: boolean?)** — Hour
282
- - **integer timestamp.Minute(utc: boolean?)** — Minute
283
- - **integer timestamp.Second(utc: boolean?)** — Second
284
- - **integer timestamp.Millisecond(utc: boolean?)** — Millisecond
285
- - **integer timestamp.EpochTime(epoch: timestamp?)** — Milliseconds since epoch
320
+ - **timestamp.Year(utc: boolean?):integer** — Get year
321
+ - **timestamp.Month(utc: boolean?):integer** — Get month
322
+ - **timestamp.MonthIndex(utc: boolean?):integer** — Month index
323
+ - **timestamp.WeekdayIndex(utc: boolean?):integer** — Weekday index
324
+ - **timestamp.Day(utc: boolean?):integer** — Day of month
325
+ - **timestamp.Hour(utc: boolean?):integer** — Hour
326
+ - **timestamp.Minute(utc: boolean?):integer** — Minute
327
+ - **timestamp.Second(utc: boolean?):integer** — Second
328
+ - **timestamp.Millisecond(utc: boolean?):integer** — Millisecond
329
+ - **timestamp.EpochTime(epoch: timestamp?):integer** — Milliseconds since epoch or 1970-01-01 00:00:00 UTC
330
+ - **timestamp.DaysSince(value: timestamp):float** — Difference from another timestamp in days
331
+ - **timestamp.HoursSince(value: timestamp):float** — Difference from another timestamp in hours
332
+ - **timestamp.MinutesSince(value: timestamp):float** — Difference from another timestamp in minutes
333
+ - **timestamp.SecondsSince(value: timestamp):float** — Difference from another timestamp in seconds
286
334
 
287
335
  ## Reference
288
336
 
@@ -306,7 +354,7 @@ const objExpr = new Affinirum( '[`prop1`:a,`prop2`:`abc`].prop1+10' );
306
354
  const oValue = objExpr.evaluate( { a: 50 } ); // 60
307
355
  ...
308
356
  const iteratorExpr = new Affinirum(
309
- 'Float.Sum(arr1.Derive(float(a:float){a*2}).Filter(boolean(a:float){a>3}))'
357
+ 'Float.Sum(arr1.Derive(~(a:float):float{a*2}).Filter(~(a:float):boolean{a>3}))'
310
358
  );
311
359
  const iValue = iteratorExpr.evaluate( { arr1: [ 1, 2, 3 ] } ); // 10
312
360
  ...
@@ -13,7 +13,7 @@ export declare class Affinirum {
13
13
  protected readonly _script: string;
14
14
  protected readonly _strict: boolean;
15
15
  protected readonly _root: Node;
16
- protected readonly _vframes: Map<string, ParserFrame>;
16
+ protected readonly _varframes: Map<string, ParserFrame>;
17
17
  protected readonly _variables: Map<string, Variable>;
18
18
  protected readonly _constants: Map<string, Record<string, Constant>>;
19
19
  protected readonly _functions: Map<string, Constant>;