From e0b1e3df773c8b60d523a8feac6f7242e0f70d88 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Tue, 6 Jun 2023 22:47:19 +0200 Subject: Remove unnecessary braces --- south-african-id-parser.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'south-african-id-parser.js') diff --git a/south-african-id-parser.js b/south-african-id-parser.js index 81b2302..8e233e7 100644 --- a/south-african-id-parser.js +++ b/south-african-id-parser.js @@ -8,7 +8,7 @@ } else { global.saIdParser = factory(); } -}(this, (function () { +}(this, function () { 'use strict'; return { @@ -92,7 +92,7 @@ return undefined; } - //get year, and assume century + // get year, and assume century var currentYear = new Date().getFullYear(); var currentCentury = Math.floor(currentYear/100)*100; var yearPart = currentCentury + parseInt(idNumber.substring(0,2), 10); @@ -100,14 +100,14 @@ yearPart -= 100; //must be last century } - //In Javascript, Jan=0. In ID Numbers, Jan=1. + // In Javascript, Jan=0. In ID Numbers, Jan=1. var monthPart = parseInt(idNumber.substring(2,4), 10)-1; var dayPart = parseInt(idNumber.substring(4,6), 10); var dateOfBirth = new Date(yearPart, monthPart, dayPart); - //validate that date is in a valid range by making sure that it wasn't 'corrected' during construction + // validate that date is in a valid range by making sure that it wasn't 'corrected' during construction if (!dateOfBirth || dateOfBirth.getFullYear() !== yearPart || dateOfBirth.getMonth() !== monthPart || dateOfBirth.getDate() !== dayPart) { return undefined; } @@ -132,4 +132,4 @@ } return parseInt(idNumber[10], 10) === 0; } -}))); +})); -- cgit v1.2.3