diff options
Diffstat (limited to 'src/server/api/common/get-host-lower.ts')
| -rw-r--r-- | src/server/api/common/get-host-lower.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/api/common/get-host-lower.ts b/src/server/api/common/get-host-lower.ts new file mode 100644 index 0000000000..fc4b30439e --- /dev/null +++ b/src/server/api/common/get-host-lower.ts @@ -0,0 +1,5 @@ +import { toUnicode } from 'punycode'; + +export default host => { + return toUnicode(host).replace(/[A-Z]+/, match => match.toLowerCase()); +}; |