File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const gitmojis : Record < string , string > = {
1+ export const gitmojis : Record < string , string > = {
22 ":art:" : "🎨" ,
33 ":zap:" : "⚡️" ,
44 ":fire:" : "🔥" ,
@@ -72,22 +72,25 @@ const gitmojis: Record<string, string> = {
7272 ":technologist:" : "🧑💻" ,
7373 ":money_with_wings:" : "💸" ,
7474 ":thread:" : "🧵" ,
75- ":safety_vest:" : "🦺"
75+ ":safety_vest:" : "🦺" ,
7676} ;
7777
78- export function convert ( content : string , withSpace ?: boolean | "leading" | "trailing" | "both" ) {
78+ export function convert (
79+ content : string ,
80+ withSpace ?: boolean | "leading" | "trailing" | "both"
81+ ) {
7982 const re = new RegExp ( Object . keys ( gitmojis ) . join ( "|" ) , "gi" ) ;
8083 return content . replace ( re , function ( matched ) {
8184 switch ( withSpace ) {
8285 case true :
8386 case "trailing" :
84- return `${ gitmojis [ matched . toLowerCase ( ) ] } `
87+ return `${ gitmojis [ matched . toLowerCase ( ) ] } ` ;
8588 case "leading" :
86- return ` ${ gitmojis [ matched . toLowerCase ( ) ] } `
89+ return ` ${ gitmojis [ matched . toLowerCase ( ) ] } ` ;
8790 case "both" :
88- return ` ${ gitmojis [ matched . toLowerCase ( ) ] } `
91+ return ` ${ gitmojis [ matched . toLowerCase ( ) ] } ` ;
8992 default :
90- return gitmojis [ matched . toLowerCase ( ) ]
93+ return gitmojis [ matched . toLowerCase ( ) ] ;
9194 }
9295 } ) ;
9396}
You can’t perform that action at this time.
0 commit comments