We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 597c678 + 1251b18 commit 0c73f45Copy full SHA for 0c73f45
src/commands/image/generate.ts
@@ -56,7 +56,11 @@ export default defineCommand({
56
if (flags.subjectRef) {
57
const refStr = flags.subjectRef as string;
58
const params = Object.fromEntries(
59
- refStr.split(',').map(p => p.split('=') as [string, string]),
+ refStr.split(',').map(p => {
60
+ const eqIdx = p.indexOf('=');
61
+ if (eqIdx === -1) return [p, ''];
62
+ return [p.slice(0, eqIdx), p.slice(eqIdx + 1)];
63
+ }),
64
);
65
66
const ref: { type: string; image_url?: string; image_file?: string } = {
0 commit comments