s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
15 lines • 578 B
JavaScript
export * from './geometry';
export * from './object';
export * from './projection';
/**
* Clean a string to remove whitespace, single and double quotes, and replace multiple spaces with a single space
* @param str - string to clean
* @returns - cleaned string
*/
export function cleanString(str) {
return str
.trim() // Remove whitespace at the start and end
.replace(/^['"]|['"]$/g, '') // Remove single or double quotes from start and end
.replace(/\s+/g, ' '); // Replace multiple spaces with a single space
}
//# sourceMappingURL=index.js.map