Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified syntax where possible. #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions functions/abs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ topic: math
args:
required:
- name: value
type: [number]
type: number
desc: positive or negative number
optional: []
returns:
type: number
desc: positive magnitude of input value
Expand Down
3 changes: 1 addition & 2 deletions functions/avg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ topic: math
args:
required:
- name: elements
type: ['array[number]']
type: 'array[number]'
desc: array of numbers to calculate average from
optional: []
returns:
type: [number, 'null']
desc: average value of passed elements
Expand Down
5 changes: 1 addition & 4 deletions functions/ceil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ topic: math
args:
required:
- name: value
type: [number]
desc: ''
optional: []
type: number
returns:
type: number
desc: ''
desc: |
Returns the next highest integer value by rounding up if necessary.
examples:
Expand Down
7 changes: 2 additions & 5 deletions functions/contains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ args:
required:
- name: subject
type: [array, string]
desc: ''
- name: search
type: [any]
desc: ''
optional: []
type: any

returns:
type: boolean
desc: ''
desc: |
Returns `true` if the given `$subject` contains the provided `$search`
string.
Expand Down
8 changes: 2 additions & 6 deletions functions/ends_with.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: strings
args:
required:
- name: subject
type: [string]
desc: ''
type: string
- name: prefix
type: [string]
desc: ''
optional: []
type: string
returns:
type: boolean
desc: ''
desc: |
Returns `true` if the `$subject` ends with the `$prefix`, otherwise this
function returns `false`.
Expand Down
5 changes: 1 addition & 4 deletions functions/floor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ topic: math
args:
required:
- name: value
type: [number]
desc: ''
optional: []
type: number
returns:
type: number
desc: ''
desc: |
Returns the next lowest integer value by rounding down if necessary.
examples:
Expand Down
1 change: 0 additions & 1 deletion functions/from_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ args:
- name: arg
type: ['array[any]']
desc: ''
optional: []
returns:
type: [object]
desc: ''
Expand Down
8 changes: 2 additions & 6 deletions functions/group_by.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: collections
args:
required:
- name: elements
type: ['array[object]']
desc: ''
type: 'array[object]'
- name: expr
type: [expression->string]
desc: ''
optional: []
type: expression->string
returns:
type: object
desc: ''
desc: |
Groups an array of objects `$elements` using an expression `$expr` as the group key.
The `$expr` expression is applied to each element in the array `$elements` and the
Expand Down
7 changes: 2 additions & 5 deletions functions/items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ topic: misc
args:
required:
- name: obj
type: [object]
desc: ''
optional: []
type: object
returns:
type: ['array[any]']
desc: ''
type: 'array[any]'
desc: |2
Returns an array of key-value pairs for the provided input object.
Each pair is a 2-item array with the first item being the key and
Expand Down
8 changes: 2 additions & 6 deletions functions/join.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: collections
args:
required:
- name: glue
type: [string]
desc: ''
type: string
- name: stringsarray
type: ['array[string]']
desc: ''
optional: []
type: 'array[string]'
returns:
type: string
desc: ''
desc: |
Returns all of the elements from the provided `$stringsarray` array joined
together using the `$glue` argument as a separator between each.
Expand Down
5 changes: 1 addition & 4 deletions functions/keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ topic: collections
args:
required:
- name: obj
type: [object]
desc: ''
optional: []
type: object
returns:
type: array
desc: ''
desc: |
Returns an array containing the keys of the provided object.
Note that because JSON hashes are inheritently unordered, the
Expand Down
3 changes: 0 additions & 3 deletions functions/length.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ args:
required:
- name: subject
type: [string, array, object]
desc: ''
optional: []
returns:
type: number
desc: ''
desc: |
Returns the length of the given argument using the following types rules:

Expand Down
7 changes: 2 additions & 5 deletions functions/let.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ topic: misc
args:
required:
- name: scope
type: [object]
desc: ''
type: object
- name: expr
type: ['expression->any']
optional: []
type: 'expression->any'
returns:
type: any
desc: ''
desc: |

