def module_name

near-v-framework@0.4.0.0 · domain/architecture/system/container/ops.bend:192

import near-v-framework@0.4.0.0/domain/architecture/system/container/ops.bend as Ops
import Base

192# The module a go.mod line requires, or "".
193def module_name(+line: String) -> String:
194  +words = filled(String.split(String.join(String.split(String.trim(line), '\t'), " "), ' '))
195  +first = nth(words, 0n)
196  +second = nth(words, 1n)
197  Bool.pick(String, String.eq(first, "require") && String.starts_with(nth(words, 2n), "v"), second,
198    Bool.pick(String, String.starts_with(second, "v") && Bool.not(String.eq(first, "module")), first, ""))

Uses (12)

Used by (1)