Open jblaketc opened 8 years ago
'use strict'; import {Filter} from 'scaffi-ui-core'; // jshint unused: false; class Decamelize { //start-non-standard @Filter({ filterName: 'decamelize' }) //end-non-standard static decamelizeFilter() { return (str, sep) => { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return str.replace(/([a-z\d])([A-Z])/g, '$1' + (sep || ' ') + '$2'); }; } } export default Decamelize;