mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-19 09:01:39 -06:00
refactor: remove residual normalization adapters (#122771)
This commit is contained in:
committed by
GitHub
parent
8bbc0a9bc7
commit
9da43d67e1
@@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
filterStringEntries,
|
||||
normalizeAtHashSlug,
|
||||
normalizeCsvOrLooseStringList,
|
||||
normalizeHyphenSlug,
|
||||
normalizeOptionalTrimmedStringList,
|
||||
normalizeSortedUniqueStringEntries,
|
||||
@@ -82,6 +83,15 @@ describe("normalization-core/string-normalization", () => {
|
||||
expect(normalizeOptionalTrimmedStringList(["", 42])).toBeUndefined();
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ value: " first, second, , first ", expected: ["first", "second", "first"] },
|
||||
{ value: [" first ", 42, "", " ", 7], expected: ["first", "42", "7"] },
|
||||
{ value: null, expected: [] },
|
||||
{ value: { value: "first" }, expected: [] },
|
||||
])("normalizes CSV or loose string-list input", ({ value, expected }) => {
|
||||
expect(normalizeCsvOrLooseStringList(value)).toEqual(expected);
|
||||
});
|
||||
|
||||
it("normalizes sorted unique trimmed string lists", () => {
|
||||
expect(normalizeSortedUniqueTrimmedStringList([" b ", "a", "b", "", "a"])).toEqual(["a", "b"]);
|
||||
expect(normalizeSortedUniqueTrimmedStringList(["z", 1, " a "] as unknown[])).toEqual([
|
||||
|
||||
Reference in New Issue
Block a user