Skip to content

Commit

Permalink
Remove slugify util and SlugInput component
Browse files Browse the repository at this point in the history
Signed-off-by: brookewp <[email protected]>
  • Loading branch information
brookewp committed Dec 2, 2024
1 parent 05ea99a commit c308d5e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
51 changes: 0 additions & 51 deletions src/data-sources/components/SlugInput.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions src/data-sources/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
import CheckIcon from '@/settings/icons/CheckIcon';
import ErrorIcon from '@/settings/icons/ErrorIcon';

/**
* Tranforms a string into a valid data source slug.
*
* @param input The string to slugify.
*/
export const slugify = ( input: string ) => {
return input
.toString() // Ensure input is a string
.toLowerCase() // Convert to lowercase
.trim() // Trim leading and trailing spaces
.replace( /\s+/g, '-' ) // Replace spaces with hyphens
.replace( /[^a-z0-9-]/g, '' ) // Remove invalid characters
.replace( /--+/g, '-' ) // Replace multiple hyphens with a single hyphen
.replace( /^-+|-+$/g, '' ); // Trim leading and trailing hyphens
};

export function getConnectionMessage(
status: 'success' | 'error' | null,
message: string
Expand Down

0 comments on commit c308d5e

Please sign in to comment.