refactor(yaml): simplify merge type (#5877)

This commit is contained in:
Tim Reichen 2024-09-02 08:54:30 +02:00 committed by GitHub
parent f86e91119f
commit aa757d8803
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,15 +5,9 @@
import type { Type } from "../_type.ts";
function resolveYamlMerge(data: string): boolean {
return data === "<<" || data === null;
}
export const merge: Type<"scalar", unknown> = {
tag: "tag:yaml.org,2002:merge",
kind: "scalar",
resolve: resolveYamlMerge,
construct(data) {
return data;
},
resolve: (data: unknown): boolean => data === "<<" || data === null,
construct: (data: unknown): unknown => data,
};