Skip to content

Instantly share code, notes, and snippets.

@rileybathurst
Created June 22, 2024 17:02
Show Gist options
  • Save rileybathurst/c8b510b7dc39da523ced25ff18294a28 to your computer and use it in GitHub Desktop.
Save rileybathurst/c8b510b7dc39da523ced25ff18294a28 to your computer and use it in GitHub Desktop.
working out a cleaner string replace
const adj: { [key: string]: string } = {
wedding: 'special day',
residential: 'home',
commercial: 'business',
'commercial-events': 'business',
'social_events': 'event',
patio: 'patio'
};
const adjective = adj[data.strapiService.slug];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment