-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Helper methods into new file): Refactored Helper Methods int…
…o new File
- Loading branch information
Daniel Habenicht
authored and
Daniel Habenicht
committed
Aug 6, 2018
1 parent
3dd07ae
commit 5bfd6c3
Showing
3 changed files
with
24 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Encodes string | ||
*/ | ||
export function e(value: string | undefined): string { | ||
if (value) { | ||
if (typeof value !== 'string') { | ||
value = '' + value; | ||
} | ||
return value | ||
.replace(/\n/g, '\n') | ||
.replace(/,/g, ',') | ||
.replace(/;/g, ';'); | ||
} | ||
return ''; | ||
} | ||
|
||
/** | ||
* Return new line characters | ||
*/ | ||
export function nl(): string { | ||
return '\n'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/ngx-vcard/src/lib/types/parameter/BasicPropertyParameters.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters