github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/path/lib.go (about)

     1  package path
     2  
     3  import "github.com/MontFerret/ferret/pkg/runtime/core"
     4  
     5  // RegisterLib register `PATH` namespace functions.
     6  // @namespace PATH
     7  func RegisterLib(ns core.Namespace) error {
     8  	return ns.
     9  		Namespace("PATH").
    10  		RegisterFunctions(
    11  			core.NewFunctionsFromMap(map[string]core.Function{
    12  				"BASE":     Base,
    13  				"CLEAN":    Clean,
    14  				"DIR":      Dir,
    15  				"EXT":      Ext,
    16  				"IS_ABS":   IsAbs,
    17  				"JOIN":     Join,
    18  				"MATCH":    Match,
    19  				"SEPARATE": Separate,
    20  			}))
    21  }