| 538 | |
| 539 | // https://gist.github.com/bluzky/b8c205c98ff3318907b30c3e0da4bf3f |
| 540 | export function removeAccents(str) { |
| 541 | let from = |
| 542 | "àáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîöüûñçýỳỹỵỷ", |
| 543 | to = |
| 544 | "aaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiouuncyyyyy"; |
| 545 | for (let i = 0, l = from.length; i < l; i++) { |
| 546 | str = str.replace(RegExp(from[i], "gi"), to[i]); |
| 547 | } |
| 548 | |
| 549 | str = str.toLowerCase().trim(); |
| 550 | // .replace(/[^a-z0-9\-]/g, "-") |
| 551 | // .replace(/-+/g, "-"); |
| 552 | |
| 553 | return str; |
| 554 | } |
| 555 | |
| 556 | export const isFunction = (o) => typeof o === "function"; |
| 557 | |