Update helpers

This commit is contained in:
Andrew Kingston 2025-01-17 11:23:16 +00:00
parent 50a8caddb9
commit 3fa7a23932
No known key found for this signature in database
1 changed files with 1 additions and 5 deletions

View File

@ -27,8 +27,6 @@ export const capitalise = (string?: string | null): string => {
/**
* Computes a short hash of a string
* @param string the string to compute a hash of
* @return {string} the hash string
*/
export const hashString = (string?: string | null): string => {
if (!string) {
@ -80,7 +78,6 @@ export const deepSet = (
/**
* Deeply clones an object. Functions are not supported.
* @param obj the object to clone
*/
export const cloneDeep = <T>(obj: T): T => {
if (!obj) {
@ -91,9 +88,8 @@ export const cloneDeep = <T>(obj: T): T => {
/**
* Copies a value to the clipboard
* @param value the value to copy
*/
export const copyToClipboard = (value: string): Promise<void> => {
export const copyToClipboard = (value: any): Promise<void> => {
return new Promise(res => {
if (navigator.clipboard && window.isSecureContext) {
// Try using the clipboard API first