From b5051e25c219c188f17d499ee4e101a64eb62e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 19 Aug 2024 21:36:35 +0100 Subject: feat: Deprecate "import assertions" with a warning (#24743) This commit deprecates "import assertions" proposal that has been replaced with "import attributes". Any time an import assertion is encountered a warning will be printed to the terminal. This warning will be printed for both local and remote files (ie. user code and dependencies). Import assertions support will be removed in Deno 2. --- cli/cache/code_cache.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cli/cache') diff --git a/cli/cache/code_cache.rs b/cli/cache/code_cache.rs index abcd0d46a..d9e951af6 100644 --- a/cli/cache/code_cache.rs +++ b/cli/cache/code_cache.rs @@ -80,6 +80,10 @@ impl CodeCache { data, )); } + + pub fn remove_code_cache(&self, specifier: &str) { + Self::ensure_ok(self.inner.remove_code_cache(specifier)) + } } impl code_cache::CodeCache for CodeCache { @@ -158,6 +162,15 @@ impl CodeCacheInner { self.conn.execute(sql, params)?; Ok(()) } + + pub fn remove_code_cache(&self, specifier: &str) -> Result<(), AnyError> { + let sql = " + DELETE FROM codecache + WHERE specifier=$1;"; + let params = params![specifier]; + self.conn.execute(sql, params)?; + Ok(()) + } } fn serialize_code_cache_type( -- cgit v1.2.3