mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-12 17:30:45 +00:00
8 lines
287 B
TypeScript
8 lines
287 B
TypeScript
export function parsePluginStructuredSettingValue(value: unknown): unknown[] {
|
|
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
if (!Array.isArray(parsed)) {
|
|
throw new TypeError('Plugin structured setting value must be a JSON array');
|
|
}
|
|
return parsed;
|
|
}
|