wsemi 1.9.0 → 1.9.2
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 +4 -4
- package/dist/wsemi.umd.js.map +1 -1
- package/docs/-_class.mjs.html +1 -1
- package/docs/-_const.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 +1 -1
- 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 +476 -333
- 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/evEmit.mjs.html +1 -1
- package/docs/evEmitDelay.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/execCliCore.mjs.html +1 -1
- package/docs/execCliJsonRpc.mjs.html +1 -1
- package/docs/execCliSession.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/isarr1.mjs.html +1 -1
- package/docs/isbigint.mjs.html +1 -1
- package/docs/isblob.mjs.html +42 -23
- 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 +2 -2
- 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/strCompareForVersion.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 +66 -11
- package/package.json +1 -1
- package/src/_getDiff2Html.mjs +44 -38
- package/src/domDragBarAndScroll.mjs +475 -332
- package/src/isblob.mjs +41 -22
- package/src/isfile.mjs +1 -1
- package/test/_getDiff2Html.test.mjs +56 -0
- package/test/blob2ab.test.mjs +6 -0
- package/test/domDragBarAndScroll.test.mjs +1163 -11
- package/test/isblob.test.mjs +28 -1
- package/test/isfile.test.mjs +11 -1
- package/toolfp/dist/wsemip.umd.js +2 -2
- package/toolg/gDistRollup.mjs +2 -0
- package/toolparfor/dist/wpf.umd.js +1 -1
- package/toolparfor/dist/wpf_pmSeries.umd.js +1 -1
package/test/isblob.test.mjs
CHANGED
|
@@ -4,7 +4,34 @@ import isblob from '../src/isblob.mjs'
|
|
|
4
4
|
|
|
5
5
|
describe(`isblob`, function() {
|
|
6
6
|
|
|
7
|
-
//nodejs
|
|
7
|
+
//nodejs 18以上有Blob, 20以上有File
|
|
8
|
+
|
|
9
|
+
it(`should return true when input new Blob`, function() {
|
|
10
|
+
let r = isblob(new Blob([new Uint8Array([1, 2, 3])]))
|
|
11
|
+
assert.strict.deepStrictEqual(r, true)
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it(`should return true when input new File, as File is a subtype of Blob`, function() {
|
|
15
|
+
//input type=file取得者皆為File, 其標籤為[object File]而非[object Blob]
|
|
16
|
+
let f = new File([new Uint8Array([1, 2, 3])], 'a.txt')
|
|
17
|
+
assert.strict.deepStrictEqual(Object.prototype.toString.call(f), '[object File]')
|
|
18
|
+
assert.strict.deepStrictEqual(isblob(f), true)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it(`should return true for other Blob subclasses by instanceof`, function() {
|
|
22
|
+
class MyBlob extends Blob {
|
|
23
|
+
get [Symbol.toStringTag]() {
|
|
24
|
+
return 'MyBlob'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let r = isblob(new MyBlob([new Uint8Array([1])]))
|
|
28
|
+
assert.strict.deepStrictEqual(r, true)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it(`should return false for a plain object faking blob members`, function() {
|
|
32
|
+
let r = isblob({ size: 3, type: '', slice: () => {}, arrayBuffer: () => {} })
|
|
33
|
+
assert.strict.deepStrictEqual(r, false)
|
|
34
|
+
})
|
|
8
35
|
|
|
9
36
|
it(`should return false when input new ArrayBuffer(1)`, function() {
|
|
10
37
|
let ab = new ArrayBuffer(1)
|
package/test/isfile.test.mjs
CHANGED
|
@@ -4,7 +4,17 @@ import isfile from '../src/isfile.mjs'
|
|
|
4
4
|
|
|
5
5
|
describe(`isfile`, function() {
|
|
6
6
|
|
|
7
|
-
//nodejs
|
|
7
|
+
//nodejs 20以上有File
|
|
8
|
+
|
|
9
|
+
it(`should return true when input new File`, function() {
|
|
10
|
+
let r = isfile(new File([new Uint8Array([1, 2, 3])], 'a.txt'))
|
|
11
|
+
assert.strict.deepStrictEqual(r, true)
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it(`should return false when input new Blob, as isfile stays strict`, function() {
|
|
15
|
+
let r = isfile(new Blob([new Uint8Array([1, 2, 3])]))
|
|
16
|
+
assert.strict.deepStrictEqual(r, false)
|
|
17
|
+
})
|
|
8
18
|
|
|
9
19
|
it(`should return false when input new ArrayBuffer(1)`, function() {
|
|
10
20
|
let ab = new ArrayBuffer(1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* wsemip v1.9.
|
|
2
|
+
* wsemip v1.9.2
|
|
3
3
|
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("path"),require("fs")):"function"==typeof define&&define.amd?define(["exports","path","fs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).wsemip={},t.path,t.fs)}(this,function(t,e,r){"use strict";function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function u(t,e,n,u,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var c=new o(n,u||t,i),f=r?r+e:e;return t._events[f]?t._events[f].fn?t._events[f]=[t._events[f],c]:t._events[f].push(c):(t._events[f]=c,t._eventsCount++),t}function i(t,e){0===--t._eventsCount?t._events=new n:delete t._events[e]}function c(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),c.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},c.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,u=n.length,i=new Array(u);o<u;o++)i[o]=n[o].fn;return i},c.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,o,u,i){var c=r?r+t:t;if(!this._events[c])return!1;var f,a,s=this._events[c],l=arguments.length;if(s.fn){switch(s.once&&this.removeListener(t,s.fn,void 0,!0),l){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,e),!0;case 3:return s.fn.call(s.context,e,n),!0;case 4:return s.fn.call(s.context,e,n,o),!0;case 5:return s.fn.call(s.context,e,n,o,u),!0;case 6:return s.fn.call(s.context,e,n,o,u,i),!0}for(a=1,f=new Array(l-1);a<l;a++)f[a-1]=arguments[a];s.fn.apply(s.context,f)}else{var p,h=s.length;for(a=0;a<h;a++)switch(s[a].once&&this.removeListener(t,s[a].fn,void 0,!0),l){case 1:s[a].fn.call(s[a].context);break;case 2:s[a].fn.call(s[a].context,e);break;case 3:s[a].fn.call(s[a].context,e,n);break;case 4:s[a].fn.call(s[a].context,e,n,o);break;default:if(!f)for(p=1,f=new Array(l-1);p<l;p++)f[p-1]=arguments[p];s[a].fn.apply(s[a].context,f)}}return!0},c.prototype.on=function(t,e,r){return u(this,t,e,r,!1)},c.prototype.once=function(t,e,r){return u(this,t,e,r,!0)},c.prototype.removeListener=function(t,e,n,o){var u=r?r+t:t;if(!this._events[u])return this;if(!e)return i(this,u),this;var c=this._events[u];if(c.fn)c.fn!==e||o&&!c.once||n&&c.context!==n||i(this,u);else{for(var f=0,a=[],s=c.length;f<s;f++)(c[f].fn!==e||o&&!c[f].once||n&&c[f].context!==n)&&a.push(c[f]);a.length?this._events[u]=1===a.length?a[0]:a:i(this,u)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&i(this,e)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t.exports=c}(o);var u=n(o.exports);function i(){return new u}var c=Array.isArray,f="object"==typeof global&&global&&global.Object===Object&&global,a="object"==typeof self&&self&&self.Object===Object&&self,s=f||a||Function("return this")(),l=s.Symbol,p=Object.prototype,h=p.hasOwnProperty,v=p.toString,d=l?l.toStringTag:void 0;var y=Object.prototype.toString;var b=l?l.toStringTag:void 0;function g(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?function(t){var e=h.call(t,d),r=t[d];try{t[d]=void 0;var n=!0}catch(t){}var o=v.call(t);return n&&(e?t[d]=r:delete t[d]),o}(t):function(t){return y.call(t)}(t)}function m(t){return null!=t&&"object"==typeof t}function _(t){return"symbol"==typeof t||m(t)&&"[object Symbol]"==g(t)}var j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/;function S(t,e){if(c(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!_(t))||(w.test(t)||!j.test(t)||null!=e&&t in Object(e))}function O(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function A(t){if(!O(t))return!1;var e=g(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var x,E=s["__core-js_shared__"],F=(x=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";var k=Function.prototype.toString;function N(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var z=/^\[object .+?Constructor\]$/,P=Function.prototype,I=Object.prototype,$=P.toString,R=I.hasOwnProperty,T=RegExp("^"+$.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function C(t){return!(!O(t)||(e=t,F&&F in e))&&(A(t)?T:z).test(N(t));var e}function M(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return C(r)?r:void 0}var L=M(Object,"create");var D=Object.prototype.hasOwnProperty;var B=Object.prototype.hasOwnProperty;function W(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function G(t,e){return t===e||t!=t&&e!=e}function Z(t,e){for(var r=t.length;r--;)if(G(t[r][0],e))return r;return-1}W.prototype.clear=function(){this.__data__=L?L(null):{},this.size=0},W.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},W.prototype.get=function(t){var e=this.__data__;if(L){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return D.call(e,t)?e[t]:void 0},W.prototype.has=function(t){var e=this.__data__;return L?void 0!==e[t]:B.call(e,t)},W.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=L&&void 0===e?"__lodash_hash_undefined__":e,this};var U=Array.prototype.splice;function q(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}q.prototype.clear=function(){this.__data__=[],this.size=0},q.prototype.delete=function(t){var e=this.__data__,r=Z(e,t);return!(r<0)&&(r==e.length-1?e.pop():U.call(e,r,1),--this.size,!0)},q.prototype.get=function(t){var e=this.__data__,r=Z(e,t);return r<0?void 0:e[r][1]},q.prototype.has=function(t){return Z(this.__data__,t)>-1},q.prototype.set=function(t,e){var r=this.__data__,n=Z(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var V=M(s,"Map");function J(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function X(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}X.prototype.clear=function(){this.size=0,this.__data__={hash:new W,map:new(V||q),string:new W}},X.prototype.delete=function(t){var e=J(this,t).delete(t);return this.size-=e?1:0,e},X.prototype.get=function(t){return J(this,t).get(t)},X.prototype.has=function(t){return J(this,t).has(t)},X.prototype.set=function(t,e){var r=J(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function H(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var i=t.apply(this,n);return r.cache=u.set(o,i)||u,i};return r.cache=new(H.Cache||X),r}H.Cache=X;var Q,K,Y,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/\\(\\)?/g,rt=(Q=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,function(t,r,n,o){e.push(n?o.replace(et,"$1"):r||t)}),e},K=H(Q,function(t){return 500===Y.size&&Y.clear(),t}),Y=K.cache,K),nt=rt;function ot(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var ut=l?l.prototype:void 0,it=ut?ut.toString:void 0;function ct(t){if("string"==typeof t)return t;if(c(t))return ot(t,ct)+"";if(_(t))return it?it.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ft(t){return null==t?"":ct(t)}function at(t,e){return c(t)?t:S(t,e)?[t]:nt(ft(t))}function st(t){if("string"==typeof t||_(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function lt(t,e){for(var r=0,n=(e=at(e,t)).length;null!=t&&r<n;)t=t[st(e[r++])];return r&&r==n?t:void 0}function pt(t,e,r){var n=null==t?void 0:lt(t,e);return void 0===n?r:n}function ht(t,e={}){let r=pt(e,"fs"),n=!1;try{r.statSync(t),n=!0}catch{n=!1}return n}function vt(t,e={}){let r=pt(e,"fs");if(!ht(t,{fs:r}))return!1;let n=r.lstatSync(t);return!n.isFile()&&!n.isSymbolicLink()}function dt(t,e={}){let r=pt(e,"fs");if(vt(t,{fs:r}))return{success:"input folder is already exists: "+t};if(ht(t,{fs:r}))return{error:"input path already exists: "+t};try{r.mkdirSync(t,{recursive:!0})}catch(t){return{error:t}}return{success:"done: "+t}}function yt(t){return!0===t||!1===t||m(t)&&"[object Boolean]"==g(t)}function bt(t){return yt(t)}function gt(t,e={}){let r=pt(e,"fs");return!!ht(t,{fs:r})&&(!r.lstatSync(t).isDirectory()&&!r.lstatSync(t).isSymbolicLink())}function mt(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs"),u=pt(r,"useSync","");bt(u)||(u=!0);let i="";return i=u?function(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!gt(t,{fs:o}))return{error:`fpSrc[${t}] is not a file`};try{dt(n.dirname(e),{fs:o}),o.copyFileSync(t,e)}catch(t){return{error:t}}return{success:"done: "+e}}(t,e,{path:n,fs:o}):async function(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!gt(t,{fs:o}))return{error:`fpSrc[${t}] is not a file`};let u=null;return await(async(t,e)=>{dt(n.dirname(e),{fs:o}),await new Promise((r,n)=>{let u=o.createReadStream(t),i=o.createWriteStream(e);u.on("error",n),i.on("error",n),i.on("finish",r),u.pipe(i)})})(t,e).then(()=>{u={success:"done: "+e}}).catch(t=>{u={error:t}}),u}(t,e,{path:n,fs:o}),i}function _t(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))return{error:`fpSrc[${t}] is not a folder`};try{o.readdirSync(t).forEach(function(r){let u=n.resolve(t,r),i=n.resolve(e,r),c=o.lstatSync(u);if(c.isDirectory())dt(i,{fs:o}),_t(u,i,{path:n,fs:o});else if(c.isSymbolicLink()){let t=o.readlinkSync(u);o.symlinkSync(t,i)}else dt(n.dirname(i),{fs:o}),o.copyFileSync(u,i)})}catch(t){return{error:t}}return{success:"done: "+e}}function jt(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs"),u=pt(r,"useSync","");bt(u)||(u=!0);let i="";return i=u?_t(t,e,{path:n,fs:o}):async function(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))return{error:`fpSrc[${t}] is not a folder`};let u=async(t,e)=>{let r=o.readdirSync(t);for(let i of r){let r=n.join(t,i),c=n.join(e,i),f=o.lstatSync(r);if(f.isDirectory())dt(c,{fs:o}),await u(r,c);else if(f.isSymbolicLink()){let t=o.readlinkSync(r);o.symlinkSync(t,c)}else dt(n.dirname(c),{fs:o}),await new Promise((t,e)=>{let n=o.createReadStream(r),u=o.createWriteStream(c);n.on("error",e),u.on("error",e),u.on("finish",t),n.pipe(u)})}},i=null;return await u(t,e).then(()=>{i={success:"done: "+e}}).catch(t=>{i={error:t}}),i}(t,e,{path:n,fs:o}),i}function wt(t,e){for(var r=-1,n=null==t?0:t.length,o=0,u=[];++r<n;){var i=t[r];e(i,r,t)&&(u[o++]=i)}return u}var St,Ot=function(t,e,r){for(var n=-1,o=Object(t),u=r(t),i=u.length;i--;){var c=u[St?i:++n];if(!1===e(o[c],c,o))break}return t};function At(t){return m(t)&&"[object Arguments]"==g(t)}var xt=Object.prototype,Et=xt.hasOwnProperty,Ft=xt.propertyIsEnumerable,kt=At(function(){return arguments}())?At:function(t){return m(t)&&Et.call(t,"callee")&&!Ft.call(t,"callee")},Nt=kt;var zt="object"==typeof t&&t&&!t.nodeType&&t,Pt=zt&&"object"==typeof module&&module&&!module.nodeType&&module,It=Pt&&Pt.exports===zt?s.Buffer:void 0,$t=(It?It.isBuffer:void 0)||function(){return!1},Rt=/^(?:0|[1-9]\d*)$/;function Tt(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Rt.test(t))&&t>-1&&t%1==0&&t<e}function Ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var Mt={};function Lt(t){return function(e){return t(e)}}Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=!1;var Dt="object"==typeof t&&t&&!t.nodeType&&t,Bt=Dt&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=Bt&&Bt.exports===Dt&&f.process,Gt=function(){try{var t=Bt&&Bt.require&&Bt.require("util").types;return t||Wt&&Wt.binding&&Wt.binding("util")}catch(t){}}(),Zt=Gt&&Gt.isTypedArray,Ut=Zt?Lt(Zt):function(t){return m(t)&&Ct(t.length)&&!!Mt[g(t)]},qt=Object.prototype.hasOwnProperty;function Vt(t,e){var r=c(t),n=!r&&Nt(t),o=!r&&!n&&$t(t),u=!r&&!n&&!o&&Ut(t),i=r||n||o||u,f=i?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],a=f.length;for(var s in t)!e&&!qt.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||u&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Tt(s,a))||f.push(s);return f}var Jt=Object.prototype;var Xt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Ht=Xt,Qt=Object.prototype.hasOwnProperty;function Kt(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||Jt))return Ht(t);var e,r,n=[];for(var o in Object(t))Qt.call(t,o)&&"constructor"!=o&&n.push(o);return n}function Yt(t){return null!=t&&Ct(t.length)&&!A(t)}function te(t){return Yt(t)?Vt(t):Kt(t)}var ee=function(t,e){return function(r,n){if(null==r)return r;if(!Yt(r))return t(r,n);for(var o=r.length,u=e?o:-1,i=Object(r);(e?u--:++u<o)&&!1!==n(i[u],u,i););return r}}(function(t,e){return t&&Ot(t,e,te)}),re=ee;function ne(t,e){var r=[];return re(t,function(t,n,o){e(t,n,o)&&r.push(t)}),r}function oe(t){var e=this.__data__=new q(t);this.size=e.size}oe.prototype.clear=function(){this.__data__=new q,this.size=0},oe.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},oe.prototype.get=function(t){return this.__data__.get(t)},oe.prototype.has=function(t){return this.__data__.has(t)},oe.prototype.set=function(t,e){var r=this.__data__;if(r instanceof q){var n=r.__data__;if(!V||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new X(n)}return r.set(t,e),this.size=r.size,this};function ue(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new X;++e<r;)this.add(t[e])}function ie(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function ce(t,e){return t.has(e)}ue.prototype.add=ue.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ue.prototype.has=function(t){return this.__data__.has(t)};function fe(t,e,r,n,o,u){var i=1&r,c=t.length,f=e.length;if(c!=f&&!(i&&f>c))return!1;var a=u.get(t),s=u.get(e);if(a&&s)return a==e&&s==t;var l=-1,p=!0,h=2&r?new ue:void 0;for(u.set(t,e),u.set(e,t);++l<c;){var v=t[l],d=e[l];if(n)var y=i?n(d,v,l,e,t,u):n(v,d,l,t,e,u);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!ie(e,function(t,e){if(!ce(h,e)&&(v===t||o(v,t,r,n,u)))return h.push(e)})){p=!1;break}}else if(v!==d&&!o(v,d,r,n,u)){p=!1;break}}return u.delete(t),u.delete(e),p}var ae=s.Uint8Array;function se(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function le(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var pe=l?l.prototype:void 0,he=pe?pe.valueOf:void 0;var ve=Object.prototype.propertyIsEnumerable,de=Object.getOwnPropertySymbols,ye=de?function(t){return null==t?[]:(t=Object(t),wt(de(t),function(e){return ve.call(t,e)}))}:function(){return[]};function be(t){return function(t,e,r){var n=e(t);return c(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,te,ye)}var ge=Object.prototype.hasOwnProperty;var me=M(s,"DataView"),_e=M(s,"Promise"),je=M(s,"Set"),we=M(s,"WeakMap"),Se="[object Map]",Oe="[object Promise]",Ae="[object Set]",xe="[object WeakMap]",Ee="[object DataView]",Fe=N(me),ke=N(V),Ne=N(_e),ze=N(je),Pe=N(we),Ie=g;(me&&Ie(new me(new ArrayBuffer(1)))!=Ee||V&&Ie(new V)!=Se||_e&&Ie(_e.resolve())!=Oe||je&&Ie(new je)!=Ae||we&&Ie(new we)!=xe)&&(Ie=function(t){var e=g(t),r="[object Object]"==e?t.constructor:void 0,n=r?N(r):"";if(n)switch(n){case Fe:return Ee;case ke:return Se;case Ne:return Oe;case ze:return Ae;case Pe:return xe}return e});var $e=Ie,Re="[object Arguments]",Te="[object Array]",Ce="[object Object]",Me=Object.prototype.hasOwnProperty;function Le(t,e,r,n,o,u){var i=c(t),f=c(e),a=i?Te:$e(t),s=f?Te:$e(e),l=(a=a==Re?Ce:a)==Ce,p=(s=s==Re?Ce:s)==Ce,h=a==s;if(h&&$t(t)){if(!$t(e))return!1;i=!0,l=!1}if(h&&!l)return u||(u=new oe),i||Ut(t)?fe(t,e,r,n,o,u):function(t,e,r,n,o,u,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!u(new ae(t),new ae(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return G(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=se;case"[object Set]":var f=1&n;if(c||(c=le),t.size!=e.size&&!f)return!1;var a=i.get(t);if(a)return a==e;n|=2,i.set(t,e);var s=fe(c(t),c(e),n,o,u,i);return i.delete(t),s;case"[object Symbol]":if(he)return he.call(t)==he.call(e)}return!1}(t,e,a,r,n,o,u);if(!(1&r)){var v=l&&Me.call(t,"__wrapped__"),d=p&&Me.call(e,"__wrapped__");if(v||d){var y=v?t.value():t,b=d?e.value():e;return u||(u=new oe),o(y,b,r,n,u)}}return!!h&&(u||(u=new oe),function(t,e,r,n,o,u){var i=1&r,c=be(t),f=c.length;if(f!=be(e).length&&!i)return!1;for(var a=f;a--;){var s=c[a];if(!(i?s in e:ge.call(e,s)))return!1}var l=u.get(t),p=u.get(e);if(l&&p)return l==e&&p==t;var h=!0;u.set(t,e),u.set(e,t);for(var v=i;++a<f;){var d=t[s=c[a]],y=e[s];if(n)var b=i?n(y,d,s,e,t,u):n(d,y,s,t,e,u);if(!(void 0===b?d===y||o(d,y,r,n,u):b)){h=!1;break}v||(v="constructor"==s)}if(h&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(h=!1)}return u.delete(t),u.delete(e),h}(t,e,r,n,o,u))}function De(t,e,r,n,o){return t===e||(null==t||null==e||!m(t)&&!m(e)?t!=t&&e!=e:Le(t,e,r,n,De,o))}function Be(t){return t==t&&!O(t)}function We(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function Ge(t){var e=function(t){for(var e=te(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Be(o)]}return e}(t);return 1==e.length&&e[0][2]?We(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,u=o,i=!n;if(null==t)return!u;for(t=Object(t);o--;){var c=r[o];if(i&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<u;){var f=(c=r[o])[0],a=t[f],s=c[1];if(i&&c[2]){if(void 0===a&&!(f in t))return!1}else{var l=new oe;if(n)var p=n(a,s,f,t,e,l);if(!(void 0===p?De(s,a,3,n,l):p))return!1}}return!0}(r,t,e)}}function Ze(t,e){return null!=t&&e in Object(t)}function Ue(t,e){return null!=t&&function(t,e,r){for(var n=-1,o=(e=at(e,t)).length,u=!1;++n<o;){var i=st(e[n]);if(!(u=null!=t&&r(t,i)))break;t=t[i]}return u||++n!=o?u:!!(o=null==t?0:t.length)&&Ct(o)&&Tt(i,o)&&(c(t)||Nt(t))}(t,e,Ze)}function qe(t){return t}function Ve(t){return function(e){return null==e?void 0:e[t]}}function Je(t){return S(t)?Ve(st(t)):function(t){return function(e){return lt(e,t)}}(t)}function Xe(t){return"function"==typeof t?t:null==t?qe:"object"==typeof t?c(t)?function(t,e){return S(t)&&Be(e)?We(st(t),e):function(r){var n=pt(r,t);return void 0===n&&n===e?Ue(r,t):De(e,n,3)}}(t[0],t[1]):Ge(t):Je(t)}function He(t,e){return(c(t)?wt:ne)(t,Xe(e))}function Qe(t,e){var r=-1,n=Yt(t)?Array(t.length):[];return re(t,function(t,o,u){n[++r]=e(t,o,u)}),n}function Ke(t,e){return(c(t)?ot:Qe)(t,Xe(e))}function Ye(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function tr(t,e){var r;return(c(t)?Ye:re)(t,"function"==typeof(r=e)?r:qe)}var er=/\s/;var rr=/^\s+/;function nr(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&er.test(t.charAt(e)););return e}(t)+1).replace(rr,""):t}var or=/^[-+]0x[0-9a-f]+$/i,ur=/^0b[01]+$/i,ir=/^0o[0-7]+$/i,cr=parseInt;function fr(t){if("number"==typeof t)return t;if(_(t))return NaN;if(O(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=O(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=nr(t);var r=ur.test(t);return r||ir.test(t)?cr(t.slice(2),r?2:8):or.test(t)?NaN:+t}var ar=1/0;function sr(t){return t?(t=fr(t))===ar||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function lr(t){var e=sr(t),r=e%1;return e==e?r?e-r:e:0}function pr(t){return"[object String]"===Object.prototype.toString.call(t)}function hr(t){return!(!pr(t)||""===t)}function vr(t){return"[object Number]"===Object.prototype.toString.call(t)}function dr(t){return t!=t}function yr(t){let e=!1;if(hr(t))e=!isNaN(Number(t));else if(vr(t)){if(dr(t))return!1;e=!0}return e}function br(t){if(!yr(t))return 0;return sr(t)}function gr(t,e={}){let r=pt(e,"useLimitSafe",null);return bt(r)||(r=!1),!!yr(t)&&(t=br(t),r?Number.isSafeInteger(t):"number"==typeof(n=t)&&n==lr(n));var n}var mr=s.isFinite,_r=Math.min;var jr=function(t){var e=Math[t];return function(t,r){if(t=fr(t),(r=null==r?0:_r(lr(r),292))&&mr(t)){var n=(ft(t)+"e").split("e");return+((n=(ft(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}("round"),wr=jr;function Sr(t,e={}){let r=pt(e,"useClampSafe",null);bt(r)||(r=!1);let n=pt(e,"useLimitSafe",null);bt(n)||(n=!1);let o=pt(e,"returnWithStateAndMsg",null);bt(o)||(o=!1);let u=t=>o?{state:"success",msg:t}:t,i=t=>{if(o)return{state:"error",msg:t};throw new Error(t)};if(!yr(t))return u(0);let c=null;try{t=br(t),c=wr(t),r&&(c>Number.MAX_SAFE_INTEGER?c=Number.MAX_SAFE_INTEGER:c<Number.MIN_SAFE_INTEGER&&(c=Number.MIN_SAFE_INTEGER))}catch(t){return i(t.toString())}return n&&!Number.isSafeInteger(Number(c))?i(`v[${t}] is not a safe integer`):("0"===String(c)&&(c=0),u(c))}function Or(t,e={}){if(!gr(t,e))return!1;return Sr(t)>0}function Ar(t,e=1,r={}){let n=1,o=pt(r,"path"),u=pt(r,"fs");if(!vt(t,{fs:u}))throw new Error(`fd[${t}] is not a folder`);return null!==e&&Or(e)&&(e=Sr(e))<1&&(e=1),function t(r){let i=[];return vt(r,{fs:u})?(tr(u.readdirSync(r),function(c){let f=o.resolve(r,c),a=null;try{a=u.statSync(f)}catch(t){}a&&a.isDirectory()?(i.push({isFolder:!0,level:n,path:f,name:o.basename(f)}),n+=1,(n<=e||null===e)&&(i=i.concat(t(f))),n-=1):i.push({isFolder:!1,level:n,path:f,name:o.basename(f)})}),i):i}(t)}function xr(t,e={}){if(!gr(t,e))return!1;return Sr(t)>=0}function Er(t,e){if(!hr(t))return"";if(!xr(e))return"";if(0===(e=Sr(e)))return"";let r=t.length-e;return r<0&&(r=0),t.substring(r,r+e)}function Fr(t,e){return hr(t)&&xr(e)?0===(e=Sr(e))?"":t.substring(0,e):""}function kr(t,e){return hr(t)&&xr(e)?0===(e=Sr(e))?t:Fr(t,t.length-e):""}function Nr(t){if(!hr(t))return{path:"",isRoot:!1};for(;t.indexOf("\\\\")>=0;)t=t.replace("\\\\","\\");for(;t.indexOf("//")>=0;)t=t.replace("//","/");if(":"===Er(t,1))return{path:`${t}\\`,isRoot:!0};if("\\"===Er(t,1)){let e=kr(t,1);return":"===Er(e,1)?{path:t,isRoot:!0}:{path:e,isRoot:!1}}if("/"===Er(t,1)){let e=kr(t,1);return 0===e.length?{path:t,isRoot:!0}:{path:e,isRoot:!1}}return{path:t,isRoot:!1}}function zr(t){if(!hr(t))return"";let e=Nr(t);if(e.isRoot)return e.path;let r=e.path;try{r=r.split("\\").pop().split("/").pop()}catch(t){}return r}function Pr(t){if(!hr(t))return"";let e=Nr(t);if(e.isRoot)return e.path;let r=zr(t=e.path);if(!hr(r))return t;let n=Nr(t=kr(t,r.length));return n.isRoot,n.path}let Ir="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),$r=Ir.length;function Rr(t=32){let e=[];t=Or(t)?Sr(t):32;for(let r=0;r<t;r++)e[r]=Ir[0|Math.random()*$r];return e.join("")}function Tr(){let t,e,r=new Promise(function(){t=arguments[0],e=arguments[1]});return r.resolve=t,r.reject=e,r}var Cr=Array.prototype.join;function Mr(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var u=Array(o);++n<o;)u[n]=t[n+e];return u}function Lr(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:Mr(t,e,r)}var Dr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Br(t){return Dr.test(t)}var Wr=Gt&&Gt.isRegExp,Gr=Wr?Lt(Wr):function(t){return m(t)&&"[object RegExp]"==g(t)};var Zr="\\ud800-\\udfff",Ur="["+Zr+"]",qr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Vr="\\ud83c[\\udffb-\\udfff]",Jr="[^"+Zr+"]",Xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Hr="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="(?:"+qr+"|"+Vr+")"+"?",Kr="[\\ufe0e\\ufe0f]?",Yr=Kr+Qr+("(?:\\u200d(?:"+[Jr,Xr,Hr].join("|")+")"+Kr+Qr+")*"),tn="(?:"+[Jr+qr+"?",qr,Xr,Hr,Ur].join("|")+")",en=RegExp(Vr+"(?="+Vr+")|"+tn+Yr,"g");function rn(t){return Br(t)?function(t){return t.match(en)||[]}(t):function(t){return t.split("")}(t)}function nn(t,e,r){return r&&"number"!=typeof r&&function(t,e,r){if(!O(r))return!1;var n=typeof e;return!!("number"==n?Yt(r)&&Tt(e,r.length):"string"==n&&e in r)&&G(r[e],t)}(t,e,r)&&(e=r=void 0),(r=void 0===r?4294967295:r>>>0)?(t=ft(t))&&("string"==typeof e||null!=e&&!Gr(e))&&!(e=ct(e))&&Br(t)?Lr(rn(t),0,r):t.split(e,r):[]}var on=Ve("length"),un="\\ud800-\\udfff",cn="["+un+"]",fn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",an="\\ud83c[\\udffb-\\udfff]",sn="[^"+un+"]",ln="(?:\\ud83c[\\udde6-\\uddff]){2}",pn="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="(?:"+fn+"|"+an+")"+"?",vn="[\\ufe0e\\ufe0f]?",dn=vn+hn+("(?:\\u200d(?:"+[sn,ln,pn].join("|")+")"+vn+hn+")*"),yn="(?:"+[sn+fn+"?",fn,ln,pn,cn].join("|")+")",bn=RegExp(an+"(?="+an+")|"+yn+dn,"g");function gn(t){return Br(t)?function(t){for(var e=bn.lastIndex=0;bn.test(t);)++e;return e}(t):on(t)}function mn(t){if(null==t)return 0;if(Yt(t))return"string"==typeof(e=t)||!c(e)&&m(e)&&"[object String]"==g(e)?gn(t):t.length;var e,r=$e(t);return"[object Map]"==r||"[object Set]"==r?t.size:Kt(t).length}function _n(t){return"[object Array]"===Object.prototype.toString.call(t)}function jn(t){return!!_n(t)&&0===t.length}function wn(t){return"[object Undefined]"===Object.prototype.toString.call(t)}function Sn(t){return"[object Null]"===Object.prototype.toString.call(t)}function On(t){return"[object Object]"===Object.prototype.toString.call(t)}function An(t){if(On(t)){for(let e in t)return!1;return!0}return!1}function xn(t){return!(!pr(t)||""!==t)}function En(t){return!!wn(t)||(!!Sn(t)||(!!An(t)||(!!xn(t)||(!!jn(t)||!!dr(t)))))}let Fn=/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{0,58}[A-Za-z0-9])$/;function kn(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}function Nn(t){if(!gr(t))return!1;return Sr(t)<0}function zn(t){let e,r=Object.prototype.toString.call(t);if(e="[object Promise]"===r,e)return!0;if("[object Function]"!==r)return!1;try{e="function"!=typeof t.subscribe&&"function"==typeof t.then}catch(t){}return e}let Pn=function(t){if(!kn(t))throw new Error("fn is not a function");return function(){let e=Tr(),r=null,n=null;try{r=t.apply(this,arguments)}catch(t){n=t}return null!==n?e.resolve({state:"error",msg:n}):zn(r)?r.then(t=>{e.resolve({state:"success",msg:t})}).catch(t=>{"cancelled"===pt(t,"reason")?e.resolve({state:"cancelled",msg:""}):e.resolve({state:"error",msg:t})}):e.resolve({state:"success",msg:r}),e}};function In(t,e=()=>{}){if(!kn(t))return null;function r(t,e){let r;return Sn(t)||wn(t)?e:(r=pt(t,"data",null),r||t)}return kn(e)||(e=()=>{}),function(){let n,o=Tr(),u=e({mode:"before",data:arguments});return(Sn(u)||wn(u))&&(u=arguments),t(...u).then(t=>{n=e({mode:"afterThen",data:t}),t=r(n,t),o.resolve(t)}).catch(t=>{n=e({mode:"afterCatch",data:t}),t=r(n,t),o.reject(t)}),o}}function $n(t){return null==t?[]:function(t,e){return ot(e,function(e){return t[e]})}(t,te(t))}function Rn(t,e,r=[],n={}){let o=n.funSettle,u=n.tag||"evem",i=(e,...r)=>t.emit(e,...r);kn(n.funEmit)&&(i=n.funEmit);try{return i(e,...r)}catch(n){if(kn(o))try{o(n)}catch(t){}try{"error"!==e&&t.listenerCount("error")>0?i("error",{fun:"listener",name:e,msg:n,args:r}):console.error(`[wsemi ${u}] listener of '${String(e)}' threw:`,n)}catch(t){try{console.error(`[wsemi ${u}] listener of '${String(e)}' threw, and reporting it also threw:`,t,n)}catch(t){}}return!1}}function Tn(t=0){let e=0,r=[];Nn(t)&&(t=0),t=Sr(t);let n=i();return n.get=function(){if(r.length>0){return e+=1,r.splice(0,1)[0]}return null},n.cb=function(){e-=1,e<0&&(e=0),r.length>0&&Rn(n,"message",[r],{tag:"queue"})},n.push=function(o){r.push(o),(t<=0||e<t)&&Rn(n,"message",[r],{tag:"queue"})},n.clear=function(){e=0,r=[]},n}let Cn=2147483647;function Mn(t){return t!=t}function Ln(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var o=t.length,u=r+(n?1:-1);n?u--:++u<o;)if(e(t[u],u,t))return u;return-1}(t,Mn,r)}function Dn(t,e,r){if((t=ft(t))&&(r||void 0===e))return nr(t);if(!t||!(e=ct(e)))return t;var n=rn(t),o=rn(e),u=function(t,e){for(var r=-1,n=t.length;++r<n&&Ln(e,t[r],0)>-1;);return r}(n,o),i=function(t,e){for(var r=t.length;r--&&Ln(e,t[r],0)>-1;);return r}(n,o)+1;return Lr(n,u,i).join("")}t.evem=i,t.fsCleanFolder=function(t){return function(t,e={}){let r=pt(e,"path"),n=pt(e,"fs");if(!ht(t,{fs:n})){let e=dt(t,{fs:n});return e.error?e.error:{success:"done: "+t}}if(!vt(t,{fs:n}))return{error:"input path is not a folder"};try{let e=n.readdirSync(t);for(let o of e){let e=r.join(t,o);n.statSync(e).isDirectory()?n.rmSync(e,{recursive:!0,force:!0}):n.unlinkSync(e)}}catch(t){return{error:t}}return{success:"done: "+t}}(t,{path:e,fs:r})},t.fsCopyFile=function(t,n,o={}){return mt(t,n,{path:e,fs:r,...o})},t.fsCopyFolder=function(t,n,o={}){return jt(t,n,{path:e,fs:r,...o})},t.fsCreateFolder=function(t){return dt(t,{fs:r})},t.fsDeleteFolder=function(t){return function(t,e={}){let r=pt(e,"fs");if(!ht(t,{fs:r}))return{success:"folder does not exist: "+t};if(!vt(t,{fs:r}))return{error:"input path is not a folder: "+t};try{r.rmSync(t,{recursive:!0,force:!0})}catch(t){return{error:t}}return{success:"done: "+t}}(t,{fs:r})},t.fsGetFilesInFolder=function(t,n=1){return function(t,e=1,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))throw new Error(`fd[${t}] is not a folder`);let u=[];return u=Ar(t,e,{path:n,fs:o}),u=He(u,{isFolder:!1}),u=Ke(u,t=>(delete t.isFolder,t)),u}(t,n,{path:e,fs:r})},t.fsGetFoldersInFolder=function(t,n=1){return function(t,e=1,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))throw new Error(`fd[${t}] is not a folder`);let u=[];return u=Ar(t,e,{path:n,fs:o}),u=He(u,{isFolder:!0}),u=Ke(u,t=>(delete t.isFolder,t)),u}(t,n,{path:e,fs:r})},t.fsIsFile=function(t){return gt(t,{fs:r})},t.fsIsFolder=function(t){return vt(t,{fs:r})},t.fsReadText=function(t){return function(t,e={}){let r=null,n=pt(e,"fs"),o="";try{o=n.readFileSync(t,"utf8")}catch(t){r=t}return null!==r?{error:r}:{success:o}}(t,{fs:r})},t.fsTreeFolder=function(t,n=1){return Ar(t,n,{path:e,fs:r})},t.fsWriteText=function(t,e){return function(t,e,r={}){let n=null,o=pt(r,"fs"),u=Pr(t);vt(u,{fs:o})||dt(u,{fs:o});try{o.writeFileSync(t,e,"utf8")}catch(t){n=t}return null!==n?{error:n}:{success:t}}(t,e,{fs:r})},t.genID=Rr,t.genPm=Tr,t.getClearPathName=Nr,t.getFileName=zr,t.getFileTrueName=function(t){if(!hr(t))return"";let e=zr(t),r=nn(e,".");if(mn(r)<=1)return e;let n="";try{r=(c=null==(o=r)?0:o.length)?Mr(o,0,(u=c-(u=i||void 0===u?1:lr(u)))<0?0:u):[],n=function(t,e){return null==t?"":Cr.call(t,e)}(r,".")}catch(t){}var o,u,i,c;return n},t.getGlobal=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null},t.getPathParent=Pr,t.isEmail=function(t){return!!hr(t)&&(!(t.length>254)&&(!(t.indexOf("@")>64)&&Fn.test(t)))},t.isIE=function(){return null!==navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)},t.isab=function(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t)},t.isarr=_n,t.isarr0=jn,t.isblob=function(t){return"[object Blob]"===Object.prototype.toString.call(t)},t.isbol=bt,t.isearr=function(t){return!!_n(t)&&(0!==t.length&&(1!==t.length||!En(t[0])))},t.iseobj=function(t){if(On(t)){for(let e in t)return!0;return!1}return!1},t.iser=En,t.isernot=function(t){return!En(t)},t.isestr=hr,t.isfun=kn,t.isint=gr,t.isn0int=function(t){return!!gr(t)&&Sr(t)<=0},t.isn0num=function(t){return!!yr(t)&&br(t)<=0},t.isnbr=vr,t.isnint=Nn,t.isnull=Sn,t.isnum=yr,t.isobj=On,t.isobj0=An,t.isp0int=xr,t.isp0num=function(t){return!!yr(t)&&br(t)>=0},t.ispint=Or,t.ispm=zn,t.isstr=pr,t.isstr0=xn,t.isundefined=wn,t.j2o=function(t,e={}){let r=pt(e,"returnWithStateAndMsg",null);bt(r)||(r=!1);let n=t=>r?{state:"error",msg:t}:{};if(!hr(t))return n("invalid v");let o={};try{o=JSON.parse(t)}catch(t){return n(t.toString())}return r?{state:"success",msg:o}:o},t.o2j=function(t,e=!1,r={}){let n=pt(r,"returnWithStateAndMsg",null);bt(n)||(n=!1);let o=t=>n?{state:"error",msg:t}:"";if(wn(t))return o("invalid v");let u="";try{u=e?JSON.stringify(t,null,2):JSON.stringify(t)}catch(t){return o(t.toString())}return n?{state:"success",msg:u}:u},t.pm2resolve=Pn,t.pmChain=function(t,e=null){if(!_n(t)){let t=Tr();return t.reject("pms is not an array"),t}return t.reduce((t,e)=>t.then(e),Promise.resolve(e))},t.pmHook=In,t.pmHookReject=function(t,e=()=>{}){return kn(t)?(kn(e)||(e=()=>{}),In(t,t=>{if("afterCatch"===t.mode)return e(t.data)})):null},t.pmIni=function(){return Promise.resolve()},t.pmMap=function(t,e,r=0){let n={},o=!1,u=Tr();if(!_n(t)&&!On(t))return u.reject("rs is not an array or object"),u;if(0===mn(t))return u.resolve([]),u;let i=!1;if(On(t)){i=!0;let e=[];tr(t,(t,r)=>{e.push({k:r,v:t})}),t=e}let c=Tn(r);return c.on("message",function(r){if(o)return;let f,a=c.get();if(kn(e)){let t=a.key,r=a.value;if(i&&(t=a.value.k,r=a.value.v),f=e(r,t),!zn(f))throw new Error("return of fun is not a promise")}else f=a.value;f.then(t=>{n[a.key]=t}).catch(t=>{o=!0,c.clear(),u.reject(t)}).finally(()=>{c.cb(),mn(n)===mn(t)&&u.resolve($n(n))})}),tr(t,(t,e)=>{c.push({key:e,value:t})}),u},t.pmQueue=function(t=0,e=!1){return new function(t,e){let r=null;xr(t)||(t=0),t=Sr(t),yt(e)||(e=!1);let n=Tn(t);return n.on("message",async function(t){let e=n.get();if(!e)return;await function(t=10){yr(t)||(t=10),t=Math.min(t,Cn);let e=Tr();return setTimeout(function(){e.resolve()},t),e}(1);let r,o=pt(e,"id"),u=pt(e,"fun"),i=pt(e,"input");r=kn(u)?await Pn(u)(...i):{state:"error",msg:"fun is not a function"},n.emit(o,r),n.cb()}),function(t,...o){let u=Tr(),i=Rr();r=i;let c={id:i,fun:t,input:o};return n.push(c),n.once(i,t=>{e?i===r?"success"===t.state?u.resolve(t.msg):u.reject(t.msg):u.reject({reason:"cancelled"}):"success"===t.state?u.resolve(t.msg):u.reject(t.msg)}),u}}(t,e)},t.pmSeries=function(t,e){let r=Tr();if(!_n(t)&&!On(t))return r.reject("rs is not an array or object"),r;let n=!1;if(On(t)){n=!0;let e=[];tr(t,(t,r)=>{e.push({k:r,v:t})}),t=e}kn(e)||(e=function(t){return t});let o=-1,u=[];return t.reduce(function(t,r){return t.then(function(t){u.push(t),o+=1;let i=o,c=r;return n&&(i=r.k,c=r.v),kn(e)?e(c,i):c})},Promise.resolve()).then(function(t){var e,n,o,i;u.push(t),i=null==(e=u)?0:e.length,u=i?Mr(e,(n=o||void 0===n?1:lr(n))<0?0:n,i):[],r.resolve(u)}).catch(function(t){r.reject(t)}),r},t.pmThrottle=function(){let t=i(),e=[],r=null,n=!1;return function(o,...u){let i=Tr();if(!kn(o))return void console.log("func is not a function");let c=Rr();return e.push({id:c,func:o,input:u}),null===r&&(r=setInterval(async()=>{if(n)return;n=!0;let o=e.pop();for(let r=0;r<e.length;r++){let n=e[r].id,o={state:"cancelled"};t.emit(n,o)}if(e=[],o){let e,r=o.id;e=kn(o.func)?await Pn(o.func)(...o.input):{state:"error",msg:"fun is not a function"},t.emit(r,e)}n=!1,n||0!==e.length||(clearInterval(r),r=null)},20)),t.once(c,t=>{"success"===t.state?i.resolve(t.msg):"cancelled"===t.state?i.reject({reason:"cancelled"}):i.reject(t.msg)}),i}},t.replace=function(t,e,r){return hr(t)&&hr(e)&&pr(r)?String(t).replaceAll(e,r):""},t.sep=function(t,e){if(!hr(t))return[];if(!hr(e))return[];let r=function(t,e){return hr(t)&&hr(e)?t.split(e):[]}(t,e);r=Ke(r,Dn);let n=[];return tr(r,function(t){hr(t)&&n.push(t)}),n},t.strdelleft=function(t,e){return hr(t)&&xr(e)?0===(e=Sr(e))?t:Er(t,t.length-e):""},t.strdelright=kr,t.strleft=Fr,t.strmid=function(t,e,r=1){return hr(t)&&xr(e)?(r=Or(r)?Sr(r):1,t.substring(e,e+r)):""},t.strright=Er,t.waitFun=async function(t,e={}){let r=null,n=Tr();if(!kn(t))return n.reject("waitfunction需輸入函數f"),n;let o=async()=>{let e=t();return zn(e)&&(e=await e),e};if(r=await o(),!0===r)return n.resolve(),n;let u=pt(e,"attemptNum",null);Or(u)||(u=200);let i=pt(e,"timeInterval",null);Or(i)||(i=1e3),i=Math.min(i,Cn);let c=0,f=setInterval(async()=>{c+=1,r=await o(),!0===r&&(clearInterval(f),n.resolve()),c>u&&(clearInterval(f),n.reject(`exceeded attemptNum[${u}]`))},i);return n}});
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("path"),require("fs")):"function"==typeof define&&define.amd?define(["exports","path","fs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).wsemip={},t.path,t.fs)}(this,function(t,e,r){"use strict";function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function u(t,e,n,u,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var c=new o(n,u||t,i),f=r?r+e:e;return t._events[f]?t._events[f].fn?t._events[f]=[t._events[f],c]:t._events[f].push(c):(t._events[f]=c,t._eventsCount++),t}function i(t,e){0===--t._eventsCount?t._events=new n:delete t._events[e]}function c(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),c.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},c.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,u=n.length,i=new Array(u);o<u;o++)i[o]=n[o].fn;return i},c.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,o,u,i){var c=r?r+t:t;if(!this._events[c])return!1;var f,a,s=this._events[c],l=arguments.length;if(s.fn){switch(s.once&&this.removeListener(t,s.fn,void 0,!0),l){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,e),!0;case 3:return s.fn.call(s.context,e,n),!0;case 4:return s.fn.call(s.context,e,n,o),!0;case 5:return s.fn.call(s.context,e,n,o,u),!0;case 6:return s.fn.call(s.context,e,n,o,u,i),!0}for(a=1,f=new Array(l-1);a<l;a++)f[a-1]=arguments[a];s.fn.apply(s.context,f)}else{var p,h=s.length;for(a=0;a<h;a++)switch(s[a].once&&this.removeListener(t,s[a].fn,void 0,!0),l){case 1:s[a].fn.call(s[a].context);break;case 2:s[a].fn.call(s[a].context,e);break;case 3:s[a].fn.call(s[a].context,e,n);break;case 4:s[a].fn.call(s[a].context,e,n,o);break;default:if(!f)for(p=1,f=new Array(l-1);p<l;p++)f[p-1]=arguments[p];s[a].fn.apply(s[a].context,f)}}return!0},c.prototype.on=function(t,e,r){return u(this,t,e,r,!1)},c.prototype.once=function(t,e,r){return u(this,t,e,r,!0)},c.prototype.removeListener=function(t,e,n,o){var u=r?r+t:t;if(!this._events[u])return this;if(!e)return i(this,u),this;var c=this._events[u];if(c.fn)c.fn!==e||o&&!c.once||n&&c.context!==n||i(this,u);else{for(var f=0,a=[],s=c.length;f<s;f++)(c[f].fn!==e||o&&!c[f].once||n&&c[f].context!==n)&&a.push(c[f]);a.length?this._events[u]=1===a.length?a[0]:a:i(this,u)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&i(this,e)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t.exports=c}(o);var u=n(o.exports);function i(){return new u}var c=Array.isArray,f="object"==typeof global&&global&&global.Object===Object&&global,a="object"==typeof self&&self&&self.Object===Object&&self,s=f||a||Function("return this")(),l=s.Symbol,p=Object.prototype,h=p.hasOwnProperty,v=p.toString,d=l?l.toStringTag:void 0;var y=Object.prototype.toString;var b=l?l.toStringTag:void 0;function g(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?function(t){var e=h.call(t,d),r=t[d];try{t[d]=void 0;var n=!0}catch(t){}var o=v.call(t);return n&&(e?t[d]=r:delete t[d]),o}(t):function(t){return y.call(t)}(t)}function m(t){return null!=t&&"object"==typeof t}function _(t){return"symbol"==typeof t||m(t)&&"[object Symbol]"==g(t)}var j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/;function S(t,e){if(c(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!_(t))||(w.test(t)||!j.test(t)||null!=e&&t in Object(e))}function O(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function A(t){if(!O(t))return!1;var e=g(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var x,F=s["__core-js_shared__"],E=(x=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";var k=Function.prototype.toString;function N(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var z=/^\[object .+?Constructor\]$/,P=Function.prototype,I=Object.prototype,$=P.toString,R=I.hasOwnProperty,T=RegExp("^"+$.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function C(t){return!(!O(t)||(e=t,E&&E in e))&&(A(t)?T:z).test(N(t));var e}function M(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return C(r)?r:void 0}var L=M(Object,"create");var D=Object.prototype.hasOwnProperty;var B=Object.prototype.hasOwnProperty;function W(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function G(t,e){return t===e||t!=t&&e!=e}function Z(t,e){for(var r=t.length;r--;)if(G(t[r][0],e))return r;return-1}W.prototype.clear=function(){this.__data__=L?L(null):{},this.size=0},W.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},W.prototype.get=function(t){var e=this.__data__;if(L){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return D.call(e,t)?e[t]:void 0},W.prototype.has=function(t){var e=this.__data__;return L?void 0!==e[t]:B.call(e,t)},W.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=L&&void 0===e?"__lodash_hash_undefined__":e,this};var U=Array.prototype.splice;function q(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}q.prototype.clear=function(){this.__data__=[],this.size=0},q.prototype.delete=function(t){var e=this.__data__,r=Z(e,t);return!(r<0)&&(r==e.length-1?e.pop():U.call(e,r,1),--this.size,!0)},q.prototype.get=function(t){var e=this.__data__,r=Z(e,t);return r<0?void 0:e[r][1]},q.prototype.has=function(t){return Z(this.__data__,t)>-1},q.prototype.set=function(t,e){var r=this.__data__,n=Z(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var V=M(s,"Map");function J(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function X(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}X.prototype.clear=function(){this.size=0,this.__data__={hash:new W,map:new(V||q),string:new W}},X.prototype.delete=function(t){var e=J(this,t).delete(t);return this.size-=e?1:0,e},X.prototype.get=function(t){return J(this,t).get(t)},X.prototype.has=function(t){return J(this,t).has(t)},X.prototype.set=function(t,e){var r=J(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function H(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var i=t.apply(this,n);return r.cache=u.set(o,i)||u,i};return r.cache=new(H.Cache||X),r}H.Cache=X;var Q,K,Y,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/\\(\\)?/g,rt=(Q=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,function(t,r,n,o){e.push(n?o.replace(et,"$1"):r||t)}),e},K=H(Q,function(t){return 500===Y.size&&Y.clear(),t}),Y=K.cache,K),nt=rt;function ot(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var ut=l?l.prototype:void 0,it=ut?ut.toString:void 0;function ct(t){if("string"==typeof t)return t;if(c(t))return ot(t,ct)+"";if(_(t))return it?it.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ft(t){return null==t?"":ct(t)}function at(t,e){return c(t)?t:S(t,e)?[t]:nt(ft(t))}function st(t){if("string"==typeof t||_(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function lt(t,e){for(var r=0,n=(e=at(e,t)).length;null!=t&&r<n;)t=t[st(e[r++])];return r&&r==n?t:void 0}function pt(t,e,r){var n=null==t?void 0:lt(t,e);return void 0===n?r:n}function ht(t,e={}){let r=pt(e,"fs"),n=!1;try{r.statSync(t),n=!0}catch{n=!1}return n}function vt(t,e={}){let r=pt(e,"fs");if(!ht(t,{fs:r}))return!1;let n=r.lstatSync(t);return!n.isFile()&&!n.isSymbolicLink()}function dt(t,e={}){let r=pt(e,"fs");if(vt(t,{fs:r}))return{success:"input folder is already exists: "+t};if(ht(t,{fs:r}))return{error:"input path already exists: "+t};try{r.mkdirSync(t,{recursive:!0})}catch(t){return{error:t}}return{success:"done: "+t}}function yt(t){return!0===t||!1===t||m(t)&&"[object Boolean]"==g(t)}function bt(t){return yt(t)}function gt(t,e={}){let r=pt(e,"fs");return!!ht(t,{fs:r})&&(!r.lstatSync(t).isDirectory()&&!r.lstatSync(t).isSymbolicLink())}function mt(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs"),u=pt(r,"useSync","");bt(u)||(u=!0);let i="";return i=u?function(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!gt(t,{fs:o}))return{error:`fpSrc[${t}] is not a file`};try{dt(n.dirname(e),{fs:o}),o.copyFileSync(t,e)}catch(t){return{error:t}}return{success:"done: "+e}}(t,e,{path:n,fs:o}):async function(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!gt(t,{fs:o}))return{error:`fpSrc[${t}] is not a file`};let u=null;return await(async(t,e)=>{dt(n.dirname(e),{fs:o}),await new Promise((r,n)=>{let u=o.createReadStream(t),i=o.createWriteStream(e);u.on("error",n),i.on("error",n),i.on("finish",r),u.pipe(i)})})(t,e).then(()=>{u={success:"done: "+e}}).catch(t=>{u={error:t}}),u}(t,e,{path:n,fs:o}),i}function _t(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))return{error:`fpSrc[${t}] is not a folder`};try{o.readdirSync(t).forEach(function(r){let u=n.resolve(t,r),i=n.resolve(e,r),c=o.lstatSync(u);if(c.isDirectory())dt(i,{fs:o}),_t(u,i,{path:n,fs:o});else if(c.isSymbolicLink()){let t=o.readlinkSync(u);o.symlinkSync(t,i)}else dt(n.dirname(i),{fs:o}),o.copyFileSync(u,i)})}catch(t){return{error:t}}return{success:"done: "+e}}function jt(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs"),u=pt(r,"useSync","");bt(u)||(u=!0);let i="";return i=u?_t(t,e,{path:n,fs:o}):async function(t,e,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))return{error:`fpSrc[${t}] is not a folder`};let u=async(t,e)=>{let r=o.readdirSync(t);for(let i of r){let r=n.join(t,i),c=n.join(e,i),f=o.lstatSync(r);if(f.isDirectory())dt(c,{fs:o}),await u(r,c);else if(f.isSymbolicLink()){let t=o.readlinkSync(r);o.symlinkSync(t,c)}else dt(n.dirname(c),{fs:o}),await new Promise((t,e)=>{let n=o.createReadStream(r),u=o.createWriteStream(c);n.on("error",e),u.on("error",e),u.on("finish",t),n.pipe(u)})}},i=null;return await u(t,e).then(()=>{i={success:"done: "+e}}).catch(t=>{i={error:t}}),i}(t,e,{path:n,fs:o}),i}function wt(t,e){for(var r=-1,n=null==t?0:t.length,o=0,u=[];++r<n;){var i=t[r];e(i,r,t)&&(u[o++]=i)}return u}var St,Ot=function(t,e,r){for(var n=-1,o=Object(t),u=r(t),i=u.length;i--;){var c=u[St?i:++n];if(!1===e(o[c],c,o))break}return t};function At(t){return m(t)&&"[object Arguments]"==g(t)}var xt=Object.prototype,Ft=xt.hasOwnProperty,Et=xt.propertyIsEnumerable,kt=At(function(){return arguments}())?At:function(t){return m(t)&&Ft.call(t,"callee")&&!Et.call(t,"callee")},Nt=kt;var zt="object"==typeof t&&t&&!t.nodeType&&t,Pt=zt&&"object"==typeof module&&module&&!module.nodeType&&module,It=Pt&&Pt.exports===zt?s.Buffer:void 0,$t=(It?It.isBuffer:void 0)||function(){return!1},Rt=/^(?:0|[1-9]\d*)$/;function Tt(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Rt.test(t))&&t>-1&&t%1==0&&t<e}function Ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var Mt={};function Lt(t){return function(e){return t(e)}}Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=!1;var Dt="object"==typeof t&&t&&!t.nodeType&&t,Bt=Dt&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=Bt&&Bt.exports===Dt&&f.process,Gt=function(){try{var t=Bt&&Bt.require&&Bt.require("util").types;return t||Wt&&Wt.binding&&Wt.binding("util")}catch(t){}}(),Zt=Gt&&Gt.isTypedArray,Ut=Zt?Lt(Zt):function(t){return m(t)&&Ct(t.length)&&!!Mt[g(t)]},qt=Object.prototype.hasOwnProperty;function Vt(t,e){var r=c(t),n=!r&&Nt(t),o=!r&&!n&&$t(t),u=!r&&!n&&!o&&Ut(t),i=r||n||o||u,f=i?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],a=f.length;for(var s in t)!e&&!qt.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||u&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Tt(s,a))||f.push(s);return f}var Jt=Object.prototype;var Xt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Ht=Xt,Qt=Object.prototype.hasOwnProperty;function Kt(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||Jt))return Ht(t);var e,r,n=[];for(var o in Object(t))Qt.call(t,o)&&"constructor"!=o&&n.push(o);return n}function Yt(t){return null!=t&&Ct(t.length)&&!A(t)}function te(t){return Yt(t)?Vt(t):Kt(t)}var ee=function(t,e){return function(r,n){if(null==r)return r;if(!Yt(r))return t(r,n);for(var o=r.length,u=e?o:-1,i=Object(r);(e?u--:++u<o)&&!1!==n(i[u],u,i););return r}}(function(t,e){return t&&Ot(t,e,te)}),re=ee;function ne(t,e){var r=[];return re(t,function(t,n,o){e(t,n,o)&&r.push(t)}),r}function oe(t){var e=this.__data__=new q(t);this.size=e.size}oe.prototype.clear=function(){this.__data__=new q,this.size=0},oe.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},oe.prototype.get=function(t){return this.__data__.get(t)},oe.prototype.has=function(t){return this.__data__.has(t)},oe.prototype.set=function(t,e){var r=this.__data__;if(r instanceof q){var n=r.__data__;if(!V||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new X(n)}return r.set(t,e),this.size=r.size,this};function ue(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new X;++e<r;)this.add(t[e])}function ie(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function ce(t,e){return t.has(e)}ue.prototype.add=ue.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ue.prototype.has=function(t){return this.__data__.has(t)};function fe(t,e,r,n,o,u){var i=1&r,c=t.length,f=e.length;if(c!=f&&!(i&&f>c))return!1;var a=u.get(t),s=u.get(e);if(a&&s)return a==e&&s==t;var l=-1,p=!0,h=2&r?new ue:void 0;for(u.set(t,e),u.set(e,t);++l<c;){var v=t[l],d=e[l];if(n)var y=i?n(d,v,l,e,t,u):n(v,d,l,t,e,u);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!ie(e,function(t,e){if(!ce(h,e)&&(v===t||o(v,t,r,n,u)))return h.push(e)})){p=!1;break}}else if(v!==d&&!o(v,d,r,n,u)){p=!1;break}}return u.delete(t),u.delete(e),p}var ae=s.Uint8Array;function se(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function le(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var pe=l?l.prototype:void 0,he=pe?pe.valueOf:void 0;var ve=Object.prototype.propertyIsEnumerable,de=Object.getOwnPropertySymbols,ye=de?function(t){return null==t?[]:(t=Object(t),wt(de(t),function(e){return ve.call(t,e)}))}:function(){return[]};function be(t){return function(t,e,r){var n=e(t);return c(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,te,ye)}var ge=Object.prototype.hasOwnProperty;var me=M(s,"DataView"),_e=M(s,"Promise"),je=M(s,"Set"),we=M(s,"WeakMap"),Se="[object Map]",Oe="[object Promise]",Ae="[object Set]",xe="[object WeakMap]",Fe="[object DataView]",Ee=N(me),ke=N(V),Ne=N(_e),ze=N(je),Pe=N(we),Ie=g;(me&&Ie(new me(new ArrayBuffer(1)))!=Fe||V&&Ie(new V)!=Se||_e&&Ie(_e.resolve())!=Oe||je&&Ie(new je)!=Ae||we&&Ie(new we)!=xe)&&(Ie=function(t){var e=g(t),r="[object Object]"==e?t.constructor:void 0,n=r?N(r):"";if(n)switch(n){case Ee:return Fe;case ke:return Se;case Ne:return Oe;case ze:return Ae;case Pe:return xe}return e});var $e=Ie,Re="[object Arguments]",Te="[object Array]",Ce="[object Object]",Me=Object.prototype.hasOwnProperty;function Le(t,e,r,n,o,u){var i=c(t),f=c(e),a=i?Te:$e(t),s=f?Te:$e(e),l=(a=a==Re?Ce:a)==Ce,p=(s=s==Re?Ce:s)==Ce,h=a==s;if(h&&$t(t)){if(!$t(e))return!1;i=!0,l=!1}if(h&&!l)return u||(u=new oe),i||Ut(t)?fe(t,e,r,n,o,u):function(t,e,r,n,o,u,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!u(new ae(t),new ae(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return G(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=se;case"[object Set]":var f=1&n;if(c||(c=le),t.size!=e.size&&!f)return!1;var a=i.get(t);if(a)return a==e;n|=2,i.set(t,e);var s=fe(c(t),c(e),n,o,u,i);return i.delete(t),s;case"[object Symbol]":if(he)return he.call(t)==he.call(e)}return!1}(t,e,a,r,n,o,u);if(!(1&r)){var v=l&&Me.call(t,"__wrapped__"),d=p&&Me.call(e,"__wrapped__");if(v||d){var y=v?t.value():t,b=d?e.value():e;return u||(u=new oe),o(y,b,r,n,u)}}return!!h&&(u||(u=new oe),function(t,e,r,n,o,u){var i=1&r,c=be(t),f=c.length;if(f!=be(e).length&&!i)return!1;for(var a=f;a--;){var s=c[a];if(!(i?s in e:ge.call(e,s)))return!1}var l=u.get(t),p=u.get(e);if(l&&p)return l==e&&p==t;var h=!0;u.set(t,e),u.set(e,t);for(var v=i;++a<f;){var d=t[s=c[a]],y=e[s];if(n)var b=i?n(y,d,s,e,t,u):n(d,y,s,t,e,u);if(!(void 0===b?d===y||o(d,y,r,n,u):b)){h=!1;break}v||(v="constructor"==s)}if(h&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(h=!1)}return u.delete(t),u.delete(e),h}(t,e,r,n,o,u))}function De(t,e,r,n,o){return t===e||(null==t||null==e||!m(t)&&!m(e)?t!=t&&e!=e:Le(t,e,r,n,De,o))}function Be(t){return t==t&&!O(t)}function We(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function Ge(t){var e=function(t){for(var e=te(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Be(o)]}return e}(t);return 1==e.length&&e[0][2]?We(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,u=o,i=!n;if(null==t)return!u;for(t=Object(t);o--;){var c=r[o];if(i&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<u;){var f=(c=r[o])[0],a=t[f],s=c[1];if(i&&c[2]){if(void 0===a&&!(f in t))return!1}else{var l=new oe;if(n)var p=n(a,s,f,t,e,l);if(!(void 0===p?De(s,a,3,n,l):p))return!1}}return!0}(r,t,e)}}function Ze(t,e){return null!=t&&e in Object(t)}function Ue(t,e){return null!=t&&function(t,e,r){for(var n=-1,o=(e=at(e,t)).length,u=!1;++n<o;){var i=st(e[n]);if(!(u=null!=t&&r(t,i)))break;t=t[i]}return u||++n!=o?u:!!(o=null==t?0:t.length)&&Ct(o)&&Tt(i,o)&&(c(t)||Nt(t))}(t,e,Ze)}function qe(t){return t}function Ve(t){return function(e){return null==e?void 0:e[t]}}function Je(t){return S(t)?Ve(st(t)):function(t){return function(e){return lt(e,t)}}(t)}function Xe(t){return"function"==typeof t?t:null==t?qe:"object"==typeof t?c(t)?function(t,e){return S(t)&&Be(e)?We(st(t),e):function(r){var n=pt(r,t);return void 0===n&&n===e?Ue(r,t):De(e,n,3)}}(t[0],t[1]):Ge(t):Je(t)}function He(t,e){return(c(t)?wt:ne)(t,Xe(e))}function Qe(t,e){var r=-1,n=Yt(t)?Array(t.length):[];return re(t,function(t,o,u){n[++r]=e(t,o,u)}),n}function Ke(t,e){return(c(t)?ot:Qe)(t,Xe(e))}function Ye(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function tr(t,e){var r;return(c(t)?Ye:re)(t,"function"==typeof(r=e)?r:qe)}var er=/\s/;var rr=/^\s+/;function nr(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&er.test(t.charAt(e)););return e}(t)+1).replace(rr,""):t}var or=/^[-+]0x[0-9a-f]+$/i,ur=/^0b[01]+$/i,ir=/^0o[0-7]+$/i,cr=parseInt;function fr(t){if("number"==typeof t)return t;if(_(t))return NaN;if(O(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=O(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=nr(t);var r=ur.test(t);return r||ir.test(t)?cr(t.slice(2),r?2:8):or.test(t)?NaN:+t}var ar=1/0;function sr(t){return t?(t=fr(t))===ar||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function lr(t){var e=sr(t),r=e%1;return e==e?r?e-r:e:0}function pr(t){return"[object String]"===Object.prototype.toString.call(t)}function hr(t){return!(!pr(t)||""===t)}function vr(t){return"[object Number]"===Object.prototype.toString.call(t)}function dr(t){return t!=t}function yr(t){let e=!1;if(hr(t))e=!isNaN(Number(t));else if(vr(t)){if(dr(t))return!1;e=!0}return e}function br(t){if(!yr(t))return 0;return sr(t)}function gr(t,e={}){let r=pt(e,"useLimitSafe",null);return bt(r)||(r=!1),!!yr(t)&&(t=br(t),r?Number.isSafeInteger(t):"number"==typeof(n=t)&&n==lr(n));var n}var mr=s.isFinite,_r=Math.min;var jr=function(t){var e=Math[t];return function(t,r){if(t=fr(t),(r=null==r?0:_r(lr(r),292))&&mr(t)){var n=(ft(t)+"e").split("e");return+((n=(ft(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}("round"),wr=jr;function Sr(t,e={}){let r=pt(e,"useClampSafe",null);bt(r)||(r=!1);let n=pt(e,"useLimitSafe",null);bt(n)||(n=!1);let o=pt(e,"returnWithStateAndMsg",null);bt(o)||(o=!1);let u=t=>o?{state:"success",msg:t}:t,i=t=>{if(o)return{state:"error",msg:t};throw new Error(t)};if(!yr(t))return u(0);let c=null;try{t=br(t),c=wr(t),r&&(c>Number.MAX_SAFE_INTEGER?c=Number.MAX_SAFE_INTEGER:c<Number.MIN_SAFE_INTEGER&&(c=Number.MIN_SAFE_INTEGER))}catch(t){return i(t.toString())}return n&&!Number.isSafeInteger(Number(c))?i(`v[${t}] is not a safe integer`):("0"===String(c)&&(c=0),u(c))}function Or(t,e={}){if(!gr(t,e))return!1;return Sr(t)>0}function Ar(t,e=1,r={}){let n=1,o=pt(r,"path"),u=pt(r,"fs");if(!vt(t,{fs:u}))throw new Error(`fd[${t}] is not a folder`);return null!==e&&Or(e)&&(e=Sr(e))<1&&(e=1),function t(r){let i=[];return vt(r,{fs:u})?(tr(u.readdirSync(r),function(c){let f=o.resolve(r,c),a=null;try{a=u.statSync(f)}catch(t){}a&&a.isDirectory()?(i.push({isFolder:!0,level:n,path:f,name:o.basename(f)}),n+=1,(n<=e||null===e)&&(i=i.concat(t(f))),n-=1):i.push({isFolder:!1,level:n,path:f,name:o.basename(f)})}),i):i}(t)}function xr(t,e={}){if(!gr(t,e))return!1;return Sr(t)>=0}function Fr(t,e){if(!hr(t))return"";if(!xr(e))return"";if(0===(e=Sr(e)))return"";let r=t.length-e;return r<0&&(r=0),t.substring(r,r+e)}function Er(t,e){return hr(t)&&xr(e)?0===(e=Sr(e))?"":t.substring(0,e):""}function kr(t,e){return hr(t)&&xr(e)?0===(e=Sr(e))?t:Er(t,t.length-e):""}function Nr(t){if(!hr(t))return{path:"",isRoot:!1};for(;t.indexOf("\\\\")>=0;)t=t.replace("\\\\","\\");for(;t.indexOf("//")>=0;)t=t.replace("//","/");if(":"===Fr(t,1))return{path:`${t}\\`,isRoot:!0};if("\\"===Fr(t,1)){let e=kr(t,1);return":"===Fr(e,1)?{path:t,isRoot:!0}:{path:e,isRoot:!1}}if("/"===Fr(t,1)){let e=kr(t,1);return 0===e.length?{path:t,isRoot:!0}:{path:e,isRoot:!1}}return{path:t,isRoot:!1}}function zr(t){if(!hr(t))return"";let e=Nr(t);if(e.isRoot)return e.path;let r=e.path;try{r=r.split("\\").pop().split("/").pop()}catch(t){}return r}function Pr(t){if(!hr(t))return"";let e=Nr(t);if(e.isRoot)return e.path;let r=zr(t=e.path);if(!hr(r))return t;let n=Nr(t=kr(t,r.length));return n.isRoot,n.path}let Ir="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),$r=Ir.length;function Rr(t=32){let e=[];t=Or(t)?Sr(t):32;for(let r=0;r<t;r++)e[r]=Ir[0|Math.random()*$r];return e.join("")}function Tr(){let t,e,r=new Promise(function(){t=arguments[0],e=arguments[1]});return r.resolve=t,r.reject=e,r}var Cr=Array.prototype.join;function Mr(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var u=Array(o);++n<o;)u[n]=t[n+e];return u}function Lr(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:Mr(t,e,r)}var Dr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Br(t){return Dr.test(t)}var Wr=Gt&&Gt.isRegExp,Gr=Wr?Lt(Wr):function(t){return m(t)&&"[object RegExp]"==g(t)};var Zr="\\ud800-\\udfff",Ur="["+Zr+"]",qr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Vr="\\ud83c[\\udffb-\\udfff]",Jr="[^"+Zr+"]",Xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Hr="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="(?:"+qr+"|"+Vr+")"+"?",Kr="[\\ufe0e\\ufe0f]?",Yr=Kr+Qr+("(?:\\u200d(?:"+[Jr,Xr,Hr].join("|")+")"+Kr+Qr+")*"),tn="(?:"+[Jr+qr+"?",qr,Xr,Hr,Ur].join("|")+")",en=RegExp(Vr+"(?="+Vr+")|"+tn+Yr,"g");function rn(t){return Br(t)?function(t){return t.match(en)||[]}(t):function(t){return t.split("")}(t)}function nn(t,e,r){return r&&"number"!=typeof r&&function(t,e,r){if(!O(r))return!1;var n=typeof e;return!!("number"==n?Yt(r)&&Tt(e,r.length):"string"==n&&e in r)&&G(r[e],t)}(t,e,r)&&(e=r=void 0),(r=void 0===r?4294967295:r>>>0)?(t=ft(t))&&("string"==typeof e||null!=e&&!Gr(e))&&!(e=ct(e))&&Br(t)?Lr(rn(t),0,r):t.split(e,r):[]}var on=Ve("length"),un="\\ud800-\\udfff",cn="["+un+"]",fn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",an="\\ud83c[\\udffb-\\udfff]",sn="[^"+un+"]",ln="(?:\\ud83c[\\udde6-\\uddff]){2}",pn="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="(?:"+fn+"|"+an+")"+"?",vn="[\\ufe0e\\ufe0f]?",dn=vn+hn+("(?:\\u200d(?:"+[sn,ln,pn].join("|")+")"+vn+hn+")*"),yn="(?:"+[sn+fn+"?",fn,ln,pn,cn].join("|")+")",bn=RegExp(an+"(?="+an+")|"+yn+dn,"g");function gn(t){return Br(t)?function(t){for(var e=bn.lastIndex=0;bn.test(t);)++e;return e}(t):on(t)}function mn(t){if(null==t)return 0;if(Yt(t))return"string"==typeof(e=t)||!c(e)&&m(e)&&"[object String]"==g(e)?gn(t):t.length;var e,r=$e(t);return"[object Map]"==r||"[object Set]"==r?t.size:Kt(t).length}function _n(t){return"[object Array]"===Object.prototype.toString.call(t)}function jn(t){return!!_n(t)&&0===t.length}function wn(t){return"[object Undefined]"===Object.prototype.toString.call(t)}function Sn(t){return"[object Null]"===Object.prototype.toString.call(t)}function On(t){return"[object Object]"===Object.prototype.toString.call(t)}function An(t){if(On(t)){for(let e in t)return!1;return!0}return!1}function xn(t){return!(!pr(t)||""!==t)}function Fn(t){return!!wn(t)||(!!Sn(t)||(!!An(t)||(!!xn(t)||(!!jn(t)||!!dr(t)))))}let En=/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{0,58}[A-Za-z0-9])$/;function kn(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}function Nn(t){if(!gr(t))return!1;return Sr(t)<0}function zn(t){let e,r=Object.prototype.toString.call(t);if(e="[object Promise]"===r,e)return!0;if("[object Function]"!==r)return!1;try{e="function"!=typeof t.subscribe&&"function"==typeof t.then}catch(t){}return e}let Pn=function(t){if(!kn(t))throw new Error("fn is not a function");return function(){let e=Tr(),r=null,n=null;try{r=t.apply(this,arguments)}catch(t){n=t}return null!==n?e.resolve({state:"error",msg:n}):zn(r)?r.then(t=>{e.resolve({state:"success",msg:t})}).catch(t=>{"cancelled"===pt(t,"reason")?e.resolve({state:"cancelled",msg:""}):e.resolve({state:"error",msg:t})}):e.resolve({state:"success",msg:r}),e}};function In(t,e=()=>{}){if(!kn(t))return null;function r(t,e){let r;return Sn(t)||wn(t)?e:(r=pt(t,"data",null),r||t)}return kn(e)||(e=()=>{}),function(){let n,o=Tr(),u=e({mode:"before",data:arguments});return(Sn(u)||wn(u))&&(u=arguments),t(...u).then(t=>{n=e({mode:"afterThen",data:t}),t=r(n,t),o.resolve(t)}).catch(t=>{n=e({mode:"afterCatch",data:t}),t=r(n,t),o.reject(t)}),o}}function $n(t){return null==t?[]:function(t,e){return ot(e,function(e){return t[e]})}(t,te(t))}function Rn(t,e,r=[],n={}){let o=n.funSettle,u=n.tag||"evem",i=(e,...r)=>t.emit(e,...r);kn(n.funEmit)&&(i=n.funEmit);try{return i(e,...r)}catch(n){if(kn(o))try{o(n)}catch(t){}try{"error"!==e&&t.listenerCount("error")>0?i("error",{fun:"listener",name:e,msg:n,args:r}):console.error(`[wsemi ${u}] listener of '${String(e)}' threw:`,n)}catch(t){try{console.error(`[wsemi ${u}] listener of '${String(e)}' threw, and reporting it also threw:`,t,n)}catch(t){}}return!1}}function Tn(t=0){let e=0,r=[];Nn(t)&&(t=0),t=Sr(t);let n=i();return n.get=function(){if(r.length>0){return e+=1,r.splice(0,1)[0]}return null},n.cb=function(){e-=1,e<0&&(e=0),r.length>0&&Rn(n,"message",[r],{tag:"queue"})},n.push=function(o){r.push(o),(t<=0||e<t)&&Rn(n,"message",[r],{tag:"queue"})},n.clear=function(){e=0,r=[]},n}let Cn=2147483647;function Mn(t){return t!=t}function Ln(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var o=t.length,u=r+(n?1:-1);n?u--:++u<o;)if(e(t[u],u,t))return u;return-1}(t,Mn,r)}function Dn(t,e,r){if((t=ft(t))&&(r||void 0===e))return nr(t);if(!t||!(e=ct(e)))return t;var n=rn(t),o=rn(e),u=function(t,e){for(var r=-1,n=t.length;++r<n&&Ln(e,t[r],0)>-1;);return r}(n,o),i=function(t,e){for(var r=t.length;r--&&Ln(e,t[r],0)>-1;);return r}(n,o)+1;return Lr(n,u,i).join("")}t.evem=i,t.fsCleanFolder=function(t){return function(t,e={}){let r=pt(e,"path"),n=pt(e,"fs");if(!ht(t,{fs:n})){let e=dt(t,{fs:n});return e.error?e.error:{success:"done: "+t}}if(!vt(t,{fs:n}))return{error:"input path is not a folder"};try{let e=n.readdirSync(t);for(let o of e){let e=r.join(t,o);n.statSync(e).isDirectory()?n.rmSync(e,{recursive:!0,force:!0}):n.unlinkSync(e)}}catch(t){return{error:t}}return{success:"done: "+t}}(t,{path:e,fs:r})},t.fsCopyFile=function(t,n,o={}){return mt(t,n,{path:e,fs:r,...o})},t.fsCopyFolder=function(t,n,o={}){return jt(t,n,{path:e,fs:r,...o})},t.fsCreateFolder=function(t){return dt(t,{fs:r})},t.fsDeleteFolder=function(t){return function(t,e={}){let r=pt(e,"fs");if(!ht(t,{fs:r}))return{success:"folder does not exist: "+t};if(!vt(t,{fs:r}))return{error:"input path is not a folder: "+t};try{r.rmSync(t,{recursive:!0,force:!0})}catch(t){return{error:t}}return{success:"done: "+t}}(t,{fs:r})},t.fsGetFilesInFolder=function(t,n=1){return function(t,e=1,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))throw new Error(`fd[${t}] is not a folder`);let u=[];return u=Ar(t,e,{path:n,fs:o}),u=He(u,{isFolder:!1}),u=Ke(u,t=>(delete t.isFolder,t)),u}(t,n,{path:e,fs:r})},t.fsGetFoldersInFolder=function(t,n=1){return function(t,e=1,r={}){let n=pt(r,"path"),o=pt(r,"fs");if(!vt(t,{fs:o}))throw new Error(`fd[${t}] is not a folder`);let u=[];return u=Ar(t,e,{path:n,fs:o}),u=He(u,{isFolder:!0}),u=Ke(u,t=>(delete t.isFolder,t)),u}(t,n,{path:e,fs:r})},t.fsIsFile=function(t){return gt(t,{fs:r})},t.fsIsFolder=function(t){return vt(t,{fs:r})},t.fsReadText=function(t){return function(t,e={}){let r=null,n=pt(e,"fs"),o="";try{o=n.readFileSync(t,"utf8")}catch(t){r=t}return null!==r?{error:r}:{success:o}}(t,{fs:r})},t.fsTreeFolder=function(t,n=1){return Ar(t,n,{path:e,fs:r})},t.fsWriteText=function(t,e){return function(t,e,r={}){let n=null,o=pt(r,"fs"),u=Pr(t);vt(u,{fs:o})||dt(u,{fs:o});try{o.writeFileSync(t,e,"utf8")}catch(t){n=t}return null!==n?{error:n}:{success:t}}(t,e,{fs:r})},t.genID=Rr,t.genPm=Tr,t.getClearPathName=Nr,t.getFileName=zr,t.getFileTrueName=function(t){if(!hr(t))return"";let e=zr(t),r=nn(e,".");if(mn(r)<=1)return e;let n="";try{r=(c=null==(o=r)?0:o.length)?Mr(o,0,(u=c-(u=i||void 0===u?1:lr(u)))<0?0:u):[],n=function(t,e){return null==t?"":Cr.call(t,e)}(r,".")}catch(t){}var o,u,i,c;return n},t.getGlobal=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null},t.getPathParent=Pr,t.isEmail=function(t){return!!hr(t)&&(!(t.length>254)&&(!(t.indexOf("@")>64)&&En.test(t)))},t.isIE=function(){return null!==navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)},t.isab=function(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t)},t.isarr=_n,t.isarr0=jn,t.isblob=function(t){let e=Object.prototype.toString.call(t);if("[object Blob]"===e||"[object File]"===e)return!0;try{if("undefined"!=typeof Blob&&t instanceof Blob)return!0}catch(t){}return!1},t.isbol=bt,t.isearr=function(t){return!!_n(t)&&(0!==t.length&&(1!==t.length||!Fn(t[0])))},t.iseobj=function(t){if(On(t)){for(let e in t)return!0;return!1}return!1},t.iser=Fn,t.isernot=function(t){return!Fn(t)},t.isestr=hr,t.isfun=kn,t.isint=gr,t.isn0int=function(t){return!!gr(t)&&Sr(t)<=0},t.isn0num=function(t){return!!yr(t)&&br(t)<=0},t.isnbr=vr,t.isnint=Nn,t.isnull=Sn,t.isnum=yr,t.isobj=On,t.isobj0=An,t.isp0int=xr,t.isp0num=function(t){return!!yr(t)&&br(t)>=0},t.ispint=Or,t.ispm=zn,t.isstr=pr,t.isstr0=xn,t.isundefined=wn,t.j2o=function(t,e={}){let r=pt(e,"returnWithStateAndMsg",null);bt(r)||(r=!1);let n=t=>r?{state:"error",msg:t}:{};if(!hr(t))return n("invalid v");let o={};try{o=JSON.parse(t)}catch(t){return n(t.toString())}return r?{state:"success",msg:o}:o},t.o2j=function(t,e=!1,r={}){let n=pt(r,"returnWithStateAndMsg",null);bt(n)||(n=!1);let o=t=>n?{state:"error",msg:t}:"";if(wn(t))return o("invalid v");let u="";try{u=e?JSON.stringify(t,null,2):JSON.stringify(t)}catch(t){return o(t.toString())}return n?{state:"success",msg:u}:u},t.pm2resolve=Pn,t.pmChain=function(t,e=null){if(!_n(t)){let t=Tr();return t.reject("pms is not an array"),t}return t.reduce((t,e)=>t.then(e),Promise.resolve(e))},t.pmHook=In,t.pmHookReject=function(t,e=()=>{}){return kn(t)?(kn(e)||(e=()=>{}),In(t,t=>{if("afterCatch"===t.mode)return e(t.data)})):null},t.pmIni=function(){return Promise.resolve()},t.pmMap=function(t,e,r=0){let n={},o=!1,u=Tr();if(!_n(t)&&!On(t))return u.reject("rs is not an array or object"),u;if(0===mn(t))return u.resolve([]),u;let i=!1;if(On(t)){i=!0;let e=[];tr(t,(t,r)=>{e.push({k:r,v:t})}),t=e}let c=Tn(r);return c.on("message",function(r){if(o)return;let f,a=c.get();if(kn(e)){let t=a.key,r=a.value;if(i&&(t=a.value.k,r=a.value.v),f=e(r,t),!zn(f))throw new Error("return of fun is not a promise")}else f=a.value;f.then(t=>{n[a.key]=t}).catch(t=>{o=!0,c.clear(),u.reject(t)}).finally(()=>{c.cb(),mn(n)===mn(t)&&u.resolve($n(n))})}),tr(t,(t,e)=>{c.push({key:e,value:t})}),u},t.pmQueue=function(t=0,e=!1){return new function(t,e){let r=null;xr(t)||(t=0),t=Sr(t),yt(e)||(e=!1);let n=Tn(t);return n.on("message",async function(t){let e=n.get();if(!e)return;await function(t=10){yr(t)||(t=10),t=Math.min(t,Cn);let e=Tr();return setTimeout(function(){e.resolve()},t),e}(1);let r,o=pt(e,"id"),u=pt(e,"fun"),i=pt(e,"input");r=kn(u)?await Pn(u)(...i):{state:"error",msg:"fun is not a function"},n.emit(o,r),n.cb()}),function(t,...o){let u=Tr(),i=Rr();r=i;let c={id:i,fun:t,input:o};return n.push(c),n.once(i,t=>{e?i===r?"success"===t.state?u.resolve(t.msg):u.reject(t.msg):u.reject({reason:"cancelled"}):"success"===t.state?u.resolve(t.msg):u.reject(t.msg)}),u}}(t,e)},t.pmSeries=function(t,e){let r=Tr();if(!_n(t)&&!On(t))return r.reject("rs is not an array or object"),r;let n=!1;if(On(t)){n=!0;let e=[];tr(t,(t,r)=>{e.push({k:r,v:t})}),t=e}kn(e)||(e=function(t){return t});let o=-1,u=[];return t.reduce(function(t,r){return t.then(function(t){u.push(t),o+=1;let i=o,c=r;return n&&(i=r.k,c=r.v),kn(e)?e(c,i):c})},Promise.resolve()).then(function(t){var e,n,o,i;u.push(t),i=null==(e=u)?0:e.length,u=i?Mr(e,(n=o||void 0===n?1:lr(n))<0?0:n,i):[],r.resolve(u)}).catch(function(t){r.reject(t)}),r},t.pmThrottle=function(){let t=i(),e=[],r=null,n=!1;return function(o,...u){let i=Tr();if(!kn(o))return void console.log("func is not a function");let c=Rr();return e.push({id:c,func:o,input:u}),null===r&&(r=setInterval(async()=>{if(n)return;n=!0;let o=e.pop();for(let r=0;r<e.length;r++){let n=e[r].id,o={state:"cancelled"};t.emit(n,o)}if(e=[],o){let e,r=o.id;e=kn(o.func)?await Pn(o.func)(...o.input):{state:"error",msg:"fun is not a function"},t.emit(r,e)}n=!1,n||0!==e.length||(clearInterval(r),r=null)},20)),t.once(c,t=>{"success"===t.state?i.resolve(t.msg):"cancelled"===t.state?i.reject({reason:"cancelled"}):i.reject(t.msg)}),i}},t.replace=function(t,e,r){return hr(t)&&hr(e)&&pr(r)?String(t).replaceAll(e,r):""},t.sep=function(t,e){if(!hr(t))return[];if(!hr(e))return[];let r=function(t,e){return hr(t)&&hr(e)?t.split(e):[]}(t,e);r=Ke(r,Dn);let n=[];return tr(r,function(t){hr(t)&&n.push(t)}),n},t.strdelleft=function(t,e){return hr(t)&&xr(e)?0===(e=Sr(e))?t:Fr(t,t.length-e):""},t.strdelright=kr,t.strleft=Er,t.strmid=function(t,e,r=1){return hr(t)&&xr(e)?(r=Or(r)?Sr(r):1,t.substring(e,e+r)):""},t.strright=Fr,t.waitFun=async function(t,e={}){let r=null,n=Tr();if(!kn(t))return n.reject("waitfunction需輸入函數f"),n;let o=async()=>{let e=t();return zn(e)&&(e=await e),e};if(r=await o(),!0===r)return n.resolve(),n;let u=pt(e,"attemptNum",null);Or(u)||(u=200);let i=pt(e,"timeInterval",null);Or(i)||(i=1e3),i=Math.min(i,Cn);let c=0,f=setInterval(async()=>{c+=1,r=await o(),!0===r&&(clearInterval(f),n.resolve()),c>u&&(clearInterval(f),n.reject(`exceeded attemptNum[${u}]`))},i);return n}});
|
package/toolg/gDistRollup.mjs
CHANGED
|
@@ -18,6 +18,7 @@ rollupFiles({
|
|
|
18
18
|
'events': 'events',
|
|
19
19
|
'url': 'url',
|
|
20
20
|
'stream': 'stream',
|
|
21
|
+
'stream/promises': 'streamPromises', //fsDownloadFile注入pipeline用, Node專用; 不列則rollup只能猜全域名為promises
|
|
21
22
|
'process': 'process',
|
|
22
23
|
'child_process': 'child_process',
|
|
23
24
|
'crypto': 'crypto',
|
|
@@ -45,6 +46,7 @@ rollupFiles({
|
|
|
45
46
|
'events',
|
|
46
47
|
'url',
|
|
47
48
|
'stream',
|
|
49
|
+
'stream/promises',
|
|
48
50
|
'process',
|
|
49
51
|
'child_process',
|
|
50
52
|
'crypto',
|