MCPcopy
hub / github.com/pocketbase/pocketbase / BindFilepath

Function BindFilepath

plugins/jsvm/binds.go:781–800  ·  view source on GitHub ↗

BindFilepath registers $filepath.* namespaced object with common std Go filepath package related exports. See https://pocketbase.io/jsvm/modules/_filepath.html.

(vm *goja.Runtime)

Source from the content-addressed store, hash-verified

779//
780// See https://pocketbase.io/jsvm/modules/_filepath.html.
781func BindFilepath(vm *goja.Runtime) {
782 obj := vm.NewObject()
783 vm.Set("$filepath", obj)
784
785 obj.Set("base", filepath.Base)
786 obj.Set("clean", filepath.Clean)
787 obj.Set("dir", filepath.Dir)
788 obj.Set("ext", filepath.Ext)
789 obj.Set("fromSlash", filepath.FromSlash)
790 obj.Set("glob", filepath.Glob)
791 obj.Set("isAbs", filepath.IsAbs)
792 obj.Set("join", filepath.Join)
793 obj.Set("match", filepath.Match)
794 obj.Set("rel", filepath.Rel)
795 obj.Set("split", filepath.Split)
796 obj.Set("splitList", filepath.SplitList)
797 obj.Set("toSlash", filepath.ToSlash)
798 obj.Set("walk", filepath.Walk)
799 obj.Set("walkDir", filepath.WalkDir)
800}
801
802// BindOS registers $os.* namespaced object with
803// common std Go os package related exports.

Callers 3

TestBindFilepathCountFunction · 0.85
registerMigrationsMethod · 0.85
registerHooksMethod · 0.85

Calls 1

SetMethod · 0.65

Tested by 1

TestBindFilepathCountFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…