index.js
function(segment, strict) {
		if (!_.isString(segment)) {
			throw new TypeError('segment must be of type string');
		}
		if (!_.isBoolean(strict)) {
			strict = true;
		}
		segment = segment.replace(illegalCharacters, '');
		if (strict && osType === "Windows_NT") {
			segment = segment.replace(illegalNames, '');
			while (illegalTrailingCharacters.test(segment)) {
				segment = segment.replace(illegalTrailingCharacters, '');
			}
		}
		return segment;
	}
function(segment, strict) {
		if (!_.isString(segment)) {
			throw new TypeError('segment must be of type string');
		}
		if (!_.isBoolean(strict)) {
			strict = true;
		}
		segment = segment.replace(illegalCharacters, '');
		if (strict && osType === "Windows_NT") {
			segment = segment.replace(illegalNames, '');
			while (illegalTrailingCharacters.test(segment)) {
				segment = segment.replace(illegalTrailingCharacters, '');
			}
		}
		return segment;
	}
function ( segment , strict ) { if ( ! _ . isString ( segment ) ) { throw new TypeError ( 'segment must be of type string' ) ; } if ( ! _ . isBoolean ( strict ) ) { strict = true ; } segment = segment . replace ( illegalCharacters , '' ) ; if ( strict && osType === "Windows_NT" ) { segment = segment . replace ( illegalNames , '' ) ; while ( illegalTrailingCharacters . test ( segment ) ) { segment = segment . replace ( illegalTrailingCharacters , '' ) ; } } return segment ; }
Reformat fs segment to be valid

@param  {String} segment
@param  {Boolean=true} strict
@return {String}
Reformat fs segment to be valid