Skip to content

Commit

Permalink
feat: incorporated helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
likhith-deriv committed Feb 22, 2023
1 parent 9a42b99 commit 002f281
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/components/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ const getPascalCase = str => {

const getFileNameFromPath = path => path.match(/([^/]*)\/*$/)[1].replace('.svg', '');

const getEnglishCharacters = input =>
input
.normalize('NFD')
.split('')
.filter(char => /^[a-z ]*$/i.test(char))
.join('');

module.exports = {
getPascalCase,
getFileNameFromPath,
getKebabCase,
getEnglishCharacters,
};

0 comments on commit 002f281

Please sign in to comment.