Skip to content

Commit

Permalink
fix(home-assistant): replace apostrophes with dashes (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
zikeji committed Sep 30, 2020
1 parent 19b7b51 commit b1fd7ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/util/id.spec.ts
Expand Up @@ -14,4 +14,8 @@ describe('makeId', () => {
it('should convert underscores to dashes', () => {
expect(makeId('bluetooth-classic_129-1-1')).toMatch(idRegex);
});

it('should convert apostrophes to dashes', () => {
expect(makeId("parent's-room")).toMatch(idRegex);
});
});
2 changes: 1 addition & 1 deletion src/util/id.ts
Expand Up @@ -9,5 +9,5 @@ import slugify from 'slugify';
export function makeId(input: string): string {
return slugify(input, {
lower: true,
}).replace(/[_:]/g, '-');
}).replace(/[_:']/g, '-');
}

0 comments on commit b1fd7ae

Please sign in to comment.