fix: correct package scope name

This commit is contained in:
Nicholas Gelinas
2026-07-13 23:31:25 -04:00
parent adf5028cf5
commit b8ee46eb6f
3 changed files with 19 additions and 1 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ node_modules
*.d.ts *.d.ts
.vitest-attachments .vitest-attachments
__screenshots__ __screenshots__
tasks

View File

@@ -1,5 +1,5 @@
{ {
"name": "@heliospolis/js", "name": "@heliopolis/js",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"type": "module", "type": "module",

View File

@@ -56,6 +56,23 @@ describe("NonEmptyString", () => {
).success, ).success,
).toBe(false)); ).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", () => it("accepts strings with at least 1 non-whitespsace character", () =>
expect( expect(
NonEmptyString.safeDecode( NonEmptyString.safeDecode(