refactor(yaml): simplify seq type (#5878)

initial commit
This commit is contained in:
Tim Reichen 2024-09-02 23:47:51 +02:00 committed by GitHub
parent 23f47386ea
commit e92bc0cced
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,11 +7,7 @@ import type { Type } from "../_type.ts";
export const seq: Type<"sequence", unknown[]> = {
tag: "tag:yaml.org,2002:seq",
resolve() {
return true;
},
construct(data) {
return data !== null ? data : [];
},
kind: "sequence",
resolve: (): boolean => true,
construct: (data: unknown[] | null): unknown[] => data !== null ? data : [],
};