wsemi 1.6.21 → 1.6.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci-test.yml +2 -1
- package/README.md +30 -30
- package/SECURITY.md +5 -0
- package/dist/wsemi.umd.js +3 -3
- package/dist/wsemi.umd.js.map +1 -1
- package/docs/-_class.mjs.html +2 -2
- package/docs/ab2blob.mjs.html +2 -2
- package/docs/ab2u8arr.mjs.html +2 -2
- package/docs/addMonth.mjs.html +2 -2
- package/docs/aes2str.mjs.html +2 -2
- package/docs/alive.mjs.html +2 -2
- package/docs/arr2dt.mjs.html +2 -2
- package/docs/arrAccum.mjs.html +2 -2
- package/docs/arrAdd.mjs.html +2 -2
- package/docs/arrAt.mjs.html +2 -2
- package/docs/arrFilter.mjs.html +2 -2
- package/docs/arrFind.mjs.html +2 -2
- package/docs/arrGroupByMaxmin.mjs.html +2 -2
- package/docs/arrHas.mjs.html +2 -2
- package/docs/arrInsert.mjs.html +2 -2
- package/docs/arrLookupByMaxmin.mjs.html +2 -2
- package/docs/arrSep.mjs.html +2 -2
- package/docs/arrSort.mjs.html +2 -2
- package/docs/asind.mjs.html +2 -2
- package/docs/atan2d.mjs.html +2 -2
- package/docs/atand.mjs.html +2 -2
- package/docs/b642obj.mjs.html +2 -2
- package/docs/b642str.mjs.html +2 -2
- package/docs/b642u16arr.mjs.html +2 -2
- package/docs/b642u8arr.mjs.html +2 -2
- package/docs/binstr.mjs.html +2 -2
- package/docs/blob2ab.mjs.html +2 -2
- package/docs/blob2b64.mjs.html +2 -2
- package/docs/blob2str.mjs.html +2 -2
- package/docs/blob2u8arr.mjs.html +2 -2
- package/docs/blobs2b64s.mjs.html +2 -2
- package/docs/blobs2u8arrs.mjs.html +2 -2
- package/docs/bodyLog.mjs.html +2 -2
- package/docs/browserView.mjs.html +2 -2
- package/docs/browserViewFromBlob.mjs.html +2 -2
- package/docs/browserViewFromText.mjs.html +2 -2
- package/docs/browserViewFromU8arr.mjs.html +2 -2
- package/docs/bs2u8arr.mjs.html +2 -2
- package/docs/bufRead.mjs.html +2 -2
- package/docs/bufReadDbl.mjs.html +2 -2
- package/docs/bufWrite.mjs.html +2 -2
- package/docs/bufWriteDbl.mjs.html +2 -2
- package/docs/cache.mjs.html +2 -2
- package/docs/cbol.mjs.html +2 -2
- package/docs/cdbl.mjs.html +2 -2
- package/docs/cfilesize.mjs.html +2 -2
- package/docs/cfinancial.mjs.html +2 -2
- package/docs/cint.mjs.html +2 -2
- package/docs/clearXSS.mjs.html +2 -2
- package/docs/color.mjs.html +2 -2
- package/docs/composeTreeObj.mjs.html +2 -2
- package/docs/copyStrToClipboard.mjs.html +2 -2
- package/docs/cosd.mjs.html +2 -2
- package/docs/cotd.mjs.html +2 -2
- package/docs/cscd.mjs.html +2 -2
- package/docs/cstr.mjs.html +2 -2
- package/docs/day2cht.mjs.html +2 -2
- package/docs/debounce.mjs.html +2 -2
- package/docs/delay.mjs.html +2 -2
- package/docs/dig.mjs.html +2 -2
- package/docs/digExp.mjs.html +2 -2
- package/docs/domAlert.mjs.html +2 -2
- package/docs/domAppend.mjs.html +2 -2
- package/docs/domCancelEvent.mjs.html +2 -2
- package/docs/domConvertToPic.mjs.html +3 -2
- package/docs/domConvertToPicDyn.mjs.html +2 -2
- package/docs/domDetect.mjs.html +2 -2
- package/docs/domDrag.mjs.html +2 -2
- package/docs/domDragBarAndScroll.mjs.html +2 -2
- package/docs/domDragPreview.mjs.html +2 -2
- package/docs/domDropFiles.mjs.html +2 -2
- package/docs/domFadeIn.mjs.html +2 -2
- package/docs/domFadeOut.mjs.html +2 -2
- package/docs/domFind.mjs.html +2 -2
- package/docs/domFinds.mjs.html +2 -2
- package/docs/domGetAttr.mjs.html +2 -2
- package/docs/domGetBoudRect.mjs.html +2 -2
- package/docs/domGetBoudRectRefSelf.mjs.html +2 -2
- package/docs/domGetFileAccept.mjs.html +2 -2
- package/docs/domGetFiles.mjs.html +2 -2
- package/docs/domGetPointFromEvent.mjs.html +2 -2
- package/docs/domGetScrollableParent.mjs.html +2 -2
- package/docs/domIsClientXYIn.mjs.html +2 -2
- package/docs/domIsFocused.mjs.html +2 -2
- package/docs/domIsVisible.mjs.html +2 -2
- package/docs/domPrepend.mjs.html +2 -2
- package/docs/domRemove.mjs.html +2 -2
- package/docs/domRipple.mjs.html +2 -2
- package/docs/domScrollIntoView.mjs.html +2 -2
- package/docs/domScrollTo.mjs.html +2 -2
- package/docs/domShowImages.mjs.html +2 -2
- package/docs/domShowImagesDyn.mjs.html +2 -2
- package/docs/domShowInputAndGetFiles.mjs.html +2 -2
- package/docs/domShowInputAndGetFilesU8Arrs.mjs.html +2 -2
- package/docs/domTooltip.mjs.html +2 -2
- package/docs/domTriggerEvent.mjs.html +2 -2
- package/docs/domVirtualCreate.mjs.html +2 -2
- package/docs/domVirtualCreateQueue.mjs.html +2 -2
- package/docs/downloadExcelFileFromData.mjs.html +2 -2
- package/docs/downloadExcelFileFromDataDyn.mjs.html +2 -2
- package/docs/downloadFileFromB64.mjs.html +2 -2
- package/docs/downloadFileFromBlob.mjs.html +2 -2
- package/docs/downloadFileFromText.mjs.html +2 -2
- package/docs/downloadFileFromU8Arr.mjs.html +2 -2
- package/docs/dtmapping.mjs.html +2 -2
- package/docs/dtpick.mjs.html +2 -2
- package/docs/evem.mjs.html +2 -2
- package/docs/examples/{ex-xss.html → ex-clearXSS.html} +2 -2
- package/docs/examples/ex-colorConverter.html +1 -1
- package/docs/examples/ex-cryptojs.html +1 -1
- package/docs/examples/ex-dayjs.html +1 -1
- package/docs/examples/{ex-html-to-image.html → ex-domConvertToPic.html} +2 -2
- package/docs/examples/{ex-html-to-image-dynamic.html → ex-domConvertToPicDyn.html} +2 -2
- package/docs/examples/ex-domDrag.html +1 -1
- package/docs/examples/ex-domDropFiles.html +1 -1
- package/docs/examples/ex-domIsVisible.html +1 -1
- package/docs/examples/ex-domRipple.html +1 -1
- package/docs/examples/{ex-scrollIntoView.html → ex-domScrollIntoView.html} +2 -2
- package/docs/examples/{ex-scrollTo.html → ex-domScrollTo.html} +2 -2
- package/docs/examples/{ex-viewerjs.html → ex-domShowImages.html} +2 -2
- package/docs/examples/{ex-viewerjs-dynamic.html → ex-domShowImagesDyn.html} +2 -2
- package/docs/examples/{ex-tippyjs.html → ex-domTooltip.html} +2 -2
- package/docs/examples/{ex-uaparser.html → ex-getUserAgent.html} +2 -2
- package/docs/examples/{ex-uaparser-dynamic.html → ex-getUserAgentDyn.html} +2 -2
- package/docs/examples/{ex-html2canvas.html → ex-html2pic.html} +2 -2
- package/docs/examples/{ex-html2canvas-dynamic.html → ex-html2picDyn.html} +2 -2
- package/docs/examples/{ex-htmlparser.html → ex-html2str.html} +2 -2
- package/docs/examples/{ex-htmlparser-dynamic.html → ex-html2strDyn.html} +2 -2
- package/docs/examples/ex-lodash.html +1 -1
- package/docs/examples/ex-obj2u8arr-u8arr2obj.html +1 -1
- package/docs/examples/{ex-tesseract.html → ex-ocr.html} +2 -2
- package/docs/examples/{ex-tesseract-dynamic.html → ex-ocrDyn.html} +2 -2
- package/docs/examples/{ex-openlink.html → ex-openLink.html} +1 -1
- package/docs/examples/{ex-fuzzball.html → ex-strFindFuzz.html} +2 -2
- package/docs/examples/{ex-fuzzball-dynamic.html → ex-strFindFuzzDyn.html} +2 -2
- package/docs/examples/ex-timeTZ2expire-timeTZ2past.html +1 -1
- package/docs/examples/ex-xlsx.html +1 -1
- package/docs/examples/{ex-xlsx-dynamic.html → ex-xlsxDyn.html} +1 -1
- package/docs/execScript.mjs.html +2 -2
- package/docs/f2c.mjs.html +2 -2
- package/docs/files2data.mjs.html +2 -2
- package/docs/flattenTreeObj.mjs.html +2 -2
- package/docs/fsCleanFolder.mjs.html +2 -2
- package/docs/fsCopyFolder.mjs.html +2 -2
- package/docs/fsCreateFolder.mjs.html +2 -2
- package/docs/fsDeleteFolder.mjs.html +2 -2
- package/docs/fsGetFilesInFolder.mjs.html +2 -2
- package/docs/fsGetFoldersInFolder.mjs.html +2 -2
- package/docs/fsIsFile.mjs.html +2 -2
- package/docs/fsIsFolder.mjs.html +2 -2
- package/docs/fsReadText.mjs.html +2 -2
- package/docs/fsTreeFolder.mjs.html +2 -2
- package/docs/fsWriteText.mjs.html +2 -2
- package/docs/genGradientColor.mjs.html +2 -2
- package/docs/genID.mjs.html +2 -2
- package/docs/genPm.mjs.html +2 -2
- package/docs/getBufferSize.mjs.html +2 -2
- package/docs/getClearPathName.mjs.html +2 -2
- package/docs/getCsvStrFromData.mjs.html +2 -2
- package/docs/getDataFromExcelFileU8Arr.mjs.html +2 -2
- package/docs/getDataFromExcelFileU8ArrDyn.mjs.html +2 -2
- package/docs/getDirName.mjs.html +2 -2
- package/docs/getEnv.mjs.html +2 -2
- package/docs/getExcelU8ArrFromData.mjs.html +2 -2
- package/docs/getExcelWorkbookFromData.mjs.html +2 -2
- package/docs/getExcelWorkbookFromWorksheet.mjs.html +2 -2
- package/docs/getFileAccept.mjs.html +2 -2
- package/docs/getFileName.mjs.html +2 -2
- package/docs/getFileTrueName.mjs.html +2 -2
- package/docs/getGlobal.mjs.html +2 -2
- package/docs/getObjSize.mjs.html +2 -2
- package/docs/getTimeBetween.mjs.html +2 -2
- package/docs/getTimeFromUnit.mjs.html +2 -2
- package/docs/getTimeObject.mjs.html +2 -2
- package/docs/getTimeRange.mjs.html +2 -2
- package/docs/getUserAgent.mjs.html +2 -2
- package/docs/getUserAgentDyn.mjs.html +2 -2
- package/docs/getltdtkeys.mjs.html +2 -2
- package/docs/haskey.mjs.html +4 -3
- package/docs/html2pic.mjs.html +2 -2
- package/docs/html2picDyn.mjs.html +2 -2
- package/docs/html2str.mjs.html +2 -2
- package/docs/html2strDyn.mjs.html +2 -2
- package/docs/htmlDecode.mjs.html +2 -2
- package/docs/htmlEncode.mjs.html +2 -2
- package/docs/importResources.mjs.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interp1.mjs.html +2 -2
- package/docs/isDev.mjs.html +2 -2
- package/docs/isEle.mjs.html +2 -2
- package/docs/isEleExistByID.mjs.html +2 -2
- package/docs/isEmail.mjs.html +2 -2
- package/docs/isIE.mjs.html +2 -2
- package/docs/isNarrow.mjs.html +2 -2
- package/docs/isStrHasCapital.mjs.html +2 -2
- package/docs/isStrHasLowerCase.mjs.html +2 -2
- package/docs/isStrHasNumber.mjs.html +2 -2
- package/docs/isUserIdentify.mjs.html +2 -2
- package/docs/isUserName.mjs.html +2 -2
- package/docs/isUserPW.mjs.html +2 -2
- package/docs/isWindow.mjs.html +2 -2
- package/docs/isab.mjs.html +2 -2
- package/docs/isarr.mjs.html +2 -2
- package/docs/isarr0.mjs.html +2 -2
- package/docs/isblob.mjs.html +2 -2
- package/docs/isbol.mjs.html +2 -2
- package/docs/isday.mjs.html +2 -2
- package/docs/isearr.mjs.html +2 -2
- package/docs/iseobj.mjs.html +2 -2
- package/docs/iser.mjs.html +2 -2
- package/docs/isernot.mjs.html +2 -2
- package/docs/isestr.mjs.html +2 -2
- package/docs/isfun.mjs.html +2 -2
- package/docs/isint.mjs.html +2 -2
- package/docs/ismonth.mjs.html +2 -2
- package/docs/isn0int.mjs.html +23 -2
- package/docs/isn0num.mjs.html +17 -8
- package/docs/isnbr.mjs.html +2 -2
- package/docs/isnint.mjs.html +23 -2
- package/docs/isnnum.mjs.html +127 -0
- package/docs/isnull.mjs.html +2 -2
- package/docs/isnum.mjs.html +2 -2
- package/docs/isobj.mjs.html +2 -2
- package/docs/isobj0.mjs.html +2 -2
- package/docs/isp0int.mjs.html +20 -2
- package/docs/isp0num.mjs.html +19 -4
- package/docs/ispint.mjs.html +21 -3
- package/docs/ispm.mjs.html +2 -2
- package/docs/ispnum.mjs.html +127 -0
- package/docs/isstr.mjs.html +2 -2
- package/docs/isstr0.mjs.html +2 -2
- package/docs/istime.mjs.html +2 -2
- package/docs/istimeTZ.mjs.html +2 -2
- package/docs/istimems.mjs.html +2 -2
- package/docs/istimemsTZ.mjs.html +2 -2
- package/docs/isu16arr.mjs.html +2 -2
- package/docs/isu8arr.mjs.html +2 -2
- package/docs/isundefined.mjs.html +2 -2
- package/docs/j2o.mjs.html +2 -2
- package/docs/keysmat2ltdt.mjs.html +2 -2
- package/docs/log.mjs.html +2 -2
- package/docs/ltdt2vrtsable.mjs.html +2 -2
- package/docs/ltdtdiff.mjs.html +2 -2
- package/docs/ltdtkeys2mat.mjs.html +2 -2
- package/docs/ltdtkeysheads2mat.mjs.html +2 -2
- package/docs/ltdtmapping.mjs.html +2 -2
- package/docs/ltdtmerge.mjs.html +2 -2
- package/docs/ltdtpick.mjs.html +2 -2
- package/docs/ltdtpull.mjs.html +2 -2
- package/docs/mat2ltdt.mjs.html +2 -2
- package/docs/matat.mjs.html +2 -2
- package/docs/now2str.mjs.html +2 -2
- package/docs/now2strp.mjs.html +2 -2
- package/docs/nowDay2str.mjs.html +2 -2
- package/docs/nowms2str.mjs.html +2 -2
- package/docs/nowms2strp.mjs.html +2 -2
- package/docs/o2j.mjs.html +2 -2
- package/docs/obj2b64.mjs.html +2 -2
- package/docs/obj2pb64.mjs.html +2 -2
- package/docs/obj2str.mjs.html +2 -2
- package/docs/obj2stru8arr.mjs.html +2 -2
- package/docs/obj2u8arr.mjs.html +2 -2
- package/docs/objSortBy.mjs.html +2 -2
- package/docs/ocr.mjs.html +2 -2
- package/docs/ocrDyn.mjs.html +2 -2
- package/docs/oo.mjs.html +2 -2
- package/docs/openLink.mjs.html +2 -2
- package/docs/pb642obj.mjs.html +2 -2
- package/docs/pm2resolve.mjs.html +2 -2
- package/docs/pmChain.mjs.html +2 -2
- package/docs/pmHook.mjs.html +2 -2
- package/docs/pmHookReject.mjs.html +2 -2
- package/docs/pmIni.mjs.html +2 -2
- package/docs/pmMap.mjs.html +2 -2
- package/docs/pmQueue.mjs.html +2 -2
- package/docs/pmSeries.mjs.html +2 -2
- package/docs/pmThrottle.mjs.html +2 -2
- package/docs/queue.mjs.html +2 -2
- package/docs/rep.mjs.html +2 -2
- package/docs/repObj.mjs.html +2 -2
- package/docs/replace.mjs.html +2 -2
- package/docs/replaceObj.mjs.html +2 -2
- package/docs/replacePlus.mjs.html +2 -2
- package/docs/round.mjs.html +2 -2
- package/docs/secd.mjs.html +2 -2
- package/docs/sep.mjs.html +2 -2
- package/docs/sepInt.mjs.html +2 -2
- package/docs/sind.mjs.html +2 -2
- package/docs/split.mjs.html +2 -2
- package/docs/str2aes.mjs.html +2 -2
- package/docs/str2b64.mjs.html +2 -2
- package/docs/str2md5.mjs.html +2 -2
- package/docs/str2obj.mjs.html +2 -2
- package/docs/str2sha512.mjs.html +2 -2
- package/docs/str2u8arr.mjs.html +2 -2
- package/docs/strCompare.mjs.html +2 -2
- package/docs/strFindFuzz.mjs.html +2 -2
- package/docs/strFindFuzzDyn.mjs.html +2 -2
- package/docs/strFindSimilar.mjs.html +2 -2
- package/docs/strdelleft.mjs.html +2 -2
- package/docs/strdelright.mjs.html +2 -2
- package/docs/strleft.mjs.html +2 -2
- package/docs/strmid.mjs.html +2 -2
- package/docs/strright.mjs.html +2 -2
- package/docs/stru8arr2obj.mjs.html +2 -2
- package/docs/tand.mjs.html +2 -2
- package/docs/time2day.mjs.html +2 -2
- package/docs/time2hour.mjs.html +2 -2
- package/docs/time2min.mjs.html +2 -2
- package/docs/timeTZ2day.mjs.html +2 -2
- package/docs/timeTZ2expire.mjs.html +2 -2
- package/docs/timeTZ2hour.mjs.html +2 -2
- package/docs/timeTZ2min.mjs.html +2 -2
- package/docs/timeTZ2past.mjs.html +2 -2
- package/docs/timems2day.mjs.html +2 -2
- package/docs/timems2hour.mjs.html +2 -2
- package/docs/timems2min.mjs.html +2 -2
- package/docs/timems2time.mjs.html +2 -2
- package/docs/timemsTZ2day.mjs.html +2 -2
- package/docs/timemsTZ2expire.mjs.html +2 -2
- package/docs/timemsTZ2hour.mjs.html +2 -2
- package/docs/timemsTZ2min.mjs.html +2 -2
- package/docs/timemsTZ2past.mjs.html +2 -2
- package/docs/timemsTZ2time.mjs.html +2 -2
- package/docs/treeObj.mjs.html +2 -2
- package/docs/trim.mjs.html +2 -2
- package/docs/u16arr2b64.mjs.html +2 -2
- package/docs/u16arr2u8arr.mjs.html +2 -2
- package/docs/u8arr2ab.mjs.html +2 -2
- package/docs/u8arr2b64.mjs.html +2 -2
- package/docs/u8arr2blob.mjs.html +2 -2
- package/docs/u8arr2bs.mjs.html +2 -2
- package/docs/u8arr2obj.mjs.html +2 -2
- package/docs/u8arr2str.mjs.html +2 -2
- package/docs/u8arr2u16arr.mjs.html +2 -2
- package/docs/urlParse.mjs.html +2 -2
- package/docs/verifyValue.mjs.html +2 -2
- package/docs/waitFun.mjs.html +2 -2
- package/docs/wsemi.html +508 -22
- package/examples/{ex-xss.html → ex-clearXSS.html} +1 -1
- package/examples/{ex-html-to-image.html → ex-domConvertToPic.html} +1 -1
- package/examples/{ex-html-to-image-dynamic.html → ex-domConvertToPicDyn.html} +1 -1
- package/examples/{ex-scrollIntoView.html → ex-domScrollIntoView.html} +1 -1
- package/examples/{ex-scrollTo.html → ex-domScrollTo.html} +1 -1
- package/examples/{ex-viewerjs.html → ex-domShowImages.html} +1 -1
- package/examples/{ex-viewerjs-dynamic.html → ex-domShowImagesDyn.html} +1 -1
- package/examples/{ex-tippyjs.html → ex-domTooltip.html} +1 -1
- package/examples/{ex-uaparser.html → ex-getUserAgent.html} +1 -1
- package/examples/{ex-uaparser-dynamic.html → ex-getUserAgentDyn.html} +1 -1
- package/examples/{ex-html2canvas.html → ex-html2pic.html} +1 -1
- package/examples/{ex-html2canvas-dynamic.html → ex-html2picDyn.html} +1 -1
- package/examples/{ex-htmlparser.html → ex-html2str.html} +1 -1
- package/examples/{ex-htmlparser-dynamic.html → ex-html2strDyn.html} +1 -1
- package/examples/{ex-tesseract.html → ex-ocr.html} +1 -1
- package/examples/{ex-tesseract-dynamic.html → ex-ocrDyn.html} +1 -1
- package/examples/{ex-openlink.html → ex-openLink.html} +0 -0
- package/examples/{ex-fuzzball.html → ex-strFindFuzz.html} +1 -1
- package/examples/{ex-fuzzball-dynamic.html → ex-strFindFuzzDyn.html} +1 -1
- package/examples/{ex-xlsx-dynamic.html → ex-xlsxDyn.html} +0 -0
- package/package.json +3 -3
- package/src/domConvertToPic.mjs +1 -0
- package/src/haskey.mjs +2 -1
- package/src/index.mjs +2 -0
- package/src/isn0int.mjs +21 -0
- package/src/isn0num.mjs +15 -6
- package/src/isnint.mjs +21 -0
- package/src/isnnum.mjs +58 -0
- package/src/isp0int.mjs +18 -0
- package/src/isp0num.mjs +17 -2
- package/src/ispint.mjs +19 -1
- package/src/ispnum.mjs +58 -0
- package/test/haskey.test.mjs +41 -0
- package/test/isn0num.test.mjs +5 -0
- package/test/isnnum.test.mjs +157 -0
- package/test/ispnum.test.mjs +157 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import isnnum from '../src/isnnum.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
describe(`isnnum`, function() {
|
|
6
|
+
|
|
7
|
+
it(`should return false when input '2019-01-01'`, function() {
|
|
8
|
+
let r = isnnum('2019-01-01')
|
|
9
|
+
assert.strict.deepStrictEqual(r, false)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it(`should return false when input '2019-21-01'`, function() {
|
|
13
|
+
let r = isnnum('2019-21-01')
|
|
14
|
+
assert.strict.deepStrictEqual(r, false)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it(`should return false when input '2019-01'`, function() {
|
|
18
|
+
let r = isnnum('2019-01')
|
|
19
|
+
assert.strict.deepStrictEqual(r, false)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it(`should return false when input '2019-21'`, function() {
|
|
23
|
+
let r = isnnum('2019-21')
|
|
24
|
+
assert.strict.deepStrictEqual(r, false)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it(`should return false when input function() {}`, function() {
|
|
28
|
+
let r = isnnum(function() {})
|
|
29
|
+
assert.strict.deepStrictEqual(r, false)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it(`should return false when input 0`, function() {
|
|
33
|
+
let r = isnnum(0)
|
|
34
|
+
assert.strict.deepStrictEqual(r, false)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it(`should return false when input 125`, function() {
|
|
38
|
+
let r = isnnum(125)
|
|
39
|
+
assert.strict.deepStrictEqual(r, false)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it(`should return true when input -125`, function() {
|
|
43
|
+
let r = isnnum(-125)
|
|
44
|
+
assert.strict.deepStrictEqual(r, true)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it(`should return false when input 1.25`, function() {
|
|
48
|
+
let r = isnnum(1.25)
|
|
49
|
+
assert.strict.deepStrictEqual(r, false)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it(`should return true when input -1.25`, function() {
|
|
53
|
+
let r = isnnum(-1.25)
|
|
54
|
+
assert.strict.deepStrictEqual(r, true)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it(`should return false when input '0'`, function() {
|
|
58
|
+
let r = isnnum('0')
|
|
59
|
+
assert.strict.deepStrictEqual(r, false)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it(`should return false when input '125'`, function() {
|
|
63
|
+
let r = isnnum('125')
|
|
64
|
+
assert.strict.deepStrictEqual(r, false)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it(`should return true when input '-125'`, function() {
|
|
68
|
+
let r = isnnum('-125')
|
|
69
|
+
assert.strict.deepStrictEqual(r, true)
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it(`should return false when input '1.25'`, function() {
|
|
73
|
+
let r = isnnum('1.25')
|
|
74
|
+
assert.strict.deepStrictEqual(r, false)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it(`should return true when input '-1.25'`, function() {
|
|
78
|
+
let r = isnnum('-1.25')
|
|
79
|
+
assert.strict.deepStrictEqual(r, true)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it(`should return false when input '125abc'`, function() {
|
|
83
|
+
let r = isnnum('125abc')
|
|
84
|
+
assert.strict.deepStrictEqual(r, false)
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it(`should return false when input 'abc125'`, function() {
|
|
88
|
+
let r = isnnum('abc125')
|
|
89
|
+
assert.strict.deepStrictEqual(r, false)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it(`should return false when input '12a5'`, function() {
|
|
93
|
+
let r = isnnum('12a5')
|
|
94
|
+
assert.strict.deepStrictEqual(r, false)
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it(`should return false when input ''`, function() {
|
|
98
|
+
let r = isnnum('')
|
|
99
|
+
assert.strict.deepStrictEqual(r, false)
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
it(`should return false when input false`, function() {
|
|
103
|
+
let r = isnnum(false)
|
|
104
|
+
assert.strict.deepStrictEqual(r, false)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
it(`should return false when input []`, function() {
|
|
108
|
+
let r = isnnum([])
|
|
109
|
+
assert.strict.deepStrictEqual(r, false)
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it(`should return false when input [{}]`, function() {
|
|
113
|
+
let r = isnnum([{}])
|
|
114
|
+
assert.strict.deepStrictEqual(r, false)
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it(`should return false when input [{ a: 123 }]`, function() {
|
|
118
|
+
let r = isnnum([{ a: 123 }])
|
|
119
|
+
assert.strict.deepStrictEqual(r, false)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it(`should return false when input ['']`, function() {
|
|
123
|
+
let r = isnnum([''])
|
|
124
|
+
assert.strict.deepStrictEqual(r, false)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it(`should return false when input ['abc']`, function() {
|
|
128
|
+
let r = isnnum(['abc'])
|
|
129
|
+
assert.strict.deepStrictEqual(r, false)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it(`should return false when input {}`, function() {
|
|
133
|
+
let r = isnnum({})
|
|
134
|
+
assert.strict.deepStrictEqual(r, false)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it(`should return false when input { a: 123 }`, function() {
|
|
138
|
+
let r = isnnum({ a: 123 })
|
|
139
|
+
assert.strict.deepStrictEqual(r, false)
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it(`should return false when input { a: 123, b: null, c: [45.67] }`, function() {
|
|
143
|
+
let r = isnnum({ a: 123, b: null, c: [45.67] })
|
|
144
|
+
assert.strict.deepStrictEqual(r, false)
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it(`should return false when input null`, function() {
|
|
148
|
+
let r = isnnum(null)
|
|
149
|
+
assert.strict.deepStrictEqual(r, false)
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it(`should return false when input undefined`, function() {
|
|
153
|
+
let r = isnnum(undefined)
|
|
154
|
+
assert.strict.deepStrictEqual(r, false)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
})
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import ispnum from '../src/ispnum.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
describe(`ispnum`, function() {
|
|
6
|
+
|
|
7
|
+
it(`should return false when input '2019-01-01'`, function() {
|
|
8
|
+
let r = ispnum('2019-01-01')
|
|
9
|
+
assert.strict.deepStrictEqual(r, false)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it(`should return false when input '2019-21-01'`, function() {
|
|
13
|
+
let r = ispnum('2019-21-01')
|
|
14
|
+
assert.strict.deepStrictEqual(r, false)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it(`should return false when input '2019-01'`, function() {
|
|
18
|
+
let r = ispnum('2019-01')
|
|
19
|
+
assert.strict.deepStrictEqual(r, false)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it(`should return false when input '2019-21'`, function() {
|
|
23
|
+
let r = ispnum('2019-21')
|
|
24
|
+
assert.strict.deepStrictEqual(r, false)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it(`should return false when input function() {}`, function() {
|
|
28
|
+
let r = ispnum(function() {})
|
|
29
|
+
assert.strict.deepStrictEqual(r, false)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it(`should return false when input 0`, function() {
|
|
33
|
+
let r = ispnum(0)
|
|
34
|
+
assert.strict.deepStrictEqual(r, false)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it(`should return true when input 125`, function() {
|
|
38
|
+
let r = ispnum(125)
|
|
39
|
+
assert.strict.deepStrictEqual(r, true)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it(`should return false when input -125`, function() {
|
|
43
|
+
let r = ispnum(-125)
|
|
44
|
+
assert.strict.deepStrictEqual(r, false)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it(`should return true when input 1.25`, function() {
|
|
48
|
+
let r = ispnum(1.25)
|
|
49
|
+
assert.strict.deepStrictEqual(r, true)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it(`should return false when input -1.25`, function() {
|
|
53
|
+
let r = ispnum(-1.25)
|
|
54
|
+
assert.strict.deepStrictEqual(r, false)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it(`should return false when input '0'`, function() {
|
|
58
|
+
let r = ispnum('0')
|
|
59
|
+
assert.strict.deepStrictEqual(r, false)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it(`should return true when input '125'`, function() {
|
|
63
|
+
let r = ispnum('125')
|
|
64
|
+
assert.strict.deepStrictEqual(r, true)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it(`should return false when input '-125'`, function() {
|
|
68
|
+
let r = ispnum('-125')
|
|
69
|
+
assert.strict.deepStrictEqual(r, false)
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it(`should return true when input '1.25'`, function() {
|
|
73
|
+
let r = ispnum('1.25')
|
|
74
|
+
assert.strict.deepStrictEqual(r, true)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it(`should return false when input '-1.25'`, function() {
|
|
78
|
+
let r = ispnum('-1.25')
|
|
79
|
+
assert.strict.deepStrictEqual(r, false)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it(`should return false when input '125abc'`, function() {
|
|
83
|
+
let r = ispnum('125abc')
|
|
84
|
+
assert.strict.deepStrictEqual(r, false)
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it(`should return false when input 'abc125'`, function() {
|
|
88
|
+
let r = ispnum('abc125')
|
|
89
|
+
assert.strict.deepStrictEqual(r, false)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it(`should return false when input '12a5'`, function() {
|
|
93
|
+
let r = ispnum('12a5')
|
|
94
|
+
assert.strict.deepStrictEqual(r, false)
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it(`should return false when input ''`, function() {
|
|
98
|
+
let r = ispnum('')
|
|
99
|
+
assert.strict.deepStrictEqual(r, false)
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
it(`should return false when input false`, function() {
|
|
103
|
+
let r = ispnum(false)
|
|
104
|
+
assert.strict.deepStrictEqual(r, false)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
it(`should return false when input []`, function() {
|
|
108
|
+
let r = ispnum([])
|
|
109
|
+
assert.strict.deepStrictEqual(r, false)
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it(`should return false when input [{}]`, function() {
|
|
113
|
+
let r = ispnum([{}])
|
|
114
|
+
assert.strict.deepStrictEqual(r, false)
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it(`should return false when input [{ a: 123 }]`, function() {
|
|
118
|
+
let r = ispnum([{ a: 123 }])
|
|
119
|
+
assert.strict.deepStrictEqual(r, false)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it(`should return false when input ['']`, function() {
|
|
123
|
+
let r = ispnum([''])
|
|
124
|
+
assert.strict.deepStrictEqual(r, false)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it(`should return false when input ['abc']`, function() {
|
|
128
|
+
let r = ispnum(['abc'])
|
|
129
|
+
assert.strict.deepStrictEqual(r, false)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it(`should return false when input {}`, function() {
|
|
133
|
+
let r = ispnum({})
|
|
134
|
+
assert.strict.deepStrictEqual(r, false)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it(`should return false when input { a: 123 }`, function() {
|
|
138
|
+
let r = ispnum({ a: 123 })
|
|
139
|
+
assert.strict.deepStrictEqual(r, false)
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it(`should return false when input { a: 123, b: null, c: [45.67] }`, function() {
|
|
143
|
+
let r = ispnum({ a: 123, b: null, c: [45.67] })
|
|
144
|
+
assert.strict.deepStrictEqual(r, false)
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it(`should return false when input null`, function() {
|
|
148
|
+
let r = ispnum(null)
|
|
149
|
+
assert.strict.deepStrictEqual(r, false)
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it(`should return false when input undefined`, function() {
|
|
153
|
+
let r = ispnum(undefined)
|
|
154
|
+
assert.strict.deepStrictEqual(r, false)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
})
|