wsemi 1.8.12 → 1.8.13

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.
Files changed (481) hide show
  1. package/README.md +11 -18
  2. package/dist/wsemi.umd.js +4 -4
  3. package/dist/wsemi.umd.js.map +1 -1
  4. package/docs/-_class.mjs.html +2 -2
  5. package/docs/ab2blob.mjs.html +2 -2
  6. package/docs/ab2u8arr.mjs.html +2 -2
  7. package/docs/addExcelWorksheetFromData.mjs.html +2 -2
  8. package/docs/addMonth.mjs.html +2 -2
  9. package/docs/aes2str.mjs.html +2 -2
  10. package/docs/alive.mjs.html +2 -2
  11. package/docs/arr2dt.mjs.html +2 -2
  12. package/docs/arrAccum.mjs.html +2 -2
  13. package/docs/arrAdd.mjs.html +2 -2
  14. package/docs/arrAt.mjs.html +2 -2
  15. package/docs/arrDiff.mjs.html +2 -2
  16. package/docs/arrFilterByKeywords.mjs.html +2 -2
  17. package/docs/arrFilterByNum.mjs.html +2 -2
  18. package/docs/arrFilterByPnum.mjs.html +2 -2
  19. package/docs/arrFilterByPnumAndToLog.mjs.html +2 -2
  20. package/docs/arrFind.mjs.html +2 -2
  21. package/docs/arrGroupByMaxmin.mjs.html +2 -2
  22. package/docs/arrHas.mjs.html +2 -2
  23. package/docs/arrInsert.mjs.html +2 -2
  24. package/docs/arrLookupByMaxmin.mjs.html +2 -2
  25. package/docs/arrMax.mjs.html +2 -2
  26. package/docs/arrMin.mjs.html +2 -2
  27. package/docs/arrMulti.mjs.html +2 -2
  28. package/docs/arrNorm.mjs.html +2 -2
  29. package/docs/arrProduct.mjs.html +2 -2
  30. package/docs/arrPull.mjs.html +2 -2
  31. package/docs/arrPullAt.mjs.html +2 -2
  32. package/docs/arrReduce.mjs.html +2 -2
  33. package/docs/arrReverse.mjs.html +2 -2
  34. package/docs/arrSep.mjs.html +2 -2
  35. package/docs/arrSort.mjs.html +2 -2
  36. package/docs/asind.mjs.html +2 -2
  37. package/docs/atan2d.mjs.html +2 -2
  38. package/docs/atand.mjs.html +2 -2
  39. package/docs/attstr.mjs.html +2 -2
  40. package/docs/b642obj.mjs.html +2 -2
  41. package/docs/b642str.mjs.html +2 -2
  42. package/docs/b642u16arr.mjs.html +2 -2
  43. package/docs/b642u8arr.mjs.html +2 -2
  44. package/docs/binstr.mjs.html +2 -2
  45. package/docs/blob2ab.mjs.html +2 -2
  46. package/docs/blob2b64.mjs.html +2 -2
  47. package/docs/blob2str.mjs.html +2 -2
  48. package/docs/blob2u8arr.mjs.html +2 -2
  49. package/docs/blobs2b64s.mjs.html +2 -2
  50. package/docs/blobs2u8arrs.mjs.html +2 -2
  51. package/docs/bodyLog.mjs.html +2 -2
  52. package/docs/browserView.mjs.html +2 -2
  53. package/docs/browserViewFromBlob.mjs.html +2 -2
  54. package/docs/browserViewFromText.mjs.html +2 -2
  55. package/docs/browserViewFromU8arr.mjs.html +2 -2
  56. package/docs/bs2u8arr.mjs.html +2 -2
  57. package/docs/bufRead.mjs.html +2 -2
  58. package/docs/bufReadDbl.mjs.html +2 -2
  59. package/docs/bufWrite.mjs.html +2 -2
  60. package/docs/bufWriteDbl.mjs.html +2 -2
  61. package/docs/cache.mjs.html +3 -3
  62. package/docs/cacheBd.mjs.html +309 -0
  63. package/docs/cbol.mjs.html +2 -2
  64. package/docs/cdbl.mjs.html +2 -2
  65. package/docs/ceil.mjs.html +2 -2
  66. package/docs/cfilesize.mjs.html +2 -2
  67. package/docs/cfinancial.mjs.html +2 -2
  68. package/docs/cint.mjs.html +2 -2
  69. package/docs/clearXSS.mjs.html +2 -2
  70. package/docs/clearXSSDyn.mjs.html +2 -2
  71. package/docs/color.mjs.html +2 -2
  72. package/docs/composeToTree.mjs.html +2 -2
  73. package/docs/convertToTree.mjs.html +2 -2
  74. package/docs/copyStrToClipboard.mjs.html +2 -2
  75. package/docs/cosd.mjs.html +2 -2
  76. package/docs/cotd.mjs.html +2 -2
  77. package/docs/createExcelWorkbook.mjs.html +2 -2
  78. package/docs/cscd.mjs.html +2 -2
  79. package/docs/cstr.mjs.html +2 -2
  80. package/docs/day2cht.mjs.html +2 -2
  81. package/docs/debounce.mjs.html +2 -2
  82. package/docs/delay.mjs.html +2 -2
  83. package/docs/dig.mjs.html +2 -2
  84. package/docs/digExp.mjs.html +2 -2
  85. package/docs/domAlert.mjs.html +2 -2
  86. package/docs/domAppend.mjs.html +2 -2
  87. package/docs/domCancelEvent.mjs.html +2 -2
  88. package/docs/domCompareText.mjs.html +2 -2
  89. package/docs/domCompareTextDyn.mjs.html +2 -2
  90. package/docs/domConvertToPic.mjs.html +2 -2
  91. package/docs/domConvertToPicDyn.mjs.html +2 -2
  92. package/docs/domDetect.mjs.html +2 -2
  93. package/docs/domDrag.mjs.html +2 -2
  94. package/docs/domDragBarAndScroll.mjs.html +2 -2
  95. package/docs/domDragPreview.mjs.html +2 -2
  96. package/docs/domDropFiles.mjs.html +2 -2
  97. package/docs/domElementsFromPoint.mjs.html +2 -2
  98. package/docs/domFadeIn.mjs.html +2 -2
  99. package/docs/domFadeOut.mjs.html +2 -2
  100. package/docs/domFind.mjs.html +2 -2
  101. package/docs/domFinds.mjs.html +2 -2
  102. package/docs/domGetAttr.mjs.html +2 -2
  103. package/docs/domGetBoudRect.mjs.html +2 -2
  104. package/docs/domGetBoudRectRefSelf.mjs.html +2 -2
  105. package/docs/domGetFileAccept.mjs.html +2 -2
  106. package/docs/domGetFiles.mjs.html +2 -2
  107. package/docs/domGetParents.mjs.html +2 -2
  108. package/docs/domGetPointFromEvent.mjs.html +2 -2
  109. package/docs/domGetScrollableParent.mjs.html +2 -2
  110. package/docs/domGetWindowSize.mjs.html +2 -2
  111. package/docs/domIsClientXYIn.mjs.html +2 -2
  112. package/docs/domIsFocused.mjs.html +2 -2
  113. package/docs/domIsVisible.mjs.html +2 -2
  114. package/docs/domPrepend.mjs.html +2 -2
  115. package/docs/domRemove.mjs.html +2 -2
  116. package/docs/domRenderMarkdownMind.mjs.html +2 -2
  117. package/docs/domRenderMarkdownMindDyn.mjs.html +2 -2
  118. package/docs/domRipple.mjs.html +2 -2
  119. package/docs/domScrollIntoView.mjs.html +2 -2
  120. package/docs/domScrollTo.mjs.html +2 -2
  121. package/docs/domShowImages.mjs.html +2 -2
  122. package/docs/domShowImagesDyn.mjs.html +2 -2
  123. package/docs/domShowInputAndGetFiles.mjs.html +2 -2
  124. package/docs/domShowInputAndGetFilesU8Arrs.mjs.html +2 -2
  125. package/docs/domShowInputDatatime.mjs.html +2 -2
  126. package/docs/domTooltip.mjs.html +2 -2
  127. package/docs/domTriggerEvent.mjs.html +2 -2
  128. package/docs/domVirtualCreate.mjs.html +2 -2
  129. package/docs/domVirtualCreateQueue.mjs.html +2 -2
  130. package/docs/downloadExcelFileFromData.mjs.html +2 -2
  131. package/docs/downloadExcelFileFromDataDyn.mjs.html +2 -2
  132. package/docs/downloadFileFromB64.mjs.html +2 -2
  133. package/docs/downloadFileFromBlob.mjs.html +2 -2
  134. package/docs/downloadFileFromText.mjs.html +2 -2
  135. package/docs/downloadFileFromU8Arr.mjs.html +2 -2
  136. package/docs/dtmapping.mjs.html +2 -2
  137. package/docs/dtpick.mjs.html +2 -2
  138. package/docs/estimateTicks.mjs.html +2 -2
  139. package/docs/evem.mjs.html +2 -2
  140. package/docs/examples/ex-blob2b64.html +1 -1
  141. package/docs/examples/ex-clearXSS.html +1 -1
  142. package/docs/examples/ex-clearXSSDyn.html +1 -1
  143. package/docs/examples/ex-colorConverter.html +1 -1
  144. package/docs/examples/ex-domCompareText.html +1 -1
  145. package/docs/examples/ex-domCompareTextDyn.html +1 -1
  146. package/docs/examples/ex-domConvertToPic.html +1 -1
  147. package/docs/examples/ex-domConvertToPicDyn.html +1 -1
  148. package/docs/examples/ex-domDrag.html +1 -1
  149. package/docs/examples/ex-domDropFiles.html +1 -1
  150. package/docs/examples/ex-domIsVisible.html +1 -1
  151. package/docs/examples/ex-domRenderMarkdownMind.html +1 -1
  152. package/docs/examples/ex-domRenderMarkdownMindDyn.html +1 -1
  153. package/docs/examples/ex-domRipple.html +1 -1
  154. package/docs/examples/ex-domScrollIntoView.html +1 -1
  155. package/docs/examples/ex-domScrollTo.html +1 -1
  156. package/docs/examples/ex-domShowImages.html +1 -1
  157. package/docs/examples/ex-domShowImagesDyn.html +1 -1
  158. package/docs/examples/ex-domShowInputAndGetFiles.html +1 -1
  159. package/docs/examples/ex-domTooltip.html +1 -1
  160. package/docs/examples/ex-execPyodide.html +1 -1
  161. package/docs/examples/ex-execPyodideDyn.html +1 -1
  162. package/docs/examples/ex-getFileHash.html +1 -1
  163. package/docs/examples/ex-getUserAgent.html +1 -1
  164. package/docs/examples/ex-getUserAgentDyn.html +1 -1
  165. package/docs/examples/ex-html2pic.html +1 -1
  166. package/docs/examples/ex-html2picDyn.html +1 -1
  167. package/docs/examples/ex-html2str.html +1 -1
  168. package/docs/examples/ex-html2strDyn.html +1 -1
  169. package/docs/examples/ex-obj2u8arr-u8arr2obj.html +1 -1
  170. package/docs/examples/ex-ocr.html +1 -1
  171. package/docs/examples/ex-ocrDyn.html +1 -1
  172. package/docs/examples/ex-openLink.html +1 -1
  173. package/docs/examples/ex-str2aes-aes2str.html +1 -1
  174. package/docs/examples/ex-str2b64-b642str.html +1 -1
  175. package/docs/examples/ex-strFindFuzz.html +1 -1
  176. package/docs/examples/ex-strFindFuzzDyn.html +1 -1
  177. package/docs/examples/ex-timeTZ2expire-timeTZ2past.html +1 -1
  178. package/docs/examples/ex-xlsx.html +1 -1
  179. package/docs/examples/ex-xlsxDyn.html +1 -1
  180. package/docs/execProcess.mjs.html +2 -2
  181. package/docs/execProcessKillPid.mjs.html +2 -2
  182. package/docs/execPyodide.mjs.html +2 -2
  183. package/docs/execPyodideDyn.mjs.html +2 -2
  184. package/docs/f2c.mjs.html +2 -2
  185. package/docs/filepathToTree.mjs.html +2 -2
  186. package/docs/files2data.mjs.html +2 -2
  187. package/docs/flattenToConn.mjs.html +2 -2
  188. package/docs/flattenTree.mjs.html +2 -2
  189. package/docs/floor.mjs.html +2 -2
  190. package/docs/fsBuildReadStreamText.mjs.html +2 -2
  191. package/docs/fsBuildWriteStreamText.mjs.html +2 -2
  192. package/docs/fsCleanFolder.mjs.html +2 -2
  193. package/docs/fsCleanFolderCore.mjs.html +2 -2
  194. package/docs/fsCopyFile.mjs.html +2 -2
  195. package/docs/fsCopyFileCore.mjs.html +2 -2
  196. package/docs/fsCopyFolder.mjs.html +2 -2
  197. package/docs/fsCopyFolderCore.mjs.html +2 -2
  198. package/docs/fsCreateFile.mjs.html +2 -2
  199. package/docs/fsCreateFileCore.mjs.html +2 -2
  200. package/docs/fsCreateFolder.mjs.html +2 -2
  201. package/docs/fsCreateFolderCore.mjs.html +2 -2
  202. package/docs/fsDeleteFile.mjs.html +2 -2
  203. package/docs/fsDeleteFileCore.mjs.html +2 -2
  204. package/docs/fsDeleteFileSafe.mjs.html +2 -2
  205. package/docs/fsDeleteFileSafeCore.mjs.html +2 -2
  206. package/docs/fsDeleteFolder.mjs.html +2 -2
  207. package/docs/fsDeleteFolderCore.mjs.html +2 -2
  208. package/docs/fsDeleteFolderSafe.mjs.html +2 -2
  209. package/docs/fsDeleteFolderSafeCore.mjs.html +2 -2
  210. package/docs/fsDownloadFile.mjs.html +2 -2
  211. package/docs/fsDownloadFileCore.mjs.html +2 -2
  212. package/docs/fsEvem.mjs.html +2 -2
  213. package/docs/fsGetFileBasicHash.mjs.html +2 -2
  214. package/docs/fsGetFileBasicHashCore.mjs.html +2 -2
  215. package/docs/fsGetFileHash.mjs.html +2 -2
  216. package/docs/fsGetFileHashCore.mjs.html +2 -2
  217. package/docs/fsGetFileXxHash.mjs.html +2 -2
  218. package/docs/fsGetFileXxHashCore.mjs.html +2 -2
  219. package/docs/fsGetFilesInFolder.mjs.html +2 -2
  220. package/docs/fsGetFilesInFolderCore.mjs.html +2 -2
  221. package/docs/fsGetFilesWithHashInFolder.mjs.html +2 -2
  222. package/docs/fsGetFilesWithHashInFolderCore.mjs.html +2 -2
  223. package/docs/fsGetFoldersInFolder.mjs.html +2 -2
  224. package/docs/fsGetFoldersInFolderCore.mjs.html +2 -2
  225. package/docs/fsIsFile.mjs.html +2 -2
  226. package/docs/fsIsFileCore.mjs.html +2 -2
  227. package/docs/fsIsFolder.mjs.html +2 -2
  228. package/docs/fsIsFolderCore.mjs.html +2 -2
  229. package/docs/fsMergeFiles.mjs.html +2 -2
  230. package/docs/fsMergeFilesCore.mjs.html +2 -2
  231. package/docs/fsReadText.mjs.html +2 -2
  232. package/docs/fsReadTextCore.mjs.html +2 -2
  233. package/docs/fsRenameFile.mjs.html +2 -2
  234. package/docs/fsRenameFileCore.mjs.html +2 -2
  235. package/docs/fsRenameFolder.mjs.html +2 -2
  236. package/docs/fsRenameFolderCore.mjs.html +2 -2
  237. package/docs/fsSrlog.mjs.html +2 -2
  238. package/docs/fsTask.mjs.html +2 -2
  239. package/docs/fsTreeFolder.mjs.html +2 -2
  240. package/docs/fsTreeFolderCore.mjs.html +2 -2
  241. package/docs/fsWatchFile.mjs.html +2 -2
  242. package/docs/fsWatchFolder.mjs.html +2 -2
  243. package/docs/fsWriteText.mjs.html +2 -2
  244. package/docs/fsWriteTextCore.mjs.html +2 -2
  245. package/docs/genGradientColor.mjs.html +2 -2
  246. package/docs/genID.mjs.html +2 -2
  247. package/docs/genPm.mjs.html +2 -2
  248. package/docs/getBufferSize.mjs.html +2 -2
  249. package/docs/getClearPathName.mjs.html +2 -2
  250. package/docs/getCsvStrFromData.mjs.html +2 -2
  251. package/docs/getDataFromExcelFileU8Arr.mjs.html +2 -2
  252. package/docs/getDataFromExcelFileU8ArrDyn.mjs.html +2 -2
  253. package/docs/getEnv.mjs.html +2 -2
  254. package/docs/getExcelU8ArrFromData.mjs.html +2 -2
  255. package/docs/getExcelU8ArrFromWorkbook.mjs.html +2 -2
  256. package/docs/getExcelWorkbookFromData.mjs.html +2 -2
  257. package/docs/getExcelWorkbookFromWorksheet.mjs.html +2 -2
  258. package/docs/getExcelWorksheetFromData.mjs.html +2 -2
  259. package/docs/getFileAccept.mjs.html +2 -2
  260. package/docs/getFileBasicHash.mjs.html +2 -2
  261. package/docs/getFileHash.mjs.html +2 -2
  262. package/docs/getFileName.mjs.html +2 -2
  263. package/docs/getFileNameExt.mjs.html +2 -2
  264. package/docs/getFileTrueName.mjs.html +2 -2
  265. package/docs/getFileType.mjs.html +2 -2
  266. package/docs/getFileXxHash.mjs.html +2 -2
  267. package/docs/getGlobal.mjs.html +2 -2
  268. package/docs/getObjSize.mjs.html +2 -2
  269. package/docs/getPathParent.mjs.html +2 -2
  270. package/docs/getTimeBetween.mjs.html +2 -2
  271. package/docs/getTimeFromUnit.mjs.html +2 -2
  272. package/docs/getTimeHp.mjs.html +2 -2
  273. package/docs/getTimeObject.mjs.html +2 -2
  274. package/docs/getTimeRange.mjs.html +2 -2
  275. package/docs/getUserAgent.mjs.html +2 -2
  276. package/docs/getUserAgentDyn.mjs.html +2 -2
  277. package/docs/getltdtkeys.mjs.html +2 -2
  278. package/docs/haskey.mjs.html +2 -2
  279. package/docs/html2pic.mjs.html +2 -2
  280. package/docs/html2picDyn.mjs.html +2 -2
  281. package/docs/html2str.mjs.html +2 -2
  282. package/docs/html2strDyn.mjs.html +2 -2
  283. package/docs/htmlDecode.mjs.html +2 -2
  284. package/docs/htmlEncode.mjs.html +2 -2
  285. package/docs/importResources.mjs.html +2 -2
  286. package/docs/index.html +2 -2
  287. package/docs/interp1.mjs.html +2 -2
  288. package/docs/isDate.mjs.html +2 -2
  289. package/docs/isDev.mjs.html +2 -2
  290. package/docs/isEle.mjs.html +2 -2
  291. package/docs/isEleExistByID.mjs.html +2 -2
  292. package/docs/isEmail.mjs.html +2 -2
  293. package/docs/isErr.mjs.html +2 -2
  294. package/docs/isIE.mjs.html +2 -2
  295. package/docs/isNarrow.mjs.html +2 -2
  296. package/docs/isStrHasCapital.mjs.html +2 -2
  297. package/docs/isStrHasLowerCase.mjs.html +2 -2
  298. package/docs/isStrHasNumber.mjs.html +2 -2
  299. package/docs/isUserIdentify.mjs.html +2 -2
  300. package/docs/isUserName.mjs.html +2 -2
  301. package/docs/isUserPW.mjs.html +2 -2
  302. package/docs/isWindow.mjs.html +2 -2
  303. package/docs/isab.mjs.html +2 -2
  304. package/docs/isarr.mjs.html +2 -2
  305. package/docs/isarr0.mjs.html +2 -2
  306. package/docs/isblob.mjs.html +2 -2
  307. package/docs/isbol.mjs.html +2 -2
  308. package/docs/isday.mjs.html +2 -2
  309. package/docs/isearr.mjs.html +2 -2
  310. package/docs/iseobj.mjs.html +2 -2
  311. package/docs/iser.mjs.html +2 -2
  312. package/docs/isernot.mjs.html +2 -2
  313. package/docs/isestr.mjs.html +2 -2
  314. package/docs/isfile.mjs.html +2 -2
  315. package/docs/isfun.mjs.html +2 -2
  316. package/docs/isint.mjs.html +2 -2
  317. package/docs/ismonth.mjs.html +2 -2
  318. package/docs/isn0int.mjs.html +2 -2
  319. package/docs/isn0num.mjs.html +2 -2
  320. package/docs/isnan.mjs.html +2 -2
  321. package/docs/isnbr.mjs.html +2 -2
  322. package/docs/isnint.mjs.html +2 -2
  323. package/docs/isnnum.mjs.html +2 -2
  324. package/docs/isnull.mjs.html +2 -2
  325. package/docs/isnum.mjs.html +2 -2
  326. package/docs/isobj.mjs.html +2 -2
  327. package/docs/isobj0.mjs.html +2 -2
  328. package/docs/isp0int.mjs.html +2 -2
  329. package/docs/isp0num.mjs.html +2 -2
  330. package/docs/ispint.mjs.html +2 -2
  331. package/docs/ispm.mjs.html +2 -2
  332. package/docs/ispnum.mjs.html +2 -2
  333. package/docs/isstr.mjs.html +2 -2
  334. package/docs/isstr0.mjs.html +2 -2
  335. package/docs/istime.mjs.html +2 -2
  336. package/docs/istimeTZ.mjs.html +2 -2
  337. package/docs/istimems.mjs.html +2 -2
  338. package/docs/istimemsTZ.mjs.html +2 -2
  339. package/docs/isu16arr.mjs.html +2 -2
  340. package/docs/isu8arr.mjs.html +2 -2
  341. package/docs/isundefined.mjs.html +2 -2
  342. package/docs/j2o.mjs.html +2 -2
  343. package/docs/judge.mjs.html +2 -2
  344. package/docs/keysmat2ltdt.mjs.html +2 -2
  345. package/docs/log.mjs.html +2 -2
  346. package/docs/ltdt2vrtsable.mjs.html +2 -2
  347. package/docs/ltdtDiff.mjs.html +2 -2
  348. package/docs/ltdtDiffByKey.mjs.html +2 -2
  349. package/docs/ltdtkeys2mat.mjs.html +2 -2
  350. package/docs/ltdtkeysheads2mat.mjs.html +2 -2
  351. package/docs/ltdtmapping.mjs.html +2 -2
  352. package/docs/ltdtmerge.mjs.html +2 -2
  353. package/docs/ltdtpick.mjs.html +2 -2
  354. package/docs/ltdtpull.mjs.html +2 -2
  355. package/docs/mat2ltdt.mjs.html +2 -2
  356. package/docs/matConcat.mjs.html +2 -2
  357. package/docs/matDiff.mjs.html +2 -2
  358. package/docs/matat.mjs.html +2 -2
  359. package/docs/now2str.mjs.html +2 -2
  360. package/docs/now2strp.mjs.html +2 -2
  361. package/docs/nowDay2str.mjs.html +2 -2
  362. package/docs/nowms2str.mjs.html +2 -2
  363. package/docs/nowms2strp.mjs.html +2 -2
  364. package/docs/o2j.mjs.html +2 -2
  365. package/docs/obj2b64.mjs.html +2 -2
  366. package/docs/obj2pb64.mjs.html +2 -2
  367. package/docs/obj2str.mjs.html +2 -2
  368. package/docs/obj2stru8arr.mjs.html +2 -2
  369. package/docs/obj2u8arr.mjs.html +2 -2
  370. package/docs/objSortBy.mjs.html +2 -2
  371. package/docs/objSortByKeys.mjs.html +2 -2
  372. package/docs/ocr.mjs.html +2 -2
  373. package/docs/ocrDyn.mjs.html +2 -2
  374. package/docs/oo.mjs.html +2 -2
  375. package/docs/openLink.mjs.html +2 -2
  376. package/docs/pb642obj.mjs.html +2 -2
  377. package/docs/pmChain.mjs.html +2 -2
  378. package/docs/pmConvertResolve.mjs.html +2 -2
  379. package/docs/pmDebounce.mjs.html +2 -49
  380. package/docs/pmHook.mjs.html +2 -2
  381. package/docs/pmHookReject.mjs.html +2 -2
  382. package/docs/pmIni.mjs.html +2 -2
  383. package/docs/pmInvResolve.mjs.html +2 -2
  384. package/docs/pmMap.mjs.html +10 -3
  385. package/docs/pmQueue.mjs.html +2 -2
  386. package/docs/pmSeries.mjs.html +2 -2
  387. package/docs/pmThrottle.mjs.html +3 -3
  388. package/docs/preciseNum.mjs.html +2 -2
  389. package/docs/pseudoRandom.mjs.html +2 -2
  390. package/docs/pseudoRandomIntRange.mjs.html +2 -2
  391. package/docs/pseudoRandomIntsNdpRange.mjs.html +2 -2
  392. package/docs/pseudoRandomIntsRange.mjs.html +2 -2
  393. package/docs/pseudoRandomRange.mjs.html +2 -2
  394. package/docs/pseudoRandomsRange.mjs.html +2 -2
  395. package/docs/queue.mjs.html +3 -3
  396. package/docs/random.mjs.html +2 -2
  397. package/docs/randomIntRange.mjs.html +2 -2
  398. package/docs/randomIntsNdpRange.mjs.html +2 -2
  399. package/docs/randomIntsRange.mjs.html +2 -2
  400. package/docs/randomRange.mjs.html +2 -2
  401. package/docs/randomsRange.mjs.html +2 -2
  402. package/docs/rang.mjs.html +2 -2
  403. package/docs/rep.mjs.html +2 -2
  404. package/docs/repObj.mjs.html +2 -2
  405. package/docs/replace.mjs.html +2 -2
  406. package/docs/replaceObj.mjs.html +2 -2
  407. package/docs/replacePlus.mjs.html +2 -2
  408. package/docs/round.mjs.html +2 -2
  409. package/docs/secd.mjs.html +2 -2
  410. package/docs/sep.mjs.html +2 -2
  411. package/docs/sepInt.mjs.html +2 -2
  412. package/docs/setIntervalHp.mjs.html +2 -2
  413. package/docs/setTimeoutHp.mjs.html +2 -2
  414. package/docs/sind.mjs.html +2 -2
  415. package/docs/split.mjs.html +2 -2
  416. package/docs/str2aes.mjs.html +2 -2
  417. package/docs/str2b64.mjs.html +2 -2
  418. package/docs/str2hint.mjs.html +2 -2
  419. package/docs/str2md5.mjs.html +2 -2
  420. package/docs/str2obj.mjs.html +2 -2
  421. package/docs/str2sha512.mjs.html +2 -2
  422. package/docs/str2u8arr.mjs.html +2 -2
  423. package/docs/strCompare.mjs.html +2 -2
  424. package/docs/strDiff.mjs.html +2 -2
  425. package/docs/strFindFuzz.mjs.html +2 -2
  426. package/docs/strFindFuzzDyn.mjs.html +2 -2
  427. package/docs/strFindSimilar.mjs.html +2 -2
  428. package/docs/strdelleft.mjs.html +2 -2
  429. package/docs/strdelright.mjs.html +2 -2
  430. package/docs/strleft.mjs.html +2 -2
  431. package/docs/strmid.mjs.html +2 -2
  432. package/docs/strright.mjs.html +2 -2
  433. package/docs/stru8arr2obj.mjs.html +2 -2
  434. package/docs/tand.mjs.html +2 -2
  435. package/docs/time2day.mjs.html +2 -2
  436. package/docs/time2hour.mjs.html +2 -2
  437. package/docs/time2min.mjs.html +2 -2
  438. package/docs/timeTZ2day.mjs.html +2 -2
  439. package/docs/timeTZ2expire.mjs.html +2 -2
  440. package/docs/timeTZ2hour.mjs.html +2 -2
  441. package/docs/timeTZ2min.mjs.html +2 -2
  442. package/docs/timeTZ2past.mjs.html +2 -2
  443. package/docs/timems2day.mjs.html +2 -2
  444. package/docs/timems2hour.mjs.html +2 -2
  445. package/docs/timems2min.mjs.html +2 -2
  446. package/docs/timems2time.mjs.html +2 -2
  447. package/docs/timemsTZ2day.mjs.html +2 -2
  448. package/docs/timemsTZ2expire.mjs.html +2 -2
  449. package/docs/timemsTZ2hour.mjs.html +2 -2
  450. package/docs/timemsTZ2min.mjs.html +2 -2
  451. package/docs/timemsTZ2past.mjs.html +2 -2
  452. package/docs/timemsTZ2time.mjs.html +2 -2
  453. package/docs/treeObj.mjs.html +2 -2
  454. package/docs/treeToFilepath.mjs.html +2 -2
  455. package/docs/trim.mjs.html +2 -2
  456. package/docs/u16arr2b64.mjs.html +2 -2
  457. package/docs/u16arr2u8arr.mjs.html +2 -2
  458. package/docs/u8arr2ab.mjs.html +2 -2
  459. package/docs/u8arr2b64.mjs.html +2 -2
  460. package/docs/u8arr2blob.mjs.html +2 -2
  461. package/docs/u8arr2bs.mjs.html +2 -2
  462. package/docs/u8arr2obj.mjs.html +2 -2
  463. package/docs/u8arr2str.mjs.html +2 -2
  464. package/docs/u8arr2u16arr.mjs.html +2 -2
  465. package/docs/urlParse.mjs.html +2 -2
  466. package/docs/verifyValue.mjs.html +2 -2
  467. package/docs/waitFun.mjs.html +2 -2
  468. package/docs/wsemi.html +462 -7
  469. package/g.mjs +142 -31
  470. package/package.json +1 -1
  471. package/src/cache.mjs +1 -1
  472. package/src/cacheBd.mjs +237 -0
  473. package/src/index.mjs +1 -0
  474. package/src/pmDebounce.mjs +0 -47
  475. package/src/pmMap.mjs +8 -1
  476. package/src/pmThrottle.mjs +1 -1
  477. package/src/queue.mjs +1 -1
  478. package/test/cacheBd.test.mjs +174 -0
  479. package/toolfp/dist/wsemip.umd.js +2 -2
  480. package/toolparfor/dist/wpf.umd.js +2 -2
  481. package/toolparfor/dist/wpf_pmSeries.umd.js +1 -1
package/g.mjs CHANGED
@@ -7,53 +7,164 @@ import fsDeleteFolder from './src/fsDeleteFolder.mjs'
7
7
  import fsSrlog from './src/fsSrlog.mjs'
8
8
  import dig from './src/dig.mjs'
9
9
  import genPm from './src/genPm.mjs'
10
- import fsBuildReadStreamText from './src/fsBuildReadStreamText.mjs'
10
+ import delay from './src/delay.mjs'
11
+ import cacheBd from './src/cacheBd.mjs'
11
12
 
12
13
 
13
- let test = async () => {
14
-
14
+ let test1 = async () => {
15
15
  let ms = []
16
16
 
17
- let fdt = './_test_fsBuildReadStreamText'
18
- fsCreateFolder(fdt) //創建臨時任務資料夾
17
+ let fun = async(p1, p2) => {
18
+ await delay(300)
19
+ return `${p1}:${p2}`
20
+ }
21
+
22
+ let bc = cacheBd(fun)
23
+ let execFun = bc.get
24
+ let execFunCache = bc.getByCache
25
+
26
+ let pm1 = execFunCache(123, 'abc') //pm1執行取得快取, 因無快取將持續等待
27
+ pm1
28
+ .then((res) => {
29
+ // console.log('res', res)
30
+ ms.push({ result: `pm1-${res}` })
31
+ })
32
+
33
+ let pm2 = execFun(4.56, 'def') //pm2執行原本函數與使用輸入, 會最先回傳, 且更新快取給等待或之後取得快取使用
34
+ pm2
35
+ .then((res) => {
36
+ // console.log('res', res)
37
+ ms.push({ result: `pm2-${res}` })
38
+ })
39
+
40
+ let pm3 = execFunCache(78.9, 'xyz') //pm3執行取得快取, 因已有快取將直接取得快取
41
+ pm3
42
+ .then((res) => {
43
+ // console.log('res', res)
44
+ ms.push({ result: `pm3-${res}` })
45
+ })
46
+
47
+ await Promise.all([pm1, pm2, pm3])
48
+ // console.log('rs', rs)
49
+
50
+ console.log('ms', ms)
51
+ return ms
52
+ }
53
+ await test1()
54
+ // ms [
55
+ // { result: 'pm2-4.56:def' },
56
+ // { result: 'pm1-4.56:def' },
57
+ // { result: 'pm3-4.56:def' }
58
+ // ]
59
+
60
+
61
+ let test2 = async () => {
62
+ let ms = []
19
63
 
20
- let fn = 't1.txt'
21
- let fp = `${fdt}/${fn}`
64
+ let fun = async(p1, p2) => {
65
+ await delay(300)
66
+ return `${p1}:${p2}`
67
+ }
22
68
 
23
- fs.writeFileSync(fp, `abc
24
- 測試中文
25
- def123xyz
26
- `, 'utf8')
69
+ let bc = cacheBd(fun)
70
+ let execFun = bc.get
71
+ let execFunCache = bc.getByCache
27
72
 
28
- let ev = fsBuildReadStreamText(fp)
29
- ms.push({ 'create': '' })
73
+ setTimeout(() => {
74
+ console.log('pm1 exec..')
75
+ let pm1 = execFunCache(123, 'abc') //pm1執行取得快取, 因無快取將持續等待
76
+ pm1
77
+ .then((res) => {
78
+ console.log('pm1 then', res)
79
+ ms.push({ result: `pm1-${res}` })
80
+ })
81
+ }, 1)
30
82
 
31
- ev.on('line', (line) => {
32
- console.log('line', line)
33
- ms.push({ line })
34
- })
83
+ setTimeout(() => {
84
+ console.log('pm2 exec..')
85
+ let pm2 = execFun(4.56, 'def') //1000ms後, pm2執行原本函數與使用輸入, 會最先回傳, 且更新快取給等待或之後取得快取使用
86
+ pm2
87
+ .then((res) => {
88
+ console.log('pm2 then', res)
89
+ ms.push({ result: `pm2-${res}` })
90
+ })
91
+ }, 1000)
35
92
 
36
- let pm = genPm()
37
- ev.on('close', () => {
38
- console.log('close')
39
- pm.resolve()
40
- ms.push({ 'close': '' })
41
- })
42
- await pm
93
+ setTimeout(() => {
94
+ console.log('pm3 exec..')
95
+ let pm3 = execFunCache(78.9, 'xyz') //pm3執行取得快取, 因已有快取將直接取得快取
96
+ pm3
97
+ .then((res) => {
98
+ console.log('pm3 then', res)
99
+ ms.push({ result: `pm3-${res}` })
100
+ })
101
+ }, 3000)
43
102
 
44
- fsDeleteFolder(fdt) //刪除臨時任務資料夾
103
+ await delay(5000)
45
104
 
46
105
  console.log('ms', ms)
47
106
  return ms
48
107
  }
49
- await test()
108
+ await test2()
50
109
  // ms [
51
- // { create: '' },
52
- // { line: 'abc' },
53
- // { line: '測試中文' },
54
- // { line: 'def123xyz' },
55
- // { close: '' }
110
+ // { result: 'pm2-4.56:def' },
111
+ // { result: 'pm1-4.56:def' },
112
+ // { result: 'pm3-4.56:def' }
56
113
  // ]
57
114
 
58
115
 
116
+ let test3 = async () => {
117
+ let ms = []
118
+
119
+ let fun = async(p1, p2) => {
120
+ await delay(300)
121
+ return `${p1}:${p2}`
122
+ }
123
+
124
+ let bc = cacheBd(fun)
125
+ let execFun = bc.get
126
+ let execFunCache = bc.getByCache
127
+
128
+ setTimeout(() => {
129
+ console.log('pm1 exec..')
130
+ let pm1 = execFunCache(123, 'abc') //pm1執行取得快取, 因無快取將持續等待, 3000ms將執行get與自己的輸入, 並最先回傳
131
+ pm1
132
+ .then((res) => {
133
+ console.log('pm1 then', res)
134
+ ms.push({ result: `pm1-${res}` })
135
+ })
136
+ }, 1)
137
+
138
+ setTimeout(() => {
139
+ console.log('pm2 exec..')
140
+ let pm2 = execFun(4.56, 'def') //3500ms後, pm2執行原本函數與使用輸入, 計算完畢則會覆蓋快取, 此快取將再給等待或之後取得快取使用
141
+ pm2
142
+ .then((res) => {
143
+ console.log('pm2 then', res)
144
+ ms.push({ result: `pm2-${res}` })
145
+ })
146
+ }, 3500)
147
+
148
+ setTimeout(() => {
149
+ console.log('pm3 exec..')
150
+ let pm3 = execFunCache(78.9, 'xyz') //pm3執行取得快取, 因已有快取將直接取得快取
151
+ pm3
152
+ .then((res) => {
153
+ console.log('pm3 then', res)
154
+ ms.push({ result: `pm3-${res}` })
155
+ })
156
+ }, 4500)
157
+
158
+ await delay(6500)
159
+
160
+ console.log('ms', ms)
161
+ return ms
162
+ }
163
+ await test3()
164
+ // ms [
165
+ // { result: 'pm1-123:abc' },
166
+ // { result: 'pm2-4.56:def' },
167
+ // { result: 'pm3-4.56:def' }
168
+ // ]
169
+
59
170
  //node g.mjs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wsemi",
3
- "version": "1.8.12",
3
+ "version": "1.8.13",
4
4
  "main": "dist/wsemi.umd.js",
5
5
  "dependencies": {
6
6
  "chokidar": "^4.0.3",
package/src/cache.mjs CHANGED
@@ -10,7 +10,7 @@ import cint from './cint.mjs'
10
10
 
11
11
 
12
12
  /**
13
- * 非同步函數快取
13
+ * 非同步函數快取,通過指定key代表函數與其輸入進行執行並快取,快取可設定失效時間,超過失效時間則重新執行與再更新快取
14
14
  *
15
15
  * Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/cache.test.mjs Github}
16
16
  * @memberOf wsemi
@@ -0,0 +1,237 @@
1
+ import get from 'lodash-es/get.js'
2
+ import ispint from './ispint.mjs'
3
+ import cint from './cint.mjs'
4
+ import delay from './delay.mjs'
5
+
6
+
7
+ /**
8
+ * 封裝非同步函數與再提供使用快取版
9
+ *
10
+ * Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/cacheBd.test.mjs Github}
11
+ * @memberOf wsemi
12
+ * @param {Function} fun 輸入非同步函數
13
+ * @param {Object} [opt={}] 輸入設定物件,預設{}
14
+ * @param {Integer} [nMax=200] 輸入使用快取版之總嘗試次數整數,超過則報錯,預設200
15
+ * @param {Integer} [nTrigger=3] 輸入嘗試指定次數整數,若嘗試指定次數之後皆無快取則須自動執行get用以取得快取,預設3
16
+ * @returns {Object} 回傳事件物件,可呼叫事件get、getByCache,get為封裝後封裝原本非同步函數,getByCache為提供取用快取版之非同步函數,若有快取則優先使用,若超過指定次數則自動執行get使能取得快取
17
+ * @example
18
+ *
19
+ * let test1 = async () => {
20
+ * let ms = []
21
+ *
22
+ * let fun = async(p1, p2) => {
23
+ * await delay(300)
24
+ * return `${p1}:${p2}`
25
+ * }
26
+ *
27
+ * let bc = cacheBd(fun)
28
+ * let execFun = bc.get
29
+ * let execFunCache = bc.getByCache
30
+ *
31
+ * let pm1 = execFunCache(123, 'abc') //pm1執行取得快取, 因無快取將持續等待
32
+ * pm1
33
+ * .then((res) => {
34
+ * // console.log('res', res)
35
+ * ms.push({ result: `pm1-${res}` })
36
+ * })
37
+ *
38
+ * let pm2 = execFun(4.56, 'def') //pm2執行原本函數與使用輸入, 會最先回傳, 且更新快取給等待或之後取得快取使用
39
+ * pm2
40
+ * .then((res) => {
41
+ * // console.log('res', res)
42
+ * ms.push({ result: `pm2-${res}` })
43
+ * })
44
+ *
45
+ * let pm3 = execFunCache(78.9, 'xyz') //pm3執行取得快取, 因已有快取將直接取得快取
46
+ * pm3
47
+ * .then((res) => {
48
+ * // console.log('res', res)
49
+ * ms.push({ result: `pm3-${res}` })
50
+ * })
51
+ *
52
+ * await Promise.all([pm1, pm2, pm3])
53
+ * // console.log('rs', rs)
54
+ *
55
+ * console.log('ms', ms)
56
+ * return ms
57
+ * }
58
+ * await test1()
59
+ * // ms [
60
+ * // { result: 'pm2-4.56:def' },
61
+ * // { result: 'pm1-4.56:def' },
62
+ * // { result: 'pm3-4.56:def' }
63
+ * // ]
64
+ *
65
+ * let test2 = async () => {
66
+ * let ms = []
67
+ *
68
+ * let fun = async(p1, p2) => {
69
+ * await delay(300)
70
+ * return `${p1}:${p2}`
71
+ * }
72
+ *
73
+ * let bc = cacheBd(fun)
74
+ * let execFun = bc.get
75
+ * let execFunCache = bc.getByCache
76
+ *
77
+ * setTimeout(() => {
78
+ * console.log('pm1 exec..')
79
+ * let pm1 = execFunCache(123, 'abc') //pm1執行取得快取, 因無快取將持續等待
80
+ * pm1
81
+ * .then((res) => {
82
+ * console.log('pm1 then', res)
83
+ * ms.push({ result: `pm1-${res}` })
84
+ * })
85
+ * }, 1)
86
+ *
87
+ * setTimeout(() => {
88
+ * console.log('pm2 exec..')
89
+ * let pm2 = execFun(4.56, 'def') //1000ms後, pm2執行原本函數與使用輸入, 會最先回傳, 且更新快取給等待或之後取得快取使用
90
+ * pm2
91
+ * .then((res) => {
92
+ * console.log('pm2 then', res)
93
+ * ms.push({ result: `pm2-${res}` })
94
+ * })
95
+ * }, 1000)
96
+ *
97
+ * setTimeout(() => {
98
+ * console.log('pm3 exec..')
99
+ * let pm3 = execFunCache(78.9, 'xyz') //pm3執行取得快取, 因已有快取將直接取得快取
100
+ * pm3
101
+ * .then((res) => {
102
+ * console.log('pm3 then', res)
103
+ * ms.push({ result: `pm3-${res}` })
104
+ * })
105
+ * }, 3000)
106
+ *
107
+ * await delay(5000)
108
+ *
109
+ * console.log('ms', ms)
110
+ * return ms
111
+ * }
112
+ * await test2()
113
+ * // ms [
114
+ * // { result: 'pm2-4.56:def' },
115
+ * // { result: 'pm1-4.56:def' },
116
+ * // { result: 'pm3-4.56:def' }
117
+ * // ]
118
+ *
119
+ * let test3 = async () => {
120
+ * let ms = []
121
+ *
122
+ * let fun = async(p1, p2) => {
123
+ * await delay(300)
124
+ * return `${p1}:${p2}`
125
+ * }
126
+ *
127
+ * let bc = cacheBd(fun)
128
+ * let execFun = bc.get
129
+ * let execFunCache = bc.getByCache
130
+ *
131
+ * setTimeout(() => {
132
+ * console.log('pm1 exec..')
133
+ * let pm1 = execFunCache(123, 'abc') //pm1執行取得快取, 因無快取將持續等待, 3000ms將執行get與自己的輸入, 並最先回傳
134
+ * pm1
135
+ * .then((res) => {
136
+ * console.log('pm1 then', res)
137
+ * ms.push({ result: `pm1-${res}` })
138
+ * })
139
+ * }, 1)
140
+ *
141
+ * setTimeout(() => {
142
+ * console.log('pm2 exec..')
143
+ * let pm2 = execFun(4.56, 'def') //3500ms後, pm2執行原本函數與使用輸入, 計算完畢則會覆蓋快取, 此快取將再給等待或之後取得快取使用
144
+ * pm2
145
+ * .then((res) => {
146
+ * console.log('pm2 then', res)
147
+ * ms.push({ result: `pm2-${res}` })
148
+ * })
149
+ * }, 3500)
150
+ *
151
+ * setTimeout(() => {
152
+ * console.log('pm3 exec..')
153
+ * let pm3 = execFunCache(78.9, 'xyz') //pm3執行取得快取, 因已有快取將直接取得快取
154
+ * pm3
155
+ * .then((res) => {
156
+ * console.log('pm3 then', res)
157
+ * ms.push({ result: `pm3-${res}` })
158
+ * })
159
+ * }, 4500)
160
+ *
161
+ * await delay(6500)
162
+ *
163
+ * console.log('ms', ms)
164
+ * return ms
165
+ * }
166
+ * await test3()
167
+ * // ms [
168
+ * // { result: 'pm1-123:abc' },
169
+ * // { result: 'pm2-4.56:def' },
170
+ * // { result: 'pm3-4.56:def' }
171
+ * // ]
172
+ *
173
+ */
174
+ function cacheBd(fun, opt = {}) {
175
+
176
+ //nMax
177
+ let nMax = get(opt, 'nMax')
178
+ if (!ispint(nMax)) {
179
+ nMax = 200
180
+ }
181
+ nMax = cint(nMax)
182
+
183
+ //nTrigger
184
+ let nTrigger = get(opt, 'nTrigger')
185
+ if (!ispint(nTrigger)) {
186
+ nTrigger = 3
187
+ }
188
+ nTrigger = cint(nTrigger)
189
+
190
+ //快取
191
+ let cc = null
192
+
193
+ //函數執行狀態
194
+ let lock = false
195
+
196
+ //_get, 封裝原本非同步函數
197
+ let _get = async(...inputs) => {
198
+ lock = true
199
+ cc = await fun(...inputs) //若發生錯誤則向外報錯
200
+ lock = false
201
+ return cc
202
+ }
203
+
204
+ //_getByCache, 提供取用快取版之非同步函數, 若有快取則優先使用, 若超過指定次數則執行get使能取得快取
205
+ let _getByCache = async(...inputs) => {
206
+ for (let i = 1; i <= nMax; i++) {
207
+
208
+ //exec
209
+ if (i > nTrigger && !lock) {
210
+ // console.log('執行get使能取得快取...')
211
+ await _get(...inputs)
212
+ .catch(() => {}) //取得快取時不向外報錯
213
+ }
214
+
215
+ //check
216
+ if (cc !== null) {
217
+ break
218
+ }
219
+
220
+ //delay
221
+ await delay(1000) //偵測週期1000ms
222
+
223
+ }
224
+ if (cc === null) {
225
+ throw new Error(`exceeded nMax[${nMax}]`)
226
+ }
227
+ return cc
228
+ }
229
+
230
+ return {
231
+ get: _get,
232
+ getByCache: _getByCache,
233
+ }
234
+ }
235
+
236
+
237
+ export default cacheBd
package/src/index.mjs CHANGED
@@ -55,6 +55,7 @@ export { default as bufReadDbl } from './bufReadDbl.mjs'
55
55
  export { default as bufWrite } from './bufWrite.mjs'
56
56
  export { default as bufWriteDbl } from './bufWriteDbl.mjs'
57
57
  export { default as cache } from './cache.mjs'
58
+ export { default as cacheBd } from './cacheBd.mjs'
58
59
  export { default as cbol } from './cbol.mjs'
59
60
  export { default as cdbl } from './cdbl.mjs'
60
61
  export { default as ceil } from './ceil.mjs'
@@ -114,47 +114,6 @@ import cint from './cint.mjs'
114
114
  */
115
115
  function pmDebounce(ms = 300) {
116
116
 
117
- // function ClsDebounceEasy(ms) { //簡易法, 因執行階段中無法儲存推入任務會被視為強制取消, 不合需求
118
-
119
- // //timer
120
- // let t = null
121
-
122
- // //pm
123
- // let pm = Promise.resolve()
124
-
125
- // //run
126
- // let run = (func, ...input) => {
127
-
128
- // //clearTimeout
129
- // clearTimeout(t)
130
-
131
- // // console.log('call fun')
132
- // return new Promise((resolve, reject) => {
133
- // // console.log('call in Promise', ...input, ms)
134
-
135
- // //setTimeout
136
- // t = setTimeout(async () => {
137
- // // console.log('exec fun start', ...input, ms)
138
-
139
- // try {
140
- // let res = func(...input)
141
- // if (ispm(res)) {
142
- // res = await pm
143
- // }
144
- // resolve(res)
145
- // }
146
- // catch (err) {
147
- // reject(err)
148
- // }
149
- // // console.log('exec fun end')
150
-
151
- // }, ms)
152
- // })
153
- // }
154
-
155
- // return run
156
- // }
157
-
158
117
  function ClsDebounce(ms) {
159
118
  let q = [] //queue
160
119
  let t = null //timer
@@ -167,12 +126,6 @@ function pmDebounce(ms = 300) {
167
126
  }
168
127
  ms = cint(ms)
169
128
 
170
- // //_tNow
171
- // let _tNow = Date.now()
172
- // let getIt = () => {
173
- // return Date.now() - _tNow
174
- // }
175
-
176
129
  function detect() {
177
130
 
178
131
  //check
package/src/pmMap.mjs CHANGED
@@ -5,6 +5,7 @@ import genPm from './genPm.mjs'
5
5
  import isarr from './isarr.mjs'
6
6
  import isobj from './isobj.mjs'
7
7
  import isfun from './isfun.mjs'
8
+ import ispm from './ispm.mjs'
8
9
  import queue from './queue.mjs'
9
10
 
10
11
 
@@ -20,7 +21,7 @@ import queue from './queue.mjs'
20
21
  * Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/pmMap.test.mjs Github}
21
22
  * @memberOf wsemi
22
23
  * @param {Array} rs 輸入資料陣列,若不給fn則rs需要為Promise陣列
23
- * @param {Function} fun 輸入循序執行值的呼叫函數
24
+ * @param {Function} fun 輸入循序執行值的呼叫async函數
24
25
  * @param {Integer} [takeLimit=0] 輸入同時處理數量整數,預設0,代表無限制
25
26
  * @returns {Promise} 回傳Promise,resolve回傳成功結果,reject回傳失敗結果
26
27
  * @example
@@ -405,6 +406,12 @@ function pmMap(rs, fun, takeLimit = 0) {
405
406
  uv = v.value.v
406
407
  }
407
408
  pmm = fun(uv, uk)
409
+
410
+ //check
411
+ if (!ispm(pmm)) {
412
+ throw new Error(`return of fun is not a promise`)
413
+ }
414
+
408
415
  }
409
416
  else {
410
417
  pmm = v.value
@@ -326,7 +326,7 @@ function pmThrottle() {
326
326
  t = null
327
327
  }
328
328
 
329
- }, 10) //10ms偵測, 啟動後跑timer, 無佇列則會停止減耗
329
+ }, 20) //20ms偵測, 啟動後跑timer, 無佇列則會停止減耗
330
330
  }
331
331
 
332
332
  function run(func, ...input) {
package/src/queue.mjs CHANGED
@@ -4,7 +4,7 @@ import cint from './cint.mjs'
4
4
 
5
5
 
6
6
  /**
7
- * 佇列處理器,單生產者單消費者模式,核心使用迭代器,具有消息堵塞與可限定同時處理上限數量功能
7
+ * 佇列處理器,單生產者單消費者模式,具有消息堵塞與可限定同時處理上限數量功能
8
8
  *
9
9
  * Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/queue.test.mjs Github}
10
10
  * @memberOf wsemi