wsemi 1.8.80 → 1.8.82
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/README.md +1 -1
- package/dist/wsemi.umd.js +6 -6
- package/dist/wsemi.umd.js.map +1 -1
- package/docs/-_class.mjs.html +1 -1
- package/docs/ab2blob.mjs.html +1 -1
- package/docs/ab2u8arr.mjs.html +1 -1
- package/docs/addExcelWorksheetFromData.mjs.html +1 -1
- package/docs/addMonth.mjs.html +1 -1
- package/docs/aes2str.mjs.html +1 -1
- package/docs/alive.mjs.html +1 -1
- package/docs/arr2dt.mjs.html +1 -1
- package/docs/arrAccum.mjs.html +1 -1
- package/docs/arrAdd.mjs.html +1 -1
- package/docs/arrAt.mjs.html +1 -1
- package/docs/arrDiff.mjs.html +1 -1
- package/docs/arrFilterByKeywords.mjs.html +1 -1
- package/docs/arrFilterByNum.mjs.html +1 -1
- package/docs/arrFilterByPnum.mjs.html +1 -1
- package/docs/arrFilterByPnumAndToLog.mjs.html +1 -1
- package/docs/arrFind.mjs.html +1 -1
- package/docs/arrGroupByMaxmin.mjs.html +1 -1
- package/docs/arrHas.mjs.html +1 -1
- package/docs/arrInsert.mjs.html +1 -1
- package/docs/arrLookupByMaxmin.mjs.html +1 -1
- package/docs/arrMax.mjs.html +1 -1
- package/docs/arrMin.mjs.html +1 -1
- package/docs/arrMulti.mjs.html +1 -1
- package/docs/arrNorm.mjs.html +1 -1
- package/docs/arrProduct.mjs.html +1 -1
- package/docs/arrPull.mjs.html +1 -1
- package/docs/arrPullAt.mjs.html +1 -1
- package/docs/arrReduce.mjs.html +1 -1
- package/docs/arrReverse.mjs.html +1 -1
- package/docs/arrSep.mjs.html +1 -1
- package/docs/arrSort.mjs.html +1 -1
- package/docs/asind.mjs.html +1 -1
- package/docs/atan2d.mjs.html +1 -1
- package/docs/atand.mjs.html +1 -1
- package/docs/attstr.mjs.html +1 -1
- package/docs/b642obj.mjs.html +1 -1
- package/docs/b642str.mjs.html +1 -1
- package/docs/b642u16arr.mjs.html +1 -1
- package/docs/b642u8arr.mjs.html +1 -1
- package/docs/binstr.mjs.html +1 -1
- package/docs/blob2ab.mjs.html +1 -1
- package/docs/blob2b64.mjs.html +1 -1
- package/docs/blob2str.mjs.html +1 -1
- package/docs/blob2u8arr.mjs.html +1 -1
- package/docs/blobs2b64s.mjs.html +1 -1
- package/docs/blobs2u8arrs.mjs.html +1 -1
- package/docs/bodyLog.mjs.html +1 -1
- package/docs/browserView.mjs.html +1 -1
- package/docs/browserViewFromBlob.mjs.html +1 -1
- package/docs/browserViewFromText.mjs.html +1 -1
- package/docs/browserViewFromU8arr.mjs.html +1 -1
- package/docs/bs2u8arr.mjs.html +1 -1
- package/docs/bufRead.mjs.html +1 -1
- package/docs/bufReadDbl.mjs.html +1 -1
- package/docs/bufWrite.mjs.html +1 -1
- package/docs/bufWriteDbl.mjs.html +1 -1
- package/docs/cache.mjs.html +260 -50
- package/docs/cacheBd.mjs.html +1 -1
- package/docs/cacheSt.mjs.html +1 -1
- package/docs/cbol.mjs.html +1 -1
- package/docs/cdbl.mjs.html +1 -1
- package/docs/ceil.mjs.html +1 -1
- package/docs/cfilesize.mjs.html +1 -1
- package/docs/cfinancial.mjs.html +1 -1
- package/docs/cint.mjs.html +1 -1
- package/docs/clearXSS.mjs.html +1 -1
- package/docs/clearXSSDyn.mjs.html +1 -1
- package/docs/color.mjs.html +1 -1
- package/docs/composeToTree.mjs.html +1 -1
- package/docs/convertToTree.mjs.html +1 -1
- package/docs/copyStrToClipboard.mjs.html +1 -1
- package/docs/cosd.mjs.html +1 -1
- package/docs/cotd.mjs.html +1 -1
- package/docs/createExcelWorkbook.mjs.html +1 -1
- package/docs/cscd.mjs.html +1 -1
- package/docs/cstr.mjs.html +1 -1
- package/docs/day2cht.mjs.html +1 -1
- package/docs/debounce.mjs.html +1 -1
- package/docs/delay.mjs.html +1 -1
- package/docs/dig.mjs.html +1 -1
- package/docs/digExp.mjs.html +1 -1
- package/docs/domAlert.mjs.html +1 -1
- package/docs/domAppend.mjs.html +1 -1
- package/docs/domCancelEvent.mjs.html +1 -1
- package/docs/domCompareText.mjs.html +1 -1
- package/docs/domConvertToPic.mjs.html +1 -1
- package/docs/domConvertToPicDyn.mjs.html +1 -1
- package/docs/domDetect.mjs.html +1 -1
- package/docs/domDrag.mjs.html +1 -1
- package/docs/domDragBarAndScroll.mjs.html +1 -1
- package/docs/domDragPreview.mjs.html +1 -1
- package/docs/domDropFiles.mjs.html +1 -1
- package/docs/domElementsFromPoint.mjs.html +1 -1
- package/docs/domFadeIn.mjs.html +1 -1
- package/docs/domFadeOut.mjs.html +1 -1
- package/docs/domFind.mjs.html +1 -1
- package/docs/domFinds.mjs.html +1 -1
- package/docs/domGetAttr.mjs.html +1 -1
- package/docs/domGetBoudRect.mjs.html +1 -1
- package/docs/domGetBoudRectRefSelf.mjs.html +1 -1
- package/docs/domGetFileAccept.mjs.html +1 -1
- package/docs/domGetFiles.mjs.html +1 -1
- package/docs/domGetParents.mjs.html +1 -1
- package/docs/domGetPointFromEvent.mjs.html +1 -1
- package/docs/domGetScrollableParent.mjs.html +1 -1
- package/docs/domGetWindowSize.mjs.html +1 -1
- package/docs/domIsClientXYIn.mjs.html +1 -1
- package/docs/domIsFocused.mjs.html +1 -1
- package/docs/domIsStable.mjs.html +1 -1
- package/docs/domIsVisible.mjs.html +1 -1
- package/docs/domPrepend.mjs.html +1 -1
- package/docs/domRemove.mjs.html +1 -1
- package/docs/domRenderMarkdownMind.mjs.html +1 -1
- package/docs/domRenderMarkdownMindDyn.mjs.html +1 -1
- package/docs/domRipple.mjs.html +1 -1
- package/docs/domScrollIntoView.mjs.html +1 -1
- package/docs/domScrollTo.mjs.html +1 -1
- package/docs/domSetAttr.mjs.html +1 -1
- package/docs/domShowImages.mjs.html +1 -1
- package/docs/domShowImagesDyn.mjs.html +1 -1
- package/docs/domShowInputAndGetFiles.mjs.html +1 -1
- package/docs/domShowInputAndGetFilesU8Arrs.mjs.html +1 -1
- package/docs/domShowInputDatatime.mjs.html +1 -1
- package/docs/domTooltip.mjs.html +1 -1
- package/docs/domTriggerEvent.mjs.html +1 -1
- package/docs/domVirtualCreate.mjs.html +1 -1
- package/docs/domVirtualCreateQueue.mjs.html +1 -1
- package/docs/downloadExcelFileFromData.mjs.html +1 -1
- package/docs/downloadExcelFileFromDataDyn.mjs.html +1 -1
- package/docs/downloadFileFromB64.mjs.html +1 -1
- package/docs/downloadFileFromBlob.mjs.html +1 -1
- package/docs/downloadFileFromText.mjs.html +1 -1
- package/docs/downloadFileFromU8Arr.mjs.html +1 -1
- package/docs/dtmapping.mjs.html +1 -1
- package/docs/dtpick.mjs.html +1 -1
- package/docs/estimateTicks.mjs.html +1 -1
- package/docs/evem.mjs.html +1 -1
- package/docs/examples/ex-blob2b64.html +1 -1
- package/docs/examples/ex-clearXSS.html +1 -1
- package/docs/examples/ex-clearXSSDyn.html +1 -1
- package/docs/examples/ex-colorConverter.html +1 -1
- package/docs/examples/ex-domCompareText.html +1 -1
- package/docs/examples/ex-domConvertToPic.html +1 -1
- 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-domRenderMarkdownMind.html +1 -1
- package/docs/examples/ex-domRenderMarkdownMindDyn.html +1 -1
- package/docs/examples/ex-domRipple.html +1 -1
- package/docs/examples/ex-domScrollIntoView.html +1 -1
- package/docs/examples/ex-domScrollTo.html +1 -1
- package/docs/examples/ex-domShowImages.html +1 -1
- package/docs/examples/ex-domShowImagesDyn.html +1 -1
- package/docs/examples/ex-domShowInputAndGetFiles.html +1 -1
- package/docs/examples/ex-domTooltip.html +1 -1
- package/docs/examples/ex-getFileHash.html +1 -1
- package/docs/examples/ex-getUserAgent.html +1 -1
- package/docs/examples/ex-getUserAgentDyn.html +1 -1
- package/docs/examples/ex-html2str.html +1 -1
- package/docs/examples/ex-obj2u8arr-u8arr2obj.html +1 -1
- package/docs/examples/ex-openLink.html +1 -1
- package/docs/examples/ex-str2aes-aes2str.html +1 -1
- package/docs/examples/ex-str2b64-b642str.html +1 -1
- package/docs/examples/ex-strFindFuzz.html +1 -1
- package/docs/examples/ex-timeTZ2expire-timeTZ2past.html +1 -1
- package/docs/examples/ex-xlsx.html +1 -1
- package/docs/execCli.mjs.html +1 -1
- package/docs/execJsCode.mjs.html +1 -1
- package/docs/execProcess.mjs.html +1 -1
- package/docs/execProcessKillPid.mjs.html +1 -1
- package/docs/filepathToTree.mjs.html +1 -1
- package/docs/files2data.mjs.html +1 -1
- package/docs/flattenToConn.mjs.html +1 -1
- package/docs/flattenTree.mjs.html +1 -1
- package/docs/floor.mjs.html +1 -1
- package/docs/fsBuildReadStreamText.mjs.html +1 -1
- package/docs/fsBuildWriteStreamText.mjs.html +1 -1
- package/docs/fsCleanFolder.mjs.html +1 -1
- package/docs/fsCleanFolderCore.mjs.html +1 -1
- package/docs/fsCopyFile.mjs.html +1 -1
- package/docs/fsCopyFileCore.mjs.html +1 -1
- package/docs/fsCopyFolder.mjs.html +1 -1
- package/docs/fsCopyFolderCore.mjs.html +1 -1
- package/docs/fsCreateFile.mjs.html +1 -1
- package/docs/fsCreateFileCore.mjs.html +1 -1
- package/docs/fsCreateFolder.mjs.html +1 -1
- package/docs/fsCreateFolderCore.mjs.html +1 -1
- package/docs/fsDeleteFile.mjs.html +1 -1
- package/docs/fsDeleteFileCore.mjs.html +1 -1
- package/docs/fsDeleteFileSafe.mjs.html +1 -1
- package/docs/fsDeleteFileSafeCore.mjs.html +1 -1
- package/docs/fsDeleteFolder.mjs.html +1 -1
- package/docs/fsDeleteFolderCore.mjs.html +1 -1
- package/docs/fsDeleteFolderSafe.mjs.html +1 -1
- package/docs/fsDeleteFolderSafeCore.mjs.html +1 -1
- package/docs/fsDownloadFile.mjs.html +1 -1
- package/docs/fsDownloadFileCore.mjs.html +1 -1
- package/docs/fsEvem.mjs.html +1 -1
- package/docs/fsExists.mjs.html +1 -1
- package/docs/fsExistsCore.mjs.html +1 -1
- package/docs/fsGetFileBasicHash.mjs.html +1 -1
- package/docs/fsGetFileBasicHashCore.mjs.html +1 -1
- package/docs/fsGetFileHash.mjs.html +1 -1
- package/docs/fsGetFileHashCore.mjs.html +1 -1
- package/docs/fsGetFileXxHash.mjs.html +1 -1
- package/docs/fsGetFileXxHashCore.mjs.html +1 -1
- package/docs/fsGetFilesInFolder.mjs.html +1 -1
- package/docs/fsGetFilesInFolderCore.mjs.html +1 -1
- package/docs/fsGetFilesWithHashInFolder.mjs.html +1 -1
- package/docs/fsGetFilesWithHashInFolderCore.mjs.html +1 -1
- package/docs/fsGetFolderBasicHash.mjs.html +1 -1
- package/docs/fsGetFolderBasicHashCore.mjs.html +1 -1
- package/docs/fsGetFoldersInFolder.mjs.html +1 -1
- package/docs/fsGetFoldersInFolderCore.mjs.html +1 -1
- package/docs/fsIsFile.mjs.html +1 -1
- package/docs/fsIsFileCore.mjs.html +1 -1
- package/docs/fsIsFolder.mjs.html +1 -1
- package/docs/fsIsFolderCore.mjs.html +1 -1
- package/docs/fsMergeFiles.mjs.html +1 -1
- package/docs/fsMergeFilesCore.mjs.html +1 -1
- package/docs/fsReadJson.mjs.html +1 -1
- package/docs/fsReadText.mjs.html +1 -1
- package/docs/fsReadTextCore.mjs.html +1 -1
- package/docs/fsRenameFile.mjs.html +1 -1
- package/docs/fsRenameFileCore.mjs.html +1 -1
- package/docs/fsRenameFolder.mjs.html +1 -1
- package/docs/fsRenameFolderCore.mjs.html +1 -1
- package/docs/fsSrlog.mjs.html +1 -1
- package/docs/fsSyncFolder.mjs.html +1 -1
- package/docs/fsSyncFolderCore.mjs.html +1 -1
- package/docs/fsTask.mjs.html +1 -1
- package/docs/fsTaskCp.mjs.html +1 -1
- package/docs/fsTreeFolder.mjs.html +1 -1
- package/docs/fsTreeFolderCore.mjs.html +1 -1
- package/docs/fsTreeFolderWithHash.mjs.html +1 -1
- package/docs/fsTreeFolderWithHashCore.mjs.html +1 -1
- package/docs/fsWatchFile.mjs.html +1 -1
- package/docs/fsWatchFolder.mjs.html +1 -1
- package/docs/fsWriteJson.mjs.html +1 -1
- package/docs/fsWriteText.mjs.html +1 -1
- package/docs/fsWriteTextCore.mjs.html +1 -1
- package/docs/genGradientColor.mjs.html +1 -1
- package/docs/genID.mjs.html +1 -1
- package/docs/genIDSeq.mjs.html +1 -1
- package/docs/genPm.mjs.html +1 -1
- package/docs/getBufferSize.mjs.html +1 -1
- package/docs/getClearPathName.mjs.html +1 -1
- package/docs/getCsvStrFromData.mjs.html +1 -1
- package/docs/getDataFromExcelFileU8Arr.mjs.html +1 -1
- package/docs/getDataFromExcelFileU8ArrDyn.mjs.html +1 -1
- package/docs/getEnv.mjs.html +1 -1
- package/docs/getErrorMessage.mjs.html +1 -1
- package/docs/getExcelU8ArrFromData.mjs.html +1 -1
- package/docs/getExcelU8ArrFromWorkbook.mjs.html +1 -1
- package/docs/getExcelWorkbookFromData.mjs.html +1 -1
- package/docs/getExcelWorkbookFromWorksheet.mjs.html +1 -1
- package/docs/getExcelWorksheetFromData.mjs.html +1 -1
- package/docs/getFileAccept.mjs.html +1 -1
- package/docs/getFileBasicHash.mjs.html +1 -1
- package/docs/getFileHash.mjs.html +1 -1
- package/docs/getFileName.mjs.html +1 -1
- package/docs/getFileNameExt.mjs.html +1 -1
- package/docs/getFileTrueName.mjs.html +1 -1
- package/docs/getFileType.mjs.html +1 -1
- package/docs/getFileXxHash.mjs.html +1 -1
- package/docs/getGlobal.mjs.html +1 -1
- package/docs/getObjSize.mjs.html +1 -1
- package/docs/getPathParent.mjs.html +1 -1
- package/docs/getTimeBetween.mjs.html +1 -1
- package/docs/getTimeFromUnit.mjs.html +1 -1
- package/docs/getTimeHp.mjs.html +1 -1
- package/docs/getTimeObject.mjs.html +1 -1
- package/docs/getTimeRange.mjs.html +1 -1
- package/docs/getUserAgent.mjs.html +1 -1
- package/docs/getUserAgentDyn.mjs.html +1 -1
- package/docs/getltdtkeys.mjs.html +1 -1
- package/docs/global.html +1 -1
- package/docs/haskey.mjs.html +1 -1
- package/docs/html2str.mjs.html +1 -1
- package/docs/htmlDecode.mjs.html +1 -1
- package/docs/htmlEncode.mjs.html +1 -1
- package/docs/importResources.mjs.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interp1.mjs.html +1 -1
- package/docs/isDate.mjs.html +1 -1
- package/docs/isDev.mjs.html +1 -1
- package/docs/isEle.mjs.html +1 -1
- package/docs/isEleExistByID.mjs.html +1 -1
- package/docs/isEmail.mjs.html +1 -1
- package/docs/isErr.mjs.html +1 -1
- package/docs/isIE.mjs.html +1 -1
- package/docs/isNarrow.mjs.html +1 -1
- package/docs/isStrHasCapital.mjs.html +1 -1
- package/docs/isStrHasLetter.mjs.html +1 -1
- package/docs/isStrHasLowerCase.mjs.html +1 -1
- package/docs/isStrHasNumber.mjs.html +1 -1
- package/docs/isStrHasSpace.mjs.html +1 -1
- package/docs/isStrHasSymbol.mjs.html +1 -1
- package/docs/isUserIdentify.mjs.html +1 -1
- package/docs/isUserName.mjs.html +1 -1
- package/docs/isUserPw.mjs.html +1 -1
- package/docs/isWindow.mjs.html +1 -1
- package/docs/isab.mjs.html +1 -1
- package/docs/isarr.mjs.html +1 -1
- package/docs/isarr0.mjs.html +1 -1
- package/docs/isbigint.mjs.html +1 -1
- package/docs/isblob.mjs.html +1 -1
- package/docs/isbol.mjs.html +1 -1
- package/docs/isday.mjs.html +1 -1
- package/docs/isearr.mjs.html +1 -1
- package/docs/iseobj.mjs.html +1 -1
- package/docs/iser.mjs.html +1 -1
- package/docs/isernot.mjs.html +1 -1
- package/docs/isestr.mjs.html +1 -1
- package/docs/isfile.mjs.html +1 -1
- package/docs/isfun.mjs.html +1 -1
- package/docs/isint.mjs.html +1 -1
- package/docs/ismonth.mjs.html +1 -1
- package/docs/isn0int.mjs.html +1 -1
- package/docs/isn0num.mjs.html +1 -1
- package/docs/isnan.mjs.html +1 -1
- package/docs/isnbr.mjs.html +1 -1
- package/docs/isnint.mjs.html +1 -1
- package/docs/isnnum.mjs.html +1 -1
- package/docs/isnull.mjs.html +1 -1
- package/docs/isnum.mjs.html +1 -1
- package/docs/isobj.mjs.html +1 -1
- package/docs/isobj0.mjs.html +1 -1
- package/docs/isp0int.mjs.html +1 -1
- package/docs/isp0num.mjs.html +1 -1
- package/docs/ispint.mjs.html +1 -1
- package/docs/ispm.mjs.html +1 -1
- package/docs/ispnum.mjs.html +1 -1
- package/docs/isstr.mjs.html +1 -1
- package/docs/isstr0.mjs.html +1 -1
- package/docs/istime.mjs.html +1 -1
- package/docs/istimeTZ.mjs.html +1 -1
- package/docs/istimems.mjs.html +1 -1
- package/docs/istimemsTZ.mjs.html +1 -1
- package/docs/isu16arr.mjs.html +1 -1
- package/docs/isu8arr.mjs.html +1 -1
- package/docs/isundefined.mjs.html +1 -1
- package/docs/j2o.mjs.html +1 -1
- package/docs/judge.mjs.html +1 -1
- package/docs/keysmat2ltdt.mjs.html +1 -1
- package/docs/ltdt2vrtsable.mjs.html +1 -1
- package/docs/ltdtDiff.mjs.html +1 -1
- package/docs/ltdtDiffByKey.mjs.html +1 -1
- package/docs/ltdtkeys2mat.mjs.html +1 -1
- package/docs/ltdtkeysheads2mat.mjs.html +1 -1
- package/docs/ltdtmapping.mjs.html +1 -1
- package/docs/ltdtmerge.mjs.html +1 -1
- package/docs/ltdtpick.mjs.html +1 -1
- package/docs/ltdtpull.mjs.html +1 -1
- package/docs/mat2ltdt.mjs.html +1 -1
- package/docs/matConcat.mjs.html +1 -1
- package/docs/matDiff.mjs.html +1 -1
- package/docs/matat.mjs.html +1 -1
- package/docs/now2str.mjs.html +1 -1
- package/docs/now2strp.mjs.html +1 -1
- package/docs/nowDay2str.mjs.html +1 -1
- package/docs/nowms2str.mjs.html +1 -1
- package/docs/nowms2strp.mjs.html +1 -1
- package/docs/o2j.mjs.html +1 -1
- package/docs/obj2b64.mjs.html +1 -1
- package/docs/obj2pb64.mjs.html +1 -1
- package/docs/obj2str.mjs.html +1 -1
- package/docs/obj2stru8arr.mjs.html +1 -1
- package/docs/obj2u8arr.mjs.html +1 -1
- package/docs/objSortBy.mjs.html +1 -1
- package/docs/objSortByKeys.mjs.html +1 -1
- package/docs/oo.mjs.html +1 -1
- package/docs/openLink.mjs.html +1 -1
- package/docs/pb642obj.mjs.html +1 -1
- package/docs/pmChain.mjs.html +1 -1
- package/docs/pmConvertResolve.mjs.html +1 -1
- package/docs/pmDebounce.mjs.html +1 -1
- package/docs/pmHook.mjs.html +1 -1
- package/docs/pmHookReject.mjs.html +1 -1
- package/docs/pmIni.mjs.html +1 -1
- package/docs/pmInvResolve.mjs.html +1 -1
- package/docs/pmKeyMutex.mjs.html +1 -1
- package/docs/pmMap.mjs.html +1 -1
- package/docs/pmQueue.mjs.html +1 -1
- package/docs/pmSeries.mjs.html +1 -1
- package/docs/pmThrottle.mjs.html +1 -1
- package/docs/pmTimeout.mjs.html +1 -1
- package/docs/preciseNum.mjs.html +1 -1
- package/docs/pseudoRandom.mjs.html +1 -1
- package/docs/pseudoRandomIntRange.mjs.html +1 -1
- package/docs/pseudoRandomIntsNdpRange.mjs.html +1 -1
- package/docs/pseudoRandomIntsRange.mjs.html +1 -1
- package/docs/pseudoRandomRange.mjs.html +1 -1
- package/docs/pseudoRandomsRange.mjs.html +1 -1
- package/docs/queue.mjs.html +1 -1
- package/docs/random.mjs.html +1 -1
- package/docs/randomIntRange.mjs.html +1 -1
- package/docs/randomIntsNdpRange.mjs.html +1 -1
- package/docs/randomIntsRange.mjs.html +1 -1
- package/docs/randomRange.mjs.html +1 -1
- package/docs/randomsRange.mjs.html +1 -1
- package/docs/rang.mjs.html +1 -1
- package/docs/rep.mjs.html +1 -1
- package/docs/repObj.mjs.html +1 -1
- package/docs/replace.mjs.html +1 -1
- package/docs/replaceObj.mjs.html +1 -1
- package/docs/replacePlus.mjs.html +1 -1
- package/docs/round.mjs.html +1 -1
- package/docs/secd.mjs.html +1 -1
- package/docs/sep.mjs.html +1 -1
- package/docs/sepInt.mjs.html +1 -1
- package/docs/setIntervalHp.mjs.html +1 -1
- package/docs/setTimeoutHp.mjs.html +1 -1
- package/docs/sind.mjs.html +1 -1
- package/docs/split.mjs.html +1 -1
- package/docs/str2aes.mjs.html +1 -1
- package/docs/str2b64.mjs.html +1 -1
- package/docs/str2hint.mjs.html +1 -1
- package/docs/str2md5.mjs.html +1 -1
- package/docs/str2obj.mjs.html +1 -1
- package/docs/str2sha.mjs.html +1 -1
- package/docs/str2sha512.mjs.html +1 -1
- package/docs/str2u8arr.mjs.html +1 -1
- package/docs/strCompare.mjs.html +1 -1
- package/docs/strDiff.mjs.html +1 -1
- package/docs/strDiffToHtml.mjs.html +1 -1
- package/docs/strFindFuzz.mjs.html +1 -1
- package/docs/strFindSimilar.mjs.html +1 -1
- package/docs/strTruncate.mjs.html +1 -1
- package/docs/strdelleft.mjs.html +1 -1
- package/docs/strdelright.mjs.html +1 -1
- package/docs/strleft.mjs.html +1 -1
- package/docs/strmid.mjs.html +1 -1
- package/docs/strright.mjs.html +1 -1
- package/docs/stru8arr2obj.mjs.html +1 -1
- package/docs/tand.mjs.html +1 -1
- package/docs/time2day.mjs.html +1 -1
- package/docs/time2hour.mjs.html +1 -1
- package/docs/time2min.mjs.html +1 -1
- package/docs/timeTZ2day.mjs.html +1 -1
- package/docs/timeTZ2expire.mjs.html +1 -1
- package/docs/timeTZ2hour.mjs.html +1 -1
- package/docs/timeTZ2min.mjs.html +1 -1
- package/docs/timeTZ2past.mjs.html +1 -1
- package/docs/timems2day.mjs.html +1 -1
- package/docs/timems2hour.mjs.html +1 -1
- package/docs/timems2min.mjs.html +1 -1
- package/docs/timems2time.mjs.html +1 -1
- package/docs/timemsTZ2day.mjs.html +1 -1
- package/docs/timemsTZ2expire.mjs.html +1 -1
- package/docs/timemsTZ2hour.mjs.html +1 -1
- package/docs/timemsTZ2min.mjs.html +1 -1
- package/docs/timemsTZ2past.mjs.html +1 -1
- package/docs/timemsTZ2time.mjs.html +1 -1
- package/docs/treeObj.mjs.html +1 -1
- package/docs/treeToFilepath.mjs.html +1 -1
- package/docs/trim.mjs.html +1 -1
- package/docs/u16arr2b64.mjs.html +1 -1
- package/docs/u16arr2u8arr.mjs.html +1 -1
- package/docs/u8arr2ab.mjs.html +1 -1
- package/docs/u8arr2b64.mjs.html +1 -1
- package/docs/u8arr2blob.mjs.html +1 -1
- package/docs/u8arr2bs.mjs.html +1 -1
- package/docs/u8arr2obj.mjs.html +1 -1
- package/docs/u8arr2str.mjs.html +1 -1
- package/docs/u8arr2u16arr.mjs.html +1 -1
- package/docs/urlParse.mjs.html +1 -1
- package/docs/verifyValue.mjs.html +1 -1
- package/docs/waitFun.mjs.html +1 -1
- package/docs/wsemi.html +185 -27
- package/package.json +2 -2
- package/src/cache.mjs +259 -49
- package/test/cache.test.mjs +375 -26
- package/toolfp/dist/wsemip.umd.js +1 -1
- package/toolparfor/dist/wpf.umd.js +1 -1
- package/toolparfor/dist/wpf_pmSeries.umd.js +1 -1
package/docs/bufReadDbl.mjs.html
CHANGED
|
@@ -87,7 +87,7 @@ export default bufReadDbl
|
|
|
87
87
|
<br class="clear">
|
|
88
88
|
|
|
89
89
|
<footer>
|
|
90
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
90
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
91
91
|
</footer>
|
|
92
92
|
|
|
93
93
|
<script>prettyPrint();</script>
|
package/docs/bufWrite.mjs.html
CHANGED
|
@@ -181,7 +181,7 @@ export default bufWrite
|
|
|
181
181
|
<br class="clear">
|
|
182
182
|
|
|
183
183
|
<footer>
|
|
184
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
184
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
185
185
|
</footer>
|
|
186
186
|
|
|
187
187
|
<script>prettyPrint();</script>
|
|
@@ -91,7 +91,7 @@ export default bufWriteDbl
|
|
|
91
91
|
<br class="clear">
|
|
92
92
|
|
|
93
93
|
<footer>
|
|
94
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
94
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
95
95
|
</footer>
|
|
96
96
|
|
|
97
97
|
<script>prettyPrint();</script>
|
package/docs/cache.mjs.html
CHANGED
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
<pre class="prettyprint source linenums"><code>import loGet from 'lodash-es/get.js'
|
|
49
49
|
import cloneDeep from 'lodash-es/cloneDeep.js'
|
|
50
50
|
import evem from './evem.mjs'
|
|
51
|
-
import waitFun from './waitFun.mjs'
|
|
52
51
|
import isfun from './isfun.mjs'
|
|
52
|
+
import isbol from './isbol.mjs'
|
|
53
53
|
import haskey from './haskey.mjs'
|
|
54
54
|
import ispint from './ispint.mjs'
|
|
55
55
|
import isarr from './isarr.mjs'
|
|
@@ -61,7 +61,7 @@ import cint from './cint.mjs'
|
|
|
61
61
|
*
|
|
62
62
|
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/cache.test.mjs Github}
|
|
63
63
|
* @memberOf wsemi
|
|
64
|
-
* @returns {Object} 回傳事件物件,可呼叫函數on、set、get、getProxy、clear、remove。on為監聽事件,需自行監聽message與error事件。set為加入待執行函數,函數結束回傳欲快取的值,set傳入參數依序為key與快取物件,key為唯一識別字串,可使用函數加上輸入參數作為key,因考慮輸入參數可能為大量數據會有效能問題,由開發者自行決定key,而快取物件需設定欄位fun為待執行的非同步函數、inputs為待執行函數fun的傳入參數組、timeExpired為過期時間整數,單位為毫秒ms,預設5000
|
|
64
|
+
* @returns {Object} 回傳事件物件,可呼叫函數on、set、get、getProxy、clear、remove。on為監聽事件,需自行監聽message與error事件。set為加入待執行函數,函數結束回傳欲快取的值,set傳入參數依序為key與快取物件,key為唯一識別字串,可使用函數加上輸入參數作為key,因考慮輸入參數可能為大量數據會有效能問題,由開發者自行決定key,而快取物件需設定欄位fun為待執行的非同步函數、inputs為待執行函數fun的傳入參數組、timeExpired為過期時間整數,單位為毫秒ms,預設5000、timeFrom為快取時間之起算點,可選'start'或'end','start'為自函數開始執行時起算,'end'為自函數執行完畢時起算,預設'start'、cacheError為函數執行失敗時是否快取,預設true,失敗時快取值為undefined並保留整個timeExpired,若設定false則失敗不快取,錯誤會拋給呼叫端(含等待中之併發呼叫)且下次get重新執行、useCloneDeep為取值時是否複製快取值後才回傳,預設true,因快取值若為物件則可能受外部調用而被修改到快取區的記憶體,若快取值為大量數據可設定false以節省複製開銷,但呼叫端須自行確保不修改所取得之值。get為依照key取得目前快取值,若該key之函數執行中則共用執行中之promise,待其執行完畢即一併取得結果,不另行輪詢,get傳入參數依序為key與設定物件,設定物件之欄位useCloneDeep可覆寫set時之設定,未指定時沿用set之設定。getProxy為合併set與get功能,直接set註冊待執行函數與取值,傳入參數同set,且會一併傳給get,回傳同get。update為強制更新key所屬快取值,同時也會更新該快取之時間至當前,於函數執行中呼叫時以update之值為準,不被執行結果覆寫。clear為清除key所屬快取的是否執行標記,使該快取視為需重新執行函數取值,於函數執行中呼叫亦有效,執行中之呼叫仍取得本次結果,下次get才重新執行。remove為直接清除key所屬快取,清除後用set重設
|
|
65
65
|
* @example
|
|
66
66
|
*
|
|
67
67
|
* async function topAsync() {
|
|
@@ -96,7 +96,7 @@ import cint from './cint.mjs'
|
|
|
96
96
|
*
|
|
97
97
|
* oc.set('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 }) //快取1200ms, 但第1次執行就需要300ms, 故執行完畢後只會再保留800ms
|
|
98
98
|
* setTimeout(function() {
|
|
99
|
-
* //第1
|
|
99
|
+
* //第1次呼叫(1ms), 此時沒有快取只能執行取值, 執行300ms後回應, 會取得第1次結果(count=1)
|
|
100
100
|
* oc.get('fun')
|
|
101
101
|
* .then(function(msg) {
|
|
102
102
|
* console.log('fun 1st', msg)
|
|
@@ -104,7 +104,7 @@ import cint from './cint.mjs'
|
|
|
104
104
|
* })
|
|
105
105
|
* }, 1)
|
|
106
106
|
* setTimeout(function() {
|
|
107
|
-
* //第2次呼叫(50ms), 此時第1次呼叫還沒完成(要到300ms), 故get
|
|
107
|
+
* //第2次呼叫(50ms), 此時第1次呼叫還沒完成(要到300ms), 故get會共用執行中的promise等待, 於第1次執行完畢(300ms)時一併取得第1次結果(count=1)
|
|
108
108
|
* oc.get('fun')
|
|
109
109
|
* .then(function(msg) {
|
|
110
110
|
* console.log('fun 2nd', msg)
|
|
@@ -112,7 +112,7 @@ import cint from './cint.mjs'
|
|
|
112
112
|
* })
|
|
113
113
|
* }, 50)
|
|
114
114
|
* setTimeout(function() {
|
|
115
|
-
* //第3次呼叫(250ms), 此時第1次呼叫還沒完成(要到300ms),
|
|
115
|
+
* //第3次呼叫(250ms), 此時第1次呼叫還沒完成(要到300ms), 同第2次呼叫共用執行中的promise等待, 於300ms時一併取得第1次結果(count=1)
|
|
116
116
|
* oc.get('fun')
|
|
117
117
|
* .then(function(msg) {
|
|
118
118
|
* console.log('fun 3rd', msg)
|
|
@@ -128,7 +128,7 @@ import cint from './cint.mjs'
|
|
|
128
128
|
* })
|
|
129
129
|
* }, 500)
|
|
130
130
|
* setTimeout(function() {
|
|
131
|
-
* //第5次呼叫(1300ms), 此時第1次快取(count=1)已過期(1200ms),
|
|
131
|
+
* //第5次呼叫(1300ms), 此時第1次快取(count=1)已過期(1200ms), 故重新執行取值(1300~1600ms執行, 2500ms過期), 於1600ms取得第2次結果(count=2)
|
|
132
132
|
* oc.get('fun')
|
|
133
133
|
* .then(function(msg) {
|
|
134
134
|
* console.log('fun 5th', msg)
|
|
@@ -136,7 +136,7 @@ import cint from './cint.mjs'
|
|
|
136
136
|
* })
|
|
137
137
|
* }, 1300)
|
|
138
138
|
* setTimeout(function() {
|
|
139
|
-
* //第6次呼叫(1600ms), 此時第
|
|
139
|
+
* //第6次呼叫(1600ms), 此時第2次執行剛好結束(1600ms), 若尚未結束則共用執行中的promise等待, 若已結束則直接拿快取, 皆會取得第2次結果(count=2)
|
|
140
140
|
* oc.get('fun')
|
|
141
141
|
* .then(function(msg) {
|
|
142
142
|
* console.log('fun 6th', msg)
|
|
@@ -156,13 +156,13 @@ import cint from './cint.mjs'
|
|
|
156
156
|
* // test1
|
|
157
157
|
* // call fun, count=1
|
|
158
158
|
* // fun 1st inp1|inp2, count=1
|
|
159
|
-
* // fun 4th inp1|inp2, count=1
|
|
160
159
|
* // fun 2nd inp1|inp2, count=1
|
|
160
|
+
* // fun 3rd inp1|inp2, count=1
|
|
161
|
+
* // fun 4th inp1|inp2, count=1
|
|
161
162
|
* // call fun, count=2
|
|
162
|
-
* // fun 3rd inp1|inp2, count=2
|
|
163
|
-
* // fun 6th inp1|inp2, count=2
|
|
164
163
|
* // fun 5th inp1|inp2, count=2
|
|
165
|
-
* //
|
|
164
|
+
* // fun 6th inp1|inp2, count=2
|
|
165
|
+
* // ["call fun, count=1","inp1|inp2, count=1","fun 1st","inp1|inp2, count=1","fun 2nd","inp1|inp2, count=1","fun 3rd","inp1|inp2, count=1","fun 4th","inp1|inp2, count=1","call fun, count=2","inp1|inp2, count=2","fun 5th","inp1|inp2, count=2","fun 6th","inp1|inp2, count=2"]
|
|
166
166
|
*
|
|
167
167
|
* function test2() {
|
|
168
168
|
* return new Promise((resolve, reject) => {
|
|
@@ -192,9 +192,9 @@ import cint from './cint.mjs'
|
|
|
192
192
|
* })
|
|
193
193
|
* }
|
|
194
194
|
*
|
|
195
|
-
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 })
|
|
195
|
+
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 }) //首次getProxy即註冊並執行取值(0~300ms), 快取1200ms, 但第1次執行就需要300ms, 故執行完畢後只會再保留800ms
|
|
196
196
|
* setTimeout(function() {
|
|
197
|
-
* //第1
|
|
197
|
+
* //第1次呼叫(1ms), 此時首次getProxy執行中, 會共用執行中的promise等待, 於300ms取得第1次結果(count=1)
|
|
198
198
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 })
|
|
199
199
|
* .then(function(msg) {
|
|
200
200
|
* console.log('fun 1st', msg)
|
|
@@ -202,7 +202,7 @@ import cint from './cint.mjs'
|
|
|
202
202
|
* })
|
|
203
203
|
* }, 1)
|
|
204
204
|
* setTimeout(function() {
|
|
205
|
-
* //第2
|
|
205
|
+
* //第2次呼叫(100ms), 此時執行中, 同第1次呼叫共用執行中的promise等待, 於300ms取得第1次結果(count=1)
|
|
206
206
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 })
|
|
207
207
|
* .then(function(msg) {
|
|
208
208
|
* console.log('fun 2nd', msg)
|
|
@@ -210,7 +210,7 @@ import cint from './cint.mjs'
|
|
|
210
210
|
* })
|
|
211
211
|
* }, 100)
|
|
212
212
|
* setTimeout(function() {
|
|
213
|
-
* //第3
|
|
213
|
+
* //第3次呼叫(500ms), 此時已有快取, 直接取得第1次結果(count=1)
|
|
214
214
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 })
|
|
215
215
|
* .then(function(msg) {
|
|
216
216
|
* console.log('fun 3rd', msg)
|
|
@@ -218,7 +218,7 @@ import cint from './cint.mjs'
|
|
|
218
218
|
* })
|
|
219
219
|
* }, 500)
|
|
220
220
|
* setTimeout(function() {
|
|
221
|
-
* //第4
|
|
221
|
+
* //第4次呼叫(1300ms), 此時第1次快取(count=1)已失效(1200ms), 會重新呼叫函數取值(1300~1600ms), 取得第2次結果(count=2)
|
|
222
222
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1200 })
|
|
223
223
|
* .then(function(msg) {
|
|
224
224
|
* console.log('fun 4th', msg)
|
|
@@ -237,12 +237,12 @@ import cint from './cint.mjs'
|
|
|
237
237
|
* console.log(JSON.stringify(r2))
|
|
238
238
|
* // test2
|
|
239
239
|
* // call fun, count=1
|
|
240
|
-
* // fun 3rd inp1|inp2, count=1
|
|
241
240
|
* // fun 1st inp1|inp2, count=1
|
|
242
241
|
* // fun 2nd inp1|inp2, count=1
|
|
242
|
+
* // fun 3rd inp1|inp2, count=1
|
|
243
243
|
* // call fun, count=2
|
|
244
244
|
* // fun 4th inp1|inp2, count=2
|
|
245
|
-
* // ["call fun, count=1","inp1|inp2, count=1","fun
|
|
245
|
+
* // ["call fun, count=1","inp1|inp2, count=1","fun 1st","inp1|inp2, count=1","fun 2nd","inp1|inp2, count=1","fun 3rd","inp1|inp2, count=1","call fun, count=2","inp1|inp2, count=2","fun 4th","inp1|inp2, count=2"]
|
|
246
246
|
*
|
|
247
247
|
* function test3() {
|
|
248
248
|
* return new Promise((resolve, reject) => {
|
|
@@ -272,9 +272,9 @@ import cint from './cint.mjs'
|
|
|
272
272
|
* })
|
|
273
273
|
* }
|
|
274
274
|
*
|
|
275
|
-
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1500 })
|
|
275
|
+
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1500 }) //首次getProxy即註冊並執行取值(0~300ms), 快取1500ms, 但第1次執行就需要300ms, 故執行完畢後只會再保留1200ms
|
|
276
276
|
* setTimeout(function() {
|
|
277
|
-
* //第1次呼叫(延遲1ms),
|
|
277
|
+
* //第1次呼叫(延遲1ms), 此時首次getProxy執行中, 會共用執行中的promise等待, 於300ms取得第1次結果(count=1)
|
|
278
278
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1500 })
|
|
279
279
|
* .then(function(msg) {
|
|
280
280
|
* console.log('fun 1st', msg)
|
|
@@ -282,7 +282,7 @@ import cint from './cint.mjs'
|
|
|
282
282
|
* })
|
|
283
283
|
* }, 1)
|
|
284
284
|
* setTimeout(function() {
|
|
285
|
-
* //第2次呼叫(延遲200ms),
|
|
285
|
+
* //第2次呼叫(延遲200ms), 此時執行中, 同第1次呼叫共用執行中的promise等待, 於300ms取得第1次結果(count=1), 早於被強制更新(1100ms)
|
|
286
286
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1500 })
|
|
287
287
|
* .then(function(msg) {
|
|
288
288
|
* console.log('fun 2nd', msg)
|
|
@@ -290,7 +290,7 @@ import cint from './cint.mjs'
|
|
|
290
290
|
* })
|
|
291
291
|
* }, 200)
|
|
292
292
|
* setTimeout(function() {
|
|
293
|
-
* //第3
|
|
293
|
+
* //第3次呼叫(500ms), 此時已有快取, 直接取得第1次結果(count=1)
|
|
294
294
|
* oc.getProxy('fun', { fun, inputs: ['inp1', 'inp2'], timeExpired: 1500 })
|
|
295
295
|
* .then(function(msg) {
|
|
296
296
|
* console.log('fun 3rd', msg)
|
|
@@ -331,14 +331,172 @@ import cint from './cint.mjs'
|
|
|
331
331
|
* console.log(JSON.stringify(r3))
|
|
332
332
|
* // test3
|
|
333
333
|
* // call fun, count=1
|
|
334
|
-
* // fun 3rd inp1|inp2, count=1
|
|
335
334
|
* // fun 1st inp1|inp2, count=1
|
|
335
|
+
* // fun 2nd inp1|inp2, count=1
|
|
336
|
+
* // fun 3rd inp1|inp2, count=1
|
|
336
337
|
* // fun update abc
|
|
337
|
-
* // fun 2nd abc
|
|
338
338
|
* // fun 4th abc
|
|
339
339
|
* // call fun, count=2
|
|
340
340
|
* // fun 5th inp1|inp2, count=2
|
|
341
|
-
* // ["call fun, count=1","inp1|inp2, count=1","fun
|
|
341
|
+
* // ["call fun, count=1","inp1|inp2, count=1","fun 1st","inp1|inp2, count=1","fun 2nd","inp1|inp2, count=1","fun 3rd","inp1|inp2, count=1","fun update","abc","fun 4th","abc","call fun, count=2","inp1|inp2, count=2","fun 5th","inp1|inp2, count=2"]
|
|
342
|
+
*
|
|
343
|
+
* async function test4() {
|
|
344
|
+
* //執行中clear與update: clear於執行中呼叫仍有效(執行中之呼叫取得本次結果, 下次get重新執行); update於執行中呼叫以update之值為準, 不被執行結果覆寫
|
|
345
|
+
* let oc = cache()
|
|
346
|
+
*
|
|
347
|
+
* let n = 0
|
|
348
|
+
* let fun = () => {
|
|
349
|
+
* n++
|
|
350
|
+
* return new Promise(function(resolve, reject) {
|
|
351
|
+
* setTimeout(function() {
|
|
352
|
+
* resolve('count=' + n)
|
|
353
|
+
* }, 100)
|
|
354
|
+
* })
|
|
355
|
+
* }
|
|
356
|
+
*
|
|
357
|
+
* //clear於執行中
|
|
358
|
+
* oc.set('clear', { fun, inputs: [], timeExpired: 30000 })
|
|
359
|
+
* let pm1 = oc.get('clear')
|
|
360
|
+
* await new Promise((resolve) => setTimeout(resolve, 10))
|
|
361
|
+
* oc.clear('clear')
|
|
362
|
+
* let v1 = await pm1 //執行中之呼叫取得本次結果(count=1)
|
|
363
|
+
* let v2 = await oc.get('clear') //clear有效, 重新執行(count=2)
|
|
364
|
+
* let v3 = await oc.get('clear') //快取(count=2)
|
|
365
|
+
*
|
|
366
|
+
* //update於執行中
|
|
367
|
+
* n = 0
|
|
368
|
+
* oc.set('update', { fun, inputs: [], timeExpired: 30000 })
|
|
369
|
+
* let pm2 = oc.get('update')
|
|
370
|
+
* await new Promise((resolve) => setTimeout(resolve, 10))
|
|
371
|
+
* oc.update('update', 'abc')
|
|
372
|
+
* let v4 = await pm2 //以update之值為準(abc)
|
|
373
|
+
* let v5 = await oc.get('update') //快取(abc), 不重新執行
|
|
374
|
+
*
|
|
375
|
+
* return { v1, v2, v3, v4, v5, n }
|
|
376
|
+
* }
|
|
377
|
+
* console.log('test4')
|
|
378
|
+
* let r4 = await test4()
|
|
379
|
+
* console.log(JSON.stringify(r4))
|
|
380
|
+
* // test4
|
|
381
|
+
* // {"v1":"count=1","v2":"count=2","v3":"count=2","v4":"abc","v5":"abc","n":1}
|
|
382
|
+
*
|
|
383
|
+
* async function test5() {
|
|
384
|
+
* //timeFrom: 預設'start'自fun開始起算, 'end'自fun結束起算; fun耗時200ms, timeExpired 220ms, 結束後再隔120ms取值: 'start'時已過期(320>220)重新執行, 'end'時未過期(120<220)取快取
|
|
385
|
+
* let oc = cache()
|
|
386
|
+
*
|
|
387
|
+
* let n = 0
|
|
388
|
+
* let fun = () => {
|
|
389
|
+
* n++
|
|
390
|
+
* return new Promise(function(resolve, reject) {
|
|
391
|
+
* setTimeout(function() {
|
|
392
|
+
* resolve('count=' + n)
|
|
393
|
+
* }, 200)
|
|
394
|
+
* })
|
|
395
|
+
* }
|
|
396
|
+
*
|
|
397
|
+
* oc.set('start', { fun, inputs: [], timeExpired: 220 }) //預設timeFrom='start'
|
|
398
|
+
* let v1 = await oc.get('start')
|
|
399
|
+
* await new Promise((resolve) => setTimeout(resolve, 120))
|
|
400
|
+
* let v2 = await oc.get('start')
|
|
401
|
+
*
|
|
402
|
+
* n = 0
|
|
403
|
+
* oc.set('end', { fun, inputs: [], timeExpired: 220, timeFrom: 'end' })
|
|
404
|
+
* let v3 = await oc.get('end')
|
|
405
|
+
* await new Promise((resolve) => setTimeout(resolve, 120))
|
|
406
|
+
* let v4 = await oc.get('end')
|
|
407
|
+
*
|
|
408
|
+
* return { v1, v2, v3, v4 }
|
|
409
|
+
* }
|
|
410
|
+
* console.log('test5')
|
|
411
|
+
* let r5 = await test5()
|
|
412
|
+
* console.log(JSON.stringify(r5))
|
|
413
|
+
* // test5
|
|
414
|
+
* // {"v1":"count=1","v2":"count=2","v3":"count=1","v4":"count=1"}
|
|
415
|
+
*
|
|
416
|
+
* async function test6() {
|
|
417
|
+
* //cacheError: 預設true失敗快取undefined; false時失敗不快取, 錯誤拋給執行者與等待中之併發呼叫, 下次get重新執行, error事件仍發出
|
|
418
|
+
* let oc = cache()
|
|
419
|
+
*
|
|
420
|
+
* let errs = []
|
|
421
|
+
* oc.on('error', function(msg) {
|
|
422
|
+
* errs.push(msg.key + ':' + msg.msg.message)
|
|
423
|
+
* })
|
|
424
|
+
*
|
|
425
|
+
* let n = 0
|
|
426
|
+
* let fun = () => {
|
|
427
|
+
* n++
|
|
428
|
+
* return new Promise(function(resolve, reject) {
|
|
429
|
+
* setTimeout(function() {
|
|
430
|
+
* if (n <= 2) {
|
|
431
|
+
* reject(new Error('down' + n))
|
|
432
|
+
* }
|
|
433
|
+
* else {
|
|
434
|
+
* resolve('up' + n)
|
|
435
|
+
* }
|
|
436
|
+
* }, 50)
|
|
437
|
+
* })
|
|
438
|
+
* }
|
|
439
|
+
*
|
|
440
|
+
* oc.set('fun', { fun, inputs: [], timeExpired: 30000, cacheError: false })
|
|
441
|
+
*
|
|
442
|
+
* //第1次執行失敗: 執行者與等待中之併發呼叫皆收到reject
|
|
443
|
+
* let pm1 = oc.get('fun').then((v) => 'ok:' + v).catch((e) => 'err:' + e.message)
|
|
444
|
+
* await new Promise((resolve) => setTimeout(resolve, 10))
|
|
445
|
+
* let pm2 = oc.get('fun').then((v) => 'ok:' + v).catch((e) => 'err:' + e.message)
|
|
446
|
+
* let r1 = await pm1
|
|
447
|
+
* let r2 = await pm2
|
|
448
|
+
*
|
|
449
|
+
* //第2次執行仍失敗(失敗不快取故重新執行)
|
|
450
|
+
* let r3 = await oc.get('fun').then((v) => 'ok:' + v).catch((e) => 'err:' + e.message)
|
|
451
|
+
*
|
|
452
|
+
* //第3次執行成功並快取
|
|
453
|
+
* let r4 = await oc.get('fun').then((v) => 'ok:' + v).catch((e) => 'err:' + e.message)
|
|
454
|
+
* let r5 = await oc.get('fun').then((v) => 'ok:' + v).catch((e) => 'err:' + e.message)
|
|
455
|
+
*
|
|
456
|
+
* await new Promise((resolve) => setTimeout(resolve, 50)) //error事件以timer脫勾發送, 稍待
|
|
457
|
+
*
|
|
458
|
+
* return { rs: [r1, r2, r3, r4, r5], n, errs }
|
|
459
|
+
* }
|
|
460
|
+
* console.log('test6')
|
|
461
|
+
* let r6 = await test6()
|
|
462
|
+
* console.log(JSON.stringify(r6))
|
|
463
|
+
* // test6
|
|
464
|
+
* // {"rs":["err:down1","err:down1","err:down2","ok:up3","ok:up3"],"n":3,"errs":["fun:down1","fun:down2"]}
|
|
465
|
+
*
|
|
466
|
+
* async function test7() {
|
|
467
|
+
* //useCloneDeep: 預設true回傳複製值, 呼叫端修改不影響快取; 設false則直接回傳快取內之值(為同一參照), 可省去大量數據之複製開銷, 但呼叫端須自行確保不修改
|
|
468
|
+
* let oc = cache()
|
|
469
|
+
*
|
|
470
|
+
* let fun = async () => {
|
|
471
|
+
* return { a: 1 }
|
|
472
|
+
* }
|
|
473
|
+
*
|
|
474
|
+
* //預設true
|
|
475
|
+
* oc.set('clone', { fun, inputs: [], timeExpired: 30000 })
|
|
476
|
+
* let v1 = await oc.get('clone')
|
|
477
|
+
* v1.a = 2 //修改所取得之值
|
|
478
|
+
* let v2 = await oc.get('clone') //快取未受影響
|
|
479
|
+
*
|
|
480
|
+
* //get傳入useCloneDeep=false
|
|
481
|
+
* oc.set('noclone', { fun, inputs: [], timeExpired: 30000 })
|
|
482
|
+
* let v3 = await oc.get('noclone', { useCloneDeep: false })
|
|
483
|
+
* let v4 = await oc.get('noclone', { useCloneDeep: false })
|
|
484
|
+
*
|
|
485
|
+
* //set時設定useCloneDeep=false, get未指定則沿用set之設定
|
|
486
|
+
* oc.set('setnoclone', { fun, inputs: [], timeExpired: 30000, useCloneDeep: false })
|
|
487
|
+
* let v5 = await oc.get('setnoclone')
|
|
488
|
+
* let v6 = await oc.get('setnoclone')
|
|
489
|
+
*
|
|
490
|
+
* //get之設定可覆寫set之設定
|
|
491
|
+
* let v7 = await oc.get('setnoclone', { useCloneDeep: true })
|
|
492
|
+
*
|
|
493
|
+
* return { v2, sameNoclone: v3 === v4, sameSetnoclone: v5 === v6, sameOverride: v5 === v7 }
|
|
494
|
+
* }
|
|
495
|
+
* console.log('test7')
|
|
496
|
+
* let r7 = await test7()
|
|
497
|
+
* console.log(JSON.stringify(r7))
|
|
498
|
+
* // test7
|
|
499
|
+
* // {"v2":{"a":1},"sameNoclone":true,"sameSetnoclone":true,"sameOverride":false}
|
|
342
500
|
*
|
|
343
501
|
* }
|
|
344
502
|
* topAsync().catch(() => {})
|
|
@@ -382,40 +540,69 @@ function cache() {
|
|
|
382
540
|
}
|
|
383
541
|
timeExpired = cint(timeExpired)
|
|
384
542
|
|
|
543
|
+
//timeFrom
|
|
544
|
+
let timeFrom = loGet(opt, 'timeFrom')
|
|
545
|
+
if (timeFrom !== 'end') {
|
|
546
|
+
timeFrom = 'start'
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
//cacheError
|
|
550
|
+
let cacheError = loGet(opt, 'cacheError')
|
|
551
|
+
if (cacheError !== false) {
|
|
552
|
+
cacheError = true
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
//useCloneDeep
|
|
556
|
+
let useCloneDeep = loGet(opt, 'useCloneDeep')
|
|
557
|
+
if (!isbol(useCloneDeep)) {
|
|
558
|
+
useCloneDeep = true
|
|
559
|
+
}
|
|
560
|
+
|
|
385
561
|
//save
|
|
386
562
|
data[key] = {
|
|
387
563
|
needExec: true,
|
|
388
564
|
fun,
|
|
389
|
-
|
|
565
|
+
pm: null, //執行中之promise, null代表非執行中
|
|
566
|
+
gen: 0, //update次數, 執行中若被update則gen改變, 用於使執行結果不覆寫update之值
|
|
390
567
|
inputs,
|
|
391
568
|
value: null,
|
|
392
569
|
time: null,
|
|
393
570
|
timeExpired,
|
|
571
|
+
timeFrom,
|
|
572
|
+
cacheError,
|
|
573
|
+
useCloneDeep,
|
|
394
574
|
}
|
|
395
|
-
emit('message', { fun: 'set', key, timeExpired })
|
|
575
|
+
emit('message', { fun: 'set', key, timeExpired, timeFrom, cacheError, useCloneDeep })
|
|
396
576
|
|
|
397
577
|
}
|
|
398
578
|
|
|
399
|
-
async function get(key) {
|
|
579
|
+
async function get(key, opt = {}) {
|
|
400
580
|
if (haskey(data, key)) {
|
|
401
|
-
let
|
|
581
|
+
let d = data[key] //取物件參照, 執行中若遭remove仍可正常收尾
|
|
402
582
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
583
|
+
//useCloneDeep, 未指定時沿用set時之設定
|
|
584
|
+
let useCloneDeep = loGet(opt, 'useCloneDeep')
|
|
585
|
+
if (!isbol(useCloneDeep)) {
|
|
586
|
+
useCloneDeep = d.useCloneDeep
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
//若執行中則共用執行中之promise, 待其執行完畢即一併取得結果, 不輪詢
|
|
590
|
+
if (d.pm) {
|
|
591
|
+
emit('message', { fun: 'get', key, msg: 'waiting' })
|
|
592
|
+
await d.pm
|
|
593
|
+
return (useCloneDeep) ? cloneDeep(d.value) : d.value
|
|
594
|
+
}
|
|
408
595
|
|
|
409
596
|
//t
|
|
410
597
|
let t = Date.now()
|
|
411
598
|
|
|
412
599
|
//needExec or timeExpired
|
|
413
|
-
b =
|
|
414
|
-
let timeDiff = (t -
|
|
600
|
+
let b = d.needExec
|
|
601
|
+
let timeDiff = (t - d.time)
|
|
415
602
|
if (b) {
|
|
416
603
|
emit('message', { fun: 'get', key, msg: 'execute first' })
|
|
417
604
|
}
|
|
418
|
-
else if (
|
|
605
|
+
else if (d.timeExpired > 0 && (timeDiff > d.timeExpired)) {
|
|
419
606
|
emit('message', { fun: 'get', key, msg: 'execute by timeExpired', timeDiff })
|
|
420
607
|
b = true
|
|
421
608
|
}
|
|
@@ -423,21 +610,43 @@ function cache() {
|
|
|
423
610
|
//fun
|
|
424
611
|
if (b) {
|
|
425
612
|
emit('message', { fun: 'get', key, msg: 'fun start' })
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
613
|
+
d.needExec = false //受理即清除標記, 執行中若再clear會重設為true, 留待下次get重新執行
|
|
614
|
+
let gen = d.gen //執行中若被update則d.gen改變, 本次執行結果不覆寫update之值與時間
|
|
615
|
+
let run = async () => {
|
|
616
|
+
try {
|
|
617
|
+
let v
|
|
618
|
+
try {
|
|
619
|
+
v = await d.fun(...d.inputs) //fun同步拋錯或回傳非promise皆由try與await承接
|
|
620
|
+
}
|
|
621
|
+
catch (err) {
|
|
622
|
+
emit('error', { fun: 'get', key, msg: err })
|
|
623
|
+
if (!d.cacheError) {
|
|
624
|
+
//失敗不快取: 值與時間不動, 下次get重新執行, 錯誤拋給執行者與等待中之併發呼叫
|
|
625
|
+
if (d.gen === gen) {
|
|
626
|
+
d.needExec = true
|
|
627
|
+
}
|
|
628
|
+
throw err
|
|
629
|
+
}
|
|
630
|
+
v = undefined //失敗快取: 值為undefined並保留整個timeExpired
|
|
631
|
+
}
|
|
632
|
+
if (d.gen === gen) {
|
|
633
|
+
d.value = v
|
|
634
|
+
d.time = (d.timeFrom === 'end') ? Date.now() : t //timeFrom為end時自執行完畢起算, 否則自執行開始起算
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
finally {
|
|
638
|
+
d.pm = null
|
|
639
|
+
emit('message', { fun: 'get', key, msg: 'fun end' })
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
d.pm = run() //自get進入至此無await, 故同一tick內之後到者亦可見d.pm而共用
|
|
643
|
+
await d.pm
|
|
435
644
|
}
|
|
436
645
|
else {
|
|
437
646
|
emit('message', { fun: 'get', key, msg: 'use cache' })
|
|
438
647
|
}
|
|
439
648
|
|
|
440
|
-
return cloneDeep(
|
|
649
|
+
return (useCloneDeep) ? cloneDeep(d.value) : d.value //若為物件可能受外部調用而被修改到快取區的記憶體, 故預設得用cloneDeep複製才回傳, 而useCloneDeep為false時直接回傳快取內之值, 由呼叫端自行確保不修改
|
|
441
650
|
}
|
|
442
651
|
else {
|
|
443
652
|
emit('error', { fun: 'get', key, msg: 'invalid key' })
|
|
@@ -447,7 +656,7 @@ function cache() {
|
|
|
447
656
|
|
|
448
657
|
async function getProxy(key, opt = {}) {
|
|
449
658
|
set(key, opt)
|
|
450
|
-
return get(key)
|
|
659
|
+
return get(key, opt) //opt一併傳給get, 使useCloneDeep等取值設定於getProxy亦可生效
|
|
451
660
|
}
|
|
452
661
|
|
|
453
662
|
function update(key, value) {
|
|
@@ -455,13 +664,14 @@ function cache() {
|
|
|
455
664
|
emit('message', { fun: 'updateValue', key })
|
|
456
665
|
data[key].value = value
|
|
457
666
|
data[key].time = Date.now()
|
|
667
|
+
data[key].gen += 1 //執行中被update時, 使本次執行結果不覆寫此值與時間
|
|
458
668
|
}
|
|
459
669
|
}
|
|
460
670
|
|
|
461
671
|
function clear(key) {
|
|
462
672
|
if (haskey(data, key)) {
|
|
463
673
|
emit('message', { fun: 'clear', key })
|
|
464
|
-
data[key].needExec = true
|
|
674
|
+
data[key].needExec = true //於執行中呼叫亦有效: 執行中之呼叫仍取得本次結果, 下次get重新執行
|
|
465
675
|
}
|
|
466
676
|
}
|
|
467
677
|
|
|
@@ -499,7 +709,7 @@ export default cache
|
|
|
499
709
|
<br class="clear">
|
|
500
710
|
|
|
501
711
|
<footer>
|
|
502
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
712
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
503
713
|
</footer>
|
|
504
714
|
|
|
505
715
|
<script>prettyPrint();</script>
|
package/docs/cacheBd.mjs.html
CHANGED
|
@@ -298,7 +298,7 @@ export default cacheBd
|
|
|
298
298
|
<br class="clear">
|
|
299
299
|
|
|
300
300
|
<footer>
|
|
301
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
301
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
302
302
|
</footer>
|
|
303
303
|
|
|
304
304
|
<script>prettyPrint();</script>
|
package/docs/cacheSt.mjs.html
CHANGED
|
@@ -349,7 +349,7 @@ export default cacheSt
|
|
|
349
349
|
<br class="clear">
|
|
350
350
|
|
|
351
351
|
<footer>
|
|
352
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
352
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
353
353
|
</footer>
|
|
354
354
|
|
|
355
355
|
<script>prettyPrint();</script>
|
package/docs/cbol.mjs.html
CHANGED
|
@@ -140,7 +140,7 @@ export default cbol
|
|
|
140
140
|
<br class="clear">
|
|
141
141
|
|
|
142
142
|
<footer>
|
|
143
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
143
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
144
144
|
</footer>
|
|
145
145
|
|
|
146
146
|
<script>prettyPrint();</script>
|
package/docs/cdbl.mjs.html
CHANGED
|
@@ -91,7 +91,7 @@ export default cdbl
|
|
|
91
91
|
<br class="clear">
|
|
92
92
|
|
|
93
93
|
<footer>
|
|
94
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
94
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
95
95
|
</footer>
|
|
96
96
|
|
|
97
97
|
<script>prettyPrint();</script>
|
package/docs/ceil.mjs.html
CHANGED
|
@@ -145,7 +145,7 @@ export default ceil
|
|
|
145
145
|
<br class="clear">
|
|
146
146
|
|
|
147
147
|
<footer>
|
|
148
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
148
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
149
149
|
</footer>
|
|
150
150
|
|
|
151
151
|
<script>prettyPrint();</script>
|
package/docs/cfilesize.mjs.html
CHANGED
|
@@ -117,7 +117,7 @@ export default cfilesize
|
|
|
117
117
|
<br class="clear">
|
|
118
118
|
|
|
119
119
|
<footer>
|
|
120
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
120
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
121
121
|
</footer>
|
|
122
122
|
|
|
123
123
|
<script>prettyPrint();</script>
|
package/docs/cfinancial.mjs.html
CHANGED
|
@@ -112,7 +112,7 @@ export default cfinancial
|
|
|
112
112
|
<br class="clear">
|
|
113
113
|
|
|
114
114
|
<footer>
|
|
115
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
115
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
116
116
|
</footer>
|
|
117
117
|
|
|
118
118
|
<script>prettyPrint();</script>
|
package/docs/cint.mjs.html
CHANGED
|
@@ -102,7 +102,7 @@ export default cint
|
|
|
102
102
|
<br class="clear">
|
|
103
103
|
|
|
104
104
|
<footer>
|
|
105
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
105
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
106
106
|
</footer>
|
|
107
107
|
|
|
108
108
|
<script>prettyPrint();</script>
|
package/docs/clearXSS.mjs.html
CHANGED
|
@@ -132,7 +132,7 @@ export default clearXSS
|
|
|
132
132
|
<br class="clear">
|
|
133
133
|
|
|
134
134
|
<footer>
|
|
135
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed
|
|
135
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 02 2026 15:44:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
136
136
|
</footer>
|
|
137
137
|
|
|
138
138
|
<script>prettyPrint();</script>
|