From cf8be54e886b195bd14eb771e38c5a1b3f92280c Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Mon, 8 Aug 2022 21:07:44 +0100 Subject: [PATCH] fix(presetter): merge arrays only if the values are all primitive --- package.json | 3 ++- source/plugin.ts | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index aa1eeec..d42945c 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ }, "devDependencies": { "presetter": "file:../presetter", - "presetter-preset-strict": "file:../preset-strict" + "presetter-preset-strict": "file:../preset-strict", + "type-fest": "^2.0.0" } } diff --git a/source/plugin.ts b/source/plugin.ts index a4b5bf2..9613232 100644 --- a/source/plugin.ts +++ b/source/plugin.ts @@ -16,6 +16,7 @@ import { isDirective } from 'presetter'; import type { ApplyDirective, ImportDirective } from 'presetter'; +import type { JsonObject } from 'type-fest'; /** full configuration about a plugin */ export type PluginConfiguration = @@ -26,10 +27,7 @@ export type PluginConfiguration = export type PluginHeader = string | ApplyDirective; /** options for a plugin */ -export type PluginOptions = - | Record - | ApplyDirective - | ImportDirective; +export type PluginOptions = JsonObject | ApplyDirective | ImportDirective; /** plugin configuration as an object */ export type PluginObject = Record;