Skip to main content
Module

x/udd/search.ts

Update Deno Dependencies - update dependency urls to their latest published versions
Very Popular
Go to Latest
File
import { IMPLS } from "./versioned.ts";
// ideally we'd do some proper parsing here (is there a deno api here? swc? or deno info)
// FIXME use deno info once it has json output.
// given a ts/js string we want to find the import urls/// note: these can span over multiple lines// import "https?://deno.land/(std|x)@([^/"]?)/.*?"// import { foo, bar } from "https?://deno.land/(std|x)@([^/"]?)/.*?"export function importUrls(tsContent: string): string[] { // for now let's just look up all the deno.land/x and deno.land/std links // [...tsContent.matchAll(/https?\:\/\/deno\.land\/(std|x)\@[^\'\"]*/g)]] // return tsContent.match( // /https?\:\/\/deno\.land\/(std|x\/[^\/\"\']*?)\@[^\'\"]*/g // ) || []; const rs: RegExp[] = IMPLS.map(Impl => new Impl("").regexp); return rs.flatMap(regexp => tsContent.match(regexp) || []);}