kit
kit copied to clipboard
`clipboard.writeText` doesn't write to clipboard if it's not `string`
Example:
const num:any = 123
await clipboard.writeText(num)
I know that if correctly typed it will not allow for a non-string to be passed, but I think it should either error out or do a .toString()
I'll fix the internals in the next build like so:
let text = '';
if (typeof value === 'number') {
text = value.toString();
}
if (typeof value !== 'string') {
text = JSON.stringify(value);
}
if (text) {
await clipboard.writeText(text);
}
@ramiroaraujo Can you confirm that this works for you now?