Skip to content

Commit

Permalink
refactor(yaml): simplify merge type (#5877)
Browse files Browse the repository at this point in the history
  • Loading branch information
timreichen authored Sep 2, 2024
1 parent f86e911 commit aa757d8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions yaml/_type/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

0 comments on commit aa757d8

Please sign in to comment.