Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed Dec 18, 2019
1 parent 8b02d7c commit cd263d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/transliterate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class Transliterate {
let index = 0;
let result = '';
for (let i = 0; i < str.length; i++) {
// Get current character, take surrogates in consideration
// Get current character, taking surrogates in consideration
const char = /[\uD800-\uDBFF]/.test(str[i]) && /[\uDC00-\uDFFF]/.test(str[i + 1]) ?
str[i] + str[i + 1] : str[i];
let s: string;
Expand Down Expand Up @@ -151,7 +151,7 @@ export class Transliterate {
const opt: OptionsTransliterate = deepClone({ ...this.options, ...options});

// force convert to string
let str = String(source);
let str = typeof source === 'string' ? source : String(source);

const replaceOption: OptionReplaceArray = this.formatReplaceOption(opt.replace as OptionReplaceCombined);
if (replaceOption.length) {
Expand Down

0 comments on commit cd263d4

Please sign in to comment.