Captures the current evaluation context in a child lexical scope.
Expand Down
8 changes: 2 additions & 6 deletions functions/map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: collections
args:
required:
- name: expr
type: [expression]
desc: ''
type: expression
- name: elements
type: ['array[any]']
desc: ''
optional: []
type: 'array[any]'
returns:
type: array[any]
desc: ''
desc: |
Apply the `expr` to every element in the `elements` array
and return the array of results. An `elements` of length
Expand Down
3 changes: 0 additions & 3 deletions functions/max.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ args:
required:
- name: collection
type: ['array[number]', 'array[string]']
desc: ''
optional: []
returns:
type: number
desc: ''
desc: |
Returns the highest found number in the provided array argument.

Expand Down
6 changes: 1 addition & 5 deletions functions/max_by.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: math
args:
required:
- name: elements
type: [array]
desc: ''
type: array
- name: expr
type: [expression->number, expression->string]
desc: ''
optional: []
returns:
type: any
desc: ''
desc: |
Return the maximum element in an array using the expression `expr` as the
comparison key. The entire maximum element is returned.
Expand Down
10 changes: 3 additions & 7 deletions functions/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: collections
args:
required:
- name: argument
type: [object]
desc: ''
optional:
- name: ..
type: [object]
desc: ''
type: object
variadic:
type: object
returns:
type: object
desc: ''
desc: |
Accepts 0 or more objects as arguments, and returns a single object
with subsequent objects merged. Each subsequent object’s key/value
Expand Down
3 changes: 0 additions & 3 deletions functions/min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ args:
required:
- name: collection
type: ['array[number]', 'array[string]']
desc: ''
optional: []
returns:
type: number
desc: ''
desc: |
Returns the lowest found number in the provided `$collection` argument.
examples:
Expand Down
6 changes: 1 addition & 5 deletions functions/min_by.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: math
args:
required:
- name: elements
type: [array]
desc: ''
type: array
- name: expr
type: [expression->number, expression->string]
desc: ''
optional: []
returns:
type: any
desc: ''
desc: |
Return the minimum element in an array using the expression `expr` as the
comparison key. The entire maximum element is returned.
Expand Down
10 changes: 3 additions & 7 deletions functions/not_null.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: misc
args:
required:
- name: argument
type: [any]
desc: ''
optional:
- name: ..
type: [any]
desc: ''
type: any
variadic:
type: any
returns:
type: any
desc: ''
desc: |
Returns the first argument that does not resolve to `null`. This function
accepts one or more arguments, and will evaluate them in order until a
Expand Down
3 changes: 0 additions & 3 deletions functions/reverse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ args:
required:
- name: argument
type: [string, array]
desc: ''
optional: []
returns:
type: array
desc: ''
desc: |
Reverses the order of the `$argument`.
examples:
Expand Down
3 changes: 0 additions & 3 deletions functions/sort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ args:
required:
- name: list
type: ['array[number]', 'array[string]']
desc: ''
optional: []
returns:
type: array
desc: ''
desc: |
This function accepts an array `$list` argument and returns the sorted
elements of the `$list` as an array.
Expand Down
6 changes: 1 addition & 5 deletions functions/sort_by.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: collections
args:
required:
- name: elements
type: [array]
desc: ''
type: array
- name: expr
type: [expression->number, expression->string]
desc: ''
optional: []
returns:
type: array
desc: ''
desc: |
Sort an array using an expression `expr` as the sort key. For each element
in the array of `elements`, the `expr` expression is applied and the
Expand Down
8 changes: 2 additions & 6 deletions functions/starts_with.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ topic: strings
args:
required:
- name: subject
type: [string]
desc: ''
type: string
- name: prefix
type: [string]
desc: ''
optional: []
type: string
returns:
type: boolean
desc: ''
desc: |
Returns `true` if the `$subject` starts with the `$prefix`, otherwise
this function returns `false`.
Expand Down
5 changes: 1 addition & 4 deletions functions/sum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ topic: math
args:
required:
- name: collection
type: ['array[number]']
desc: ''
optional: []
type: 'array[number]'
returns:
type: number
desc: ''
desc: |
Returns the sum of the provided array argument.

Expand Down
5 changes: 1 addition & 4 deletions functions/to_array.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ topic: conversion
args:
required:
- name: arg
type: [any]
desc: ''
optional: []
type: any
returns:
type: array
desc: ''
desc: |
* array - Returns the passed in value.
* number/string/object/boolean/null - Returns a one element array containing
Expand Down
Loading