From 01006d9e45a66b8ec68c9b4450f29e50d6252a46 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 9 Aug 2026 04:51:16 +0100 Subject: [PATCH 1/2] feat: add `minimalistic-assert` to replacements --- manifests/micro-utilities.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index 059f46d2..279ec9ba 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -54,6 +54,12 @@ "description": "You can convert to and from a `Set` to remove duplicates from an array.", "example": "const unique = (arr) => [...new Set(arr)]" }, + "snippet::assert": { + "id": "snippet::assert", + "type": "simple", + "description": "You can use a simple function to assert a value or an expression.", + "example": "function assert(val: unknown, msg: string): asserts val {\n if (!val) throw new Error(msg)\n}" + }, "snippet::async-function-constructor": { "id": "snippet::async-function-constructor", "type": "simple", @@ -837,6 +843,11 @@ "moduleName": "math-random", "replacements": ["snippet::math-random"] }, + "minimalistic-assert": { + "type": "module", + "moduleName": "minimalistic-assert", + "replacements": ["snippet::assert"] + }, "object-filter": { "type": "module", "moduleName": "object-filter", From 69b0ee8e3336bb633fbe492d64b6fea44fccad9b Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 9 Aug 2026 13:20:03 +0100 Subject: [PATCH 2/2] Update manifests/micro-utilities.json --- manifests/micro-utilities.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index 279ec9ba..6bacafc8 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -58,7 +58,7 @@ "id": "snippet::assert", "type": "simple", "description": "You can use a simple function to assert a value or an expression.", - "example": "function assert(val: unknown, msg: string): asserts val {\n if (!val) throw new Error(msg)\n}" + "example": "function assert(val, msg) {\n if (!val) throw new Error(msg)\n}" }, "snippet::async-function-constructor": { "id": "snippet::async-function-constructor",