fix(presetter): merge arrays only if the values are all primitive

This commit is contained in:
Alvis HT Tang 2022-08-08 21:07:44 +01:00
parent cb5384bbd3
commit cf8be54e88
2 changed files with 4 additions and 5 deletions

View File

@ -48,6 +48,7 @@
}, },
"devDependencies": { "devDependencies": {
"presetter": "file:../presetter", "presetter": "file:../presetter",
"presetter-preset-strict": "file:../preset-strict" "presetter-preset-strict": "file:../preset-strict",
"type-fest": "^2.0.0"
} }
} }

View File

@ -16,6 +16,7 @@
import { isDirective } from 'presetter'; import { isDirective } from 'presetter';
import type { ApplyDirective, ImportDirective } from 'presetter'; import type { ApplyDirective, ImportDirective } from 'presetter';
import type { JsonObject } from 'type-fest';
/** full configuration about a plugin */ /** full configuration about a plugin */
export type PluginConfiguration = export type PluginConfiguration =
@ -26,10 +27,7 @@ export type PluginConfiguration =
export type PluginHeader = string | ApplyDirective; export type PluginHeader = string | ApplyDirective;
/** options for a plugin */ /** options for a plugin */
export type PluginOptions = export type PluginOptions = JsonObject | ApplyDirective | ImportDirective;
| Record<string, unknown>
| ApplyDirective
| ImportDirective;
/** plugin configuration as an object */ /** plugin configuration as an object */
export type PluginObject = Record<PluginHeader, PluginOptions | null>; export type PluginObject = Record<PluginHeader, PluginOptions | null>;