UNPKG

zoid

Version:
6 lines (4 loc) 165 B
/* @flow */ export function normalizeString(str : string) : string { return str.replace(/^[^a-z0-9A-Z]+|[^a-z0-9A-Z]+$/g, '').replace(/[^a-z0-9A-Z]+/g, '_'); }