def import_of

near-v-framework@0.4.0.0 · domain/architecture/system/effects.bend:43

import near-v-framework@0.4.0.0/domain/architecture/system/effects.bend as Effects
import Base
import bend-kit-files@0.1.0.0/files.bend as Fs

43# The file a line imports, relative to the repository, or "" when it imports none of the repository's.
44def import_of(+line: String, +dir: String) -> String:
45  +w = unquote(second_word(String.trim(line)))
46  Bool.pick(String, String.starts_with(String.trim(line), "import ") && (String.starts_with(w, "./") || String.starts_with(w, "../")),
47    Fs.path.normalize(Fs.path.join(dir, w)), "")

Uses (10)

Used by (1)