mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-03 04:49:13 -04:00
chore(lint): switched to a better lint config
This commit is contained in:
parent
4d2b037dbe
commit
33c9b6643f
178 changed files with 4105 additions and 3371 deletions
|
@ -1,7 +1,9 @@
|
|||
export const MIN_ARABIC_TO_ROMAN = 1;
|
||||
export const MAX_ARABIC_TO_ROMAN = 3999;
|
||||
export function arabicToRoman(num: number) {
|
||||
if (num < MIN_ARABIC_TO_ROMAN || num > MAX_ARABIC_TO_ROMAN) return '';
|
||||
if (num < MIN_ARABIC_TO_ROMAN || num > MAX_ARABIC_TO_ROMAN) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const lookup: { [key: string]: number } = {
|
||||
M: 1000,
|
||||
|
@ -28,7 +30,7 @@ export function arabicToRoman(num: number) {
|
|||
return roman;
|
||||
}
|
||||
|
||||
const ROMAN_NUMBER_REGEX = new RegExp(/^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/);
|
||||
const ROMAN_NUMBER_REGEX = /^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/;
|
||||
|
||||
export function isValidRomanNumber(romanNumber: string) {
|
||||
return ROMAN_NUMBER_REGEX.test(romanNumber);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue