MCPcopy
hub / github.com/pocketbase/pocketbase / relativeTypesPath

Method relativeTypesPath

plugins/jsvm/jsvm.go:474–484  ·  view source on GitHub ↗

relativeTypesPath returns a path to the generated TS file relative to the specified basepath. It fallbacks to the full path if generating the relative path fails.

(basepath string)

Source from the content-addressed store, hash-verified

472//
473// It fallbacks to the full path if generating the relative path fails.
474func (p *plugin) relativeTypesPath(basepath string) string {
475 fullPath := p.fullTypesPath()
476
477 rel, err := filepath.Rel(basepath, fullPath)
478 if err != nil {
479 // fallback to the full path
480 rel = fullPath
481 }
482
483 return rel
484}
485
486// refreshTypesFile saves the embedded TS declarations as a file on the disk.
487func (p *plugin) refreshTypesFile() error {

Callers 1

registerHooksMethod · 0.95

Calls 1

fullTypesPathMethod · 0.95

Tested by

no test coverage detected