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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for xss</title>
|
|
5
|
+
<title>examples for clearXSS(xss)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for html-to-image</title>
|
|
5
|
+
<title>examples for domConvertToPic(html-to-image)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄, 因html-to-image不支援IE11故不須引用 -->
|
|
8
8
|
<script nomodule _src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for html-to-image
|
|
5
|
+
<title>examples for domConvertToPicDyn(html-to-image)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for
|
|
5
|
+
<title>examples for domScrollIntoView</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for
|
|
5
|
+
<title>examples for domScrollTo</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for viewerjs</title>
|
|
5
|
+
<title>examples for domShowImages(viewerjs)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for viewerjs
|
|
5
|
+
<title>examples for domShowImagesDyn(viewerjs)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for
|
|
5
|
+
<title>examples for domTooltip</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for ua-parser-js</title>
|
|
5
|
+
<title>examples for getUserAgent(ua-parser-js)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for ua-parser-js
|
|
5
|
+
<title>examples for getUserAgentDyn(ua-parser-js)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for html2canvas</title>
|
|
5
|
+
<title>examples for html2pic(html2canvas)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for html2canvas
|
|
5
|
+
<title>examples for html2picDyn(html2canvas)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for htmlparser</title>
|
|
5
|
+
<title>examples for html2str(htmlparser)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for htmlparser</title>
|
|
5
|
+
<title>examples for html2strDyn(htmlparser)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for tesseract.js</title>
|
|
5
|
+
<title>examples for ocr(tesseract.js)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for tesseract.js
|
|
5
|
+
<title>examples for ocrDyn(tesseract.js)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for fuzzball</title>
|
|
5
|
+
<title>examples for strFindFuzz(fuzzball)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
-
<title>examples for fuzzball
|
|
5
|
+
<title>examples for strFindFuzzDyn(fuzzball)</title>
|
|
6
6
|
|
|
7
7
|
<!-- @babel/polyfill已廢棄 -->
|
|
8
8
|
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wsemi",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.25",
|
|
4
4
|
"description": "A support package for web developer.",
|
|
5
5
|
"main": "dist/wsemi.umd.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"ua-parser-js": "^0.7.28",
|
|
17
17
|
"viewerjs": "^1.10.1",
|
|
18
18
|
"xlsx": "^0.17.2",
|
|
19
|
-
"xss": "^1.0.
|
|
19
|
+
"xss": "^1.0.10"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"cheerio": "^1.0.0-rc.10",
|
|
23
|
-
"w-package-tools": "^1.0.
|
|
23
|
+
"w-package-tools": "^1.0.59"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
|
package/src/domConvertToPic.mjs
CHANGED
package/src/haskey.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import isobj from './isobj.mjs'
|
|
2
2
|
import isestr from './isestr.mjs'
|
|
3
|
+
import isnum from './isnum.mjs'
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -22,7 +23,7 @@ function haskey(obj, key) {
|
|
|
22
23
|
if (!isobj(obj)) {
|
|
23
24
|
return false
|
|
24
25
|
}
|
|
25
|
-
if (!isestr(key)) {
|
|
26
|
+
if (!isestr(key) && !isnum(key)) {
|
|
26
27
|
return false
|
|
27
28
|
}
|
|
28
29
|
|
package/src/index.mjs
CHANGED
|
@@ -177,6 +177,7 @@ export { default as isn0num } from './isn0num.mjs'
|
|
|
177
177
|
export { default as isNarrow } from './isNarrow.mjs'
|
|
178
178
|
export { default as isnbr } from './isnbr.mjs'
|
|
179
179
|
export { default as isnint } from './isnint.mjs'
|
|
180
|
+
export { default as isnnum } from './isnnum.mjs'
|
|
180
181
|
export { default as isnull } from './isnull.mjs'
|
|
181
182
|
export { default as isnum } from './isnum.mjs'
|
|
182
183
|
export { default as isobj } from './isobj.mjs'
|
|
@@ -185,6 +186,7 @@ export { default as isp0int } from './isp0int.mjs'
|
|
|
185
186
|
export { default as isp0num } from './isp0num.mjs'
|
|
186
187
|
export { default as ispint } from './ispint.mjs'
|
|
187
188
|
export { default as ispm } from './ispm.mjs'
|
|
189
|
+
export { default as ispnum } from './ispnum.mjs'
|
|
188
190
|
export { default as isstr } from './isstr.mjs'
|
|
189
191
|
export { default as isstr0 } from './isstr0.mjs'
|
|
190
192
|
export { default as isStrHasCapital } from './isStrHasCapital.mjs'
|
package/src/isn0int.mjs
CHANGED
|
@@ -15,12 +15,33 @@ import cint from './cint.mjs'
|
|
|
15
15
|
* console.log(isn0int(0))
|
|
16
16
|
* // => true
|
|
17
17
|
*
|
|
18
|
+
* console.log(isn0int('0'))
|
|
19
|
+
* // => true
|
|
20
|
+
*
|
|
18
21
|
* console.log(isn0int(125))
|
|
19
22
|
* // => false
|
|
20
23
|
*
|
|
24
|
+
* console.log(isn0int(1.25))
|
|
25
|
+
* // => false
|
|
26
|
+
*
|
|
27
|
+
* console.log(isn0int('125'))
|
|
28
|
+
* // => false
|
|
29
|
+
*
|
|
30
|
+
* console.log(isn0int('1.25'))
|
|
31
|
+
* // => false
|
|
32
|
+
|
|
21
33
|
* console.log(isn0int(-125))
|
|
22
34
|
* // => true
|
|
23
35
|
*
|
|
36
|
+
* console.log(isn0int(-1.25))
|
|
37
|
+
* // => false
|
|
38
|
+
*
|
|
39
|
+
* console.log(isn0int('-125'))
|
|
40
|
+
* // => true
|
|
41
|
+
*
|
|
42
|
+
* console.log(isn0int('-1.25'))
|
|
43
|
+
* // => false
|
|
44
|
+
*
|
|
24
45
|
*/
|
|
25
46
|
function isn0int(v) {
|
|
26
47
|
|
package/src/isn0num.mjs
CHANGED
|
@@ -15,24 +15,33 @@ import cdbl from './cdbl.mjs'
|
|
|
15
15
|
* console.log(isn0num(0))
|
|
16
16
|
* // => true
|
|
17
17
|
*
|
|
18
|
+
* console.log(isn0num('0'))
|
|
19
|
+
* // => true
|
|
20
|
+
*
|
|
21
|
+
* console.log(isn0num(125))
|
|
22
|
+
* // => false
|
|
23
|
+
*
|
|
24
|
+
* console.log(isn0num(1.25))
|
|
25
|
+
* // => false
|
|
26
|
+
*
|
|
27
|
+
* console.log(isn0num('125'))
|
|
28
|
+
* // => false
|
|
29
|
+
*
|
|
30
|
+
* console.log(isn0num('1.25'))
|
|
31
|
+
* // => false
|
|
32
|
+
*
|
|
18
33
|
* console.log(isn0num(-125))
|
|
19
34
|
* // => true
|
|
20
35
|
*
|
|
21
36
|
* console.log(isn0num(-1.25))
|
|
22
37
|
* // => true
|
|
23
38
|
*
|
|
24
|
-
* console.log(isn0num(125))
|
|
25
|
-
* // => false
|
|
26
|
-
*
|
|
27
39
|
* console.log(isn0num('-125'))
|
|
28
40
|
* // => true
|
|
29
41
|
*
|
|
30
42
|
* console.log(isn0num('-1.25'))
|
|
31
43
|
* // => true
|
|
32
44
|
*
|
|
33
|
-
* console.log(isn0num('125'))
|
|
34
|
-
* // => false
|
|
35
|
-
*
|
|
36
45
|
*/
|
|
37
46
|
function isn0num(v) {
|
|
38
47
|
|
package/src/isnint.mjs
CHANGED
|
@@ -15,12 +15,33 @@ import cint from './cint.mjs'
|
|
|
15
15
|
* console.log(isnint(0))
|
|
16
16
|
* // => false
|
|
17
17
|
*
|
|
18
|
+
* console.log(isnint('0'))
|
|
19
|
+
* // => false
|
|
20
|
+
*
|
|
18
21
|
* console.log(isnint(125))
|
|
19
22
|
* // => false
|
|
20
23
|
*
|
|
24
|
+
* console.log(isnint(1.25))
|
|
25
|
+
* // => false
|
|
26
|
+
*
|
|
27
|
+
* console.log(isnint('125'))
|
|
28
|
+
* // => false
|
|
29
|
+
*
|
|
30
|
+
* console.log(isnint('1.25'))
|
|
31
|
+
* // => false
|
|
32
|
+
|
|
21
33
|
* console.log(isnint(-125))
|
|
22
34
|
* // => true
|
|
23
35
|
*
|
|
36
|
+
* console.log(isnint(-1.25))
|
|
37
|
+
* // => false
|
|
38
|
+
*
|
|
39
|
+
* console.log(isnint('-125'))
|
|
40
|
+
* // => true
|
|
41
|
+
*
|
|
42
|
+
* console.log(isnint('-1.25'))
|
|
43
|
+
* // => false
|
|
44
|
+
*
|
|
24
45
|
*/
|
|
25
46
|
function isnint(v) {
|
|
26
47
|
|
package/src/isnnum.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import isnum from './isnum.mjs'
|
|
2
|
+
import cdbl from './cdbl.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 判斷是否為小於0浮點數
|
|
7
|
+
*
|
|
8
|
+
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/isnnum.test.mjs Github}
|
|
9
|
+
* @memberOf wsemi
|
|
10
|
+
* @param {*} v 輸入任意資料
|
|
11
|
+
* @returns {Boolean} 回傳判斷布林值
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* console.log(isnnum(0))
|
|
15
|
+
* // => false
|
|
16
|
+
*
|
|
17
|
+
* console.log(isnnum('0'))
|
|
18
|
+
* // => false
|
|
19
|
+
*
|
|
20
|
+
* console.log(isnnum(125))
|
|
21
|
+
* // => false
|
|
22
|
+
*
|
|
23
|
+
* console.log(isnnum(1.25))
|
|
24
|
+
* // => false
|
|
25
|
+
*
|
|
26
|
+
* console.log(isnnum('125'))
|
|
27
|
+
* // => false
|
|
28
|
+
*
|
|
29
|
+
* console.log(isnnum('1.25'))
|
|
30
|
+
* // => false
|
|
31
|
+
*
|
|
32
|
+
* console.log(isnnum(-125))
|
|
33
|
+
* // => true
|
|
34
|
+
*
|
|
35
|
+
* console.log(isnnum(-1.25))
|
|
36
|
+
* // => true
|
|
37
|
+
*
|
|
38
|
+
* console.log(isnnum('-125'))
|
|
39
|
+
* // => true
|
|
40
|
+
*
|
|
41
|
+
* console.log(isnnum('-1.25'))
|
|
42
|
+
* // => true
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
function isnnum(v) {
|
|
46
|
+
|
|
47
|
+
//check
|
|
48
|
+
if (!isnum(v)) {
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let r = cdbl(v) < 0
|
|
53
|
+
|
|
54
|
+
return r
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
export default isnnum
|
package/src/isp0int.mjs
CHANGED
|
@@ -15,6 +15,9 @@ import cint from './cint.mjs'
|
|
|
15
15
|
* console.log(isp0int(0))
|
|
16
16
|
* // => true
|
|
17
17
|
*
|
|
18
|
+
* console.log(isp0int('0'))
|
|
19
|
+
* // => true
|
|
20
|
+
*
|
|
18
21
|
* console.log(isp0int(125))
|
|
19
22
|
* // => true
|
|
20
23
|
*
|
|
@@ -24,6 +27,21 @@ import cint from './cint.mjs'
|
|
|
24
27
|
* console.log(isp0int('125'))
|
|
25
28
|
* // => true
|
|
26
29
|
*
|
|
30
|
+
* console.log(isp0int('1.25'))
|
|
31
|
+
* // => false
|
|
32
|
+
|
|
33
|
+
* console.log(isp0int(-125))
|
|
34
|
+
* // => false
|
|
35
|
+
*
|
|
36
|
+
* console.log(isp0int(-1.25))
|
|
37
|
+
* // => false
|
|
38
|
+
*
|
|
39
|
+
* console.log(isp0int('-125'))
|
|
40
|
+
* // => false
|
|
41
|
+
*
|
|
42
|
+
* console.log(isp0int('-1.25'))
|
|
43
|
+
* // => false
|
|
44
|
+
*
|
|
27
45
|
*/
|
|
28
46
|
function isp0int(v) {
|
|
29
47
|
|
package/src/isp0num.mjs
CHANGED
|
@@ -15,17 +15,32 @@ import cdbl from './cdbl.mjs'
|
|
|
15
15
|
* console.log(isp0num(0))
|
|
16
16
|
* // => true
|
|
17
17
|
*
|
|
18
|
+
* console.log(isp0num('0'))
|
|
19
|
+
* // => true
|
|
20
|
+
*
|
|
18
21
|
* console.log(isp0num(125))
|
|
19
22
|
* // => true
|
|
20
23
|
*
|
|
21
24
|
* console.log(isp0num(1.25))
|
|
22
25
|
* // => true
|
|
23
26
|
*
|
|
24
|
-
* console.log(isp0num(
|
|
25
|
-
* // =>
|
|
27
|
+
* console.log(isp0num('125'))
|
|
28
|
+
* // => true
|
|
26
29
|
*
|
|
27
30
|
* console.log(isp0num('1.25'))
|
|
28
31
|
* // => true
|
|
32
|
+
|
|
33
|
+
* console.log(isp0num(-125))
|
|
34
|
+
* // => false
|
|
35
|
+
*
|
|
36
|
+
* console.log(isp0num(-1.25))
|
|
37
|
+
* // => false
|
|
38
|
+
*
|
|
39
|
+
* console.log(isp0num('-125'))
|
|
40
|
+
* // => false
|
|
41
|
+
*
|
|
42
|
+
* console.log(isp0num('-1.25'))
|
|
43
|
+
* // => false
|
|
29
44
|
*
|
|
30
45
|
*/
|
|
31
46
|
function isp0num(v) {
|
package/src/ispint.mjs
CHANGED
|
@@ -15,13 +15,31 @@ import cint from './cint.mjs'
|
|
|
15
15
|
* console.log(ispint(0))
|
|
16
16
|
* // => false
|
|
17
17
|
*
|
|
18
|
+
* console.log(ispint('0'))
|
|
19
|
+
* // => false
|
|
20
|
+
*
|
|
18
21
|
* console.log(ispint(125))
|
|
19
22
|
* // => true
|
|
20
23
|
*
|
|
24
|
+
* console.log(ispint(1.25))
|
|
25
|
+
* // => false
|
|
26
|
+
*
|
|
21
27
|
* console.log(ispint('125'))
|
|
22
28
|
* // => true
|
|
23
29
|
*
|
|
24
|
-
* console.log(ispint(1.25))
|
|
30
|
+
* console.log(ispint('1.25'))
|
|
31
|
+
* // => false
|
|
32
|
+
|
|
33
|
+
* console.log(ispint(-125))
|
|
34
|
+
* // => false
|
|
35
|
+
*
|
|
36
|
+
* console.log(ispint(-1.25))
|
|
37
|
+
* // => false
|
|
38
|
+
*
|
|
39
|
+
* console.log(ispint('-125'))
|
|
40
|
+
* // => false
|
|
41
|
+
*
|
|
42
|
+
* console.log(ispint('-1.25'))
|
|
25
43
|
* // => false
|
|
26
44
|
*
|
|
27
45
|
*/
|
package/src/ispnum.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import isnum from './isnum.mjs'
|
|
2
|
+
import cdbl from './cdbl.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 判斷是否為大於0浮點數
|
|
7
|
+
*
|
|
8
|
+
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/ispnum.test.mjs Github}
|
|
9
|
+
* @memberOf wsemi
|
|
10
|
+
* @param {*} v 輸入任意資料
|
|
11
|
+
* @returns {Boolean} 回傳判斷布林值
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* console.log(ispnum(0))
|
|
15
|
+
* // => false
|
|
16
|
+
*
|
|
17
|
+
* console.log(ispnum('0'))
|
|
18
|
+
* // => false
|
|
19
|
+
*
|
|
20
|
+
* console.log(ispnum(125))
|
|
21
|
+
* // => true
|
|
22
|
+
*
|
|
23
|
+
* console.log(ispnum(1.25))
|
|
24
|
+
* // => true
|
|
25
|
+
*
|
|
26
|
+
* console.log(ispnum('125'))
|
|
27
|
+
* // => true
|
|
28
|
+
*
|
|
29
|
+
* console.log(ispnum('1.25'))
|
|
30
|
+
* // => true
|
|
31
|
+
|
|
32
|
+
* console.log(ispnum(-125))
|
|
33
|
+
* // => false
|
|
34
|
+
*
|
|
35
|
+
* console.log(ispnum(-1.25))
|
|
36
|
+
* // => false
|
|
37
|
+
*
|
|
38
|
+
* console.log(ispnum('-125'))
|
|
39
|
+
* // => false
|
|
40
|
+
*
|
|
41
|
+
* console.log(ispnum('-1.25'))
|
|
42
|
+
* // => false
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
function ispnum(v) {
|
|
46
|
+
|
|
47
|
+
//check
|
|
48
|
+
if (!isnum(v)) {
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let r = cdbl(v) > 0
|
|
53
|
+
|
|
54
|
+
return r
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
export default ispnum
|
package/test/haskey.test.mjs
CHANGED
|
@@ -4,6 +4,47 @@ import haskey from '../src/haskey.mjs'
|
|
|
4
4
|
|
|
5
5
|
describe(`haskey`, function() {
|
|
6
6
|
|
|
7
|
+
it(`should return true when input { 1: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, 1`, function() {
|
|
8
|
+
let r = haskey({ 1: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, 1)
|
|
9
|
+
assert.strict.deepStrictEqual(r, true)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it(`should return true when input { 1: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, '1'`, function() {
|
|
13
|
+
let r = haskey({ 1: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, '1')
|
|
14
|
+
assert.strict.deepStrictEqual(r, true) //字串型數字key會自動轉成數字
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it(`should return true when input { 1.2: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, 1.2`, function() {
|
|
18
|
+
let r = haskey({ 1.2: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, 1.2)
|
|
19
|
+
assert.strict.deepStrictEqual(r, true)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it(`should return true when input { 1.2: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, '1.2'`, function() {
|
|
23
|
+
let r = haskey({ 1.2: 'abc', a: 123, b: 'xyz', c: '45op', d: null }, '1.2')
|
|
24
|
+
assert.strict.deepStrictEqual(r, true) //字串型數字key會自動轉成數字
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
it(`should return true when input { '1': 'abc', a: 123, b: 'xyz', c: '45op', d: null }, 1`, function() {
|
|
29
|
+
let r = haskey({ '1': 'abc', 'a': 123, 'b': 'xyz', 'c': '45op', 'd': null }, 1)
|
|
30
|
+
assert.strict.deepStrictEqual(r, true) //數字key會自動轉成字串才判斷
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it(`should return true when input { '1': 'abc', a: 123, b: 'xyz', c: '45op', d: null }, '1'`, function() {
|
|
34
|
+
let r = haskey({ '1': 'abc', 'a': 123, 'b': 'xyz', 'c': '45op', 'd': null }, '1')
|
|
35
|
+
assert.strict.deepStrictEqual(r, true)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it(`should return true when input { '1.2': 'abc', a: 123, b: 'xyz', c: '45op', d: null }, 1.2`, function() {
|
|
39
|
+
let r = haskey({ '1.2': 'abc', 'a': 123, 'b': 'xyz', 'c': '45op', 'd': null }, 1.2)
|
|
40
|
+
assert.strict.deepStrictEqual(r, true) //數字key會自動轉成字串才判斷
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it(`should return true when input { '1.2': 'abc', a: 123, b: 'xyz', c: '45op', d: null }, '1.2'`, function() {
|
|
44
|
+
let r = haskey({ '1.2': 'abc', 'a': 123, 'b': 'xyz', 'c': '45op', 'd': null }, '1.2')
|
|
45
|
+
assert.strict.deepStrictEqual(r, true)
|
|
46
|
+
})
|
|
47
|
+
|
|
7
48
|
it(`should return true when input { a: 123, b: 'xyz', c: '45op', d: null }, 'a'`, function() {
|
|
8
49
|
let r = haskey({ a: 123, b: 'xyz', c: '45op', d: null }, 'a')
|
|
9
50
|
assert.strict.deepStrictEqual(r, true)
|
package/test/isn0num.test.mjs
CHANGED
|
@@ -34,6 +34,11 @@ describe(`isn0num`, function() {
|
|
|
34
34
|
assert.strict.deepStrictEqual(r, true)
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
+
it(`should return true when input '0'`, function() {
|
|
38
|
+
let r = isn0num('0')
|
|
39
|
+
assert.strict.deepStrictEqual(r, true)
|
|
40
|
+
})
|
|
41
|
+
|
|
37
42
|
it(`should return false when input 125`, function() {
|
|
38
43
|
let r = isn0num(125)
|
|
39
44
|
assert.strict.deepStrictEqual(r, false)
|