Added tsc check and other small things
This commit is contained in:
		
							parent
							
								
									349f53ea27
								
							
						
					
					
						commit
						fcd4ba9385
					
				| @ -7,7 +7,8 @@ | ||||
|     "postbuild": "next-sitemap", | ||||
|     "start": "next start", | ||||
|     "lint": "next lint", | ||||
|     "generate": "graphql-codegen --config graphql-codegen.js" | ||||
|     "generate": "graphql-codegen --config graphql-codegen.js", | ||||
|     "tsc": "tsc" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@fontsource/material-icons": "^4.5.4", | ||||
|  | ||||
| @ -53,6 +53,16 @@ export enum ImageQuality { | ||||
|   Og = "og", | ||||
| } | ||||
| 
 | ||||
| export function getAssetFilename(path: string): string { | ||||
|   let result = path.split("/"); | ||||
|   result = result[result.length - 1].split("."); | ||||
|   result = result | ||||
|     .splice(0, result.length - 1) | ||||
|     .join(".") | ||||
|     .split("_"); | ||||
|   return result[0]; | ||||
| } | ||||
| 
 | ||||
| export function getAssetURL(url: string, quality: ImageQuality): string { | ||||
|   let newUrl = url; | ||||
|   newUrl = newUrl.replace(/^\/uploads/u, `/${quality}`); | ||||
|  | ||||
| @ -443,3 +443,8 @@ export function getPreferredLanguage( | ||||
|   } | ||||
|   return undefined; | ||||
| } | ||||
| 
 | ||||
| export function isInteger(value: string): boolean { | ||||
|   // eslint-disable-next-line require-unicode-regexp
 | ||||
|   return /^[+-]?[0-9]+$/.test(value); | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 DrMint
						DrMint