forked from Qortal/Q-Apps-Utils
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			347 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			347 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
export const getFileExtensionIndex = (s: string) => {
 | 
						|
  const lastIndex = s.lastIndexOf(".");
 | 
						|
  return lastIndex > 0 ? lastIndex : s.length - 1;
 | 
						|
};
 | 
						|
 | 
						|
export const getFileName = (s: string) => {
 | 
						|
  return s.substring(0, getFileExtensionIndex(s));
 | 
						|
};
 | 
						|
 | 
						|
export const isNumber = (input: string) => {
 | 
						|
  const num = Number(input);
 | 
						|
  return !isNaN(num);
 | 
						|
};
 |