1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-05 00:49:00 +02:00

Add Path functions (#505)

* Add Path functions

* Add unit tests
This commit is contained in:
Aleksandr Yakimenko
2020-05-13 05:19:41 +03:00
committed by GitHub
parent 311d07ad40
commit ed8e43e4c6
18 changed files with 676 additions and 0 deletions

18
pkg/stdlib/path/lib.go Normal file
View File

@ -0,0 +1,18 @@
package path
import "github.com/MontFerret/ferret/pkg/runtime/core"
// RegisterLib register `PATH` namespace functions.
func RegisterLib(ns core.Namespace) error {
return ns.RegisterFunctions(
core.NewFunctionsFromMap(map[string]core.Function{
"BASE": Base,
"CLEAN": Clean,
"DIR": Dir,
"EXT": Ext,
"IS_ABS": IsAbs,
"JOIN": Join,
"MATCH": Match,
"SEPARATE": Separate,
}))
}