mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-14 11:23:02 +02:00
ec2d6a659b
* #9 Added 'APPEND' function * #9 Added 'FIRST' function * #9 Added 'FLATTEN' function * #9 Added 'INTERSECTION' function * #9 Added 'LAST' function * #9 Added 'MINUS' function * #9 Added 'NTH' function * #9 Added 'OUTERSECTION' function * #9 Added 'POP' function * #9 Added 'POSITION' function * #9 Added 'PUSH' function * Fixed nil pointer exception in value parser * #9 Added 'REMOVE_NTH' function * #9 Added 'REMOVE_VALUE' function * #9 Added 'REMOVE_VALUES' function * #9 Added 'REVERSE' function * #9 Added 'SHIFT' function * #9 Added 'SLICE' function * Removed meme * #9 Added 'SORTED' function * #9 Added SORTED_UNIQUE function * #9 Added 'UNION' function * #9 Added 'UNION_DISTINCT' function * #9 Added 'UNIQUE' function * #9 Added 'UNSHIFT' function * #9 Made more strict optional arg validation * #9 Fixed linting errors
31 lines
706 B
Go
31 lines
706 B
Go
package stdlib
|
|
|
|
import (
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
"github.com/MontFerret/ferret/pkg/stdlib/arrays"
|
|
"github.com/MontFerret/ferret/pkg/stdlib/collections"
|
|
"github.com/MontFerret/ferret/pkg/stdlib/html"
|
|
"github.com/MontFerret/ferret/pkg/stdlib/strings"
|
|
"github.com/MontFerret/ferret/pkg/stdlib/types"
|
|
"github.com/MontFerret/ferret/pkg/stdlib/utils"
|
|
)
|
|
|
|
func NewLib() map[string]core.Function {
|
|
lib := make(map[string]core.Function)
|
|
|
|
add := func(l map[string]core.Function) {
|
|
for name, fn := range l {
|
|
lib[name] = fn
|
|
}
|
|
}
|
|
|
|
add(types.NewLib())
|
|
add(strings.NewLib())
|
|
add(collections.NewLib())
|
|
add(arrays.NewLib())
|
|
add(html.NewLib())
|
|
add(utils.NewLib())
|
|
|
|
return lib
|
|
}
|