From b8ee46eb6f3f352821bf6aef5a07d38e6a4cf514 Mon Sep 17 00:00:00 2001 From: Nicholas Gelinas Date: Mon, 13 Jul 2026 23:31:25 -0400 Subject: [PATCH] fix: correct package scope name --- .gitignore | 1 + package.json | 2 +- src/non-empty-string.spec.js | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5b325de..28aca30 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules *.d.ts .vitest-attachments __screenshots__ +tasks diff --git a/package.json b/package.json index dbab06c..11686f7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@heliospolis/js", + "name": "@heliopolis/js", "version": "1.0.0", "description": "", "type": "module", diff --git a/src/non-empty-string.spec.js b/src/non-empty-string.spec.js index c4a6b01..77aca41 100644 --- a/src/non-empty-string.spec.js +++ b/src/non-empty-string.spec.js @@ -56,6 +56,23 @@ describe("NonEmptyString", () => { ).success, ).toBe(false)); + it("trims leading and trailing whitespace from valid strings", { + repeats: 10, + }, () => { + const content = faker.string.alphanumeric({ length: { min: 1, max: 255 } }); + + expect(NonEmptyString.safeDecode(` \n\t${content}\t\n `)).toStrictEqual({ + data: content, + success: true, + }); + }); + + it.each([".", "hello world", "déjà vu", "こんにちは", "🚀"])( + "accepts non-empty non-alphanumeric content: %s", + (content) => + expect(NonEmptyString.safeDecode(content).success).toBe(true), + ); + it("accepts strings with at least 1 non-whitespsace character", () => expect( NonEmptyString.safeDecode(