From 1f0e039b6e99cef2b1996f632f3f69f9cc2e77dc Mon Sep 17 00:00:00 2001 From: Doug Bird Date: Wed, 13 Dec 2017 23:07:20 -0800 Subject: [PATCH] Update README.md must use lowercase for valid TLD comparison --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2faf14c..ac0f528 100644 --- a/README.md +++ b/README.md @@ -36,18 +36,18 @@ The lists can be conveniently used in PHP or Node projects including this packag tldCheck = "com"; console.log("Is '" + tldCheck + "' a real TLD?"); - if (tldEnum.tldList.indexOf(tldCheck) != -1) { - console.log(" yes"); + if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) { + console.log(" yes"); } else { - console.log(" no"); + console.log(" no"); } tldCheck = "somethingWeird"; console.log("Is '" + tldCheck + "' a real TLD?"); - if (tldEnum.tldList.indexOf(tldCheck) != -1) { - console.log(" yes"); + if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) { + console.log(" yes"); } else { - console.log(" no"); + console.log(" no"); } ``` @@ -85,18 +85,18 @@ The lists can be conveniently used in PHP or Node projects including this packag $tldCheck = "com"; echo "Is '$tldCheck' a real TLD?\n"; - if (in_array($tldCheck, TldEnum::TLD_ENUM)) { - echo " yes\n"; + if (in_array(strtolower($tldCheck), TldEnum::TLD_ENUM)) { + echo " yes\n"; } else { - echo " no\n"; + echo " no\n"; } $tldCheck = "somethingWeird"; echo "Is '$tldCheck' a real TLD?\n"; - if (in_array($tldCheck, TldEnum::TLD_ENUM)) { - echo " yes\n"; + if (in_array(strtolower($tldCheck), TldEnum::TLD_ENUM)) { + echo " yes\n"; } else { - echo " no\n"; + echo " no\n"; } ```