wsemi 1.9.21 → 1.9.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/wsemi.umd.js +6 -6
- package/dist/wsemi.umd.js.map +1 -1
- package/docs/-_class.mjs.html +1 -1
- package/docs/-_const.mjs.html +1 -1
- package/docs/-_detector.mjs.html +1 -1
- package/docs/-_errToStr.mjs.html +1 -1
- package/docs/-_execThrownMsg.mjs.html +1 -1
- package/docs/-_isRealError.mjs.html +1 -1
- package/docs/-_optNum.mjs.html +1 -1
- package/docs/-_pmMarkHandled.mjs.html +1 -1
- package/docs/-_pmReadItems.mjs.html +1 -1
- package/docs/-_pmSettleByState.mjs.html +1 -1
- package/docs/-_realErrorToStr.mjs.html +1 -1
- package/docs/-_toResultError.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 +263 -25
- 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/cvOrmFind.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/detectXSS.mjs.html +1 -1
- package/docs/detectXSSDyn.mjs.html +1 -1
- package/docs/dig.mjs.html +1 -1
- package/docs/digExp.mjs.html +1 -1
- package/docs/domAlert.mjs.html +1 -1
- package/docs/domAppend.mjs.html +1 -1
- package/docs/domCancelEvent.mjs.html +1 -1
- package/docs/domCompareText.mjs.html +1 -1
- package/docs/domConvertToPic.mjs.html +1 -1
- package/docs/domConvertToPicDyn.mjs.html +1 -1
- package/docs/domDetect.mjs.html +1 -1
- package/docs/domDrag.mjs.html +1 -1
- package/docs/domDragBarAndScroll.mjs.html +1 -1
- package/docs/domDragPointer.mjs.html +1 -1
- package/docs/domDragPreview.mjs.html +1 -1
- package/docs/domDropFiles.mjs.html +1 -1
- package/docs/domElementsFromPoint.mjs.html +1 -1
- package/docs/domFadeIn.mjs.html +1 -1
- package/docs/domFadeOut.mjs.html +1 -1
- package/docs/domFind.mjs.html +1 -1
- package/docs/domFinds.mjs.html +1 -1
- package/docs/domGetAttr.mjs.html +1 -1
- package/docs/domGetBoudRect.mjs.html +1 -1
- package/docs/domGetBoudRectRefSelf.mjs.html +1 -1
- package/docs/domGetFileAccept.mjs.html +1 -1
- package/docs/domGetFiles.mjs.html +1 -1
- package/docs/domGetParents.mjs.html +1 -1
- package/docs/domGetPointFromEvent.mjs.html +1 -1
- package/docs/domGetScrollableParent.mjs.html +1 -1
- package/docs/domGetWindowSize.mjs.html +1 -1
- package/docs/domIsClientXYIn.mjs.html +1 -1
- package/docs/domIsFocused.mjs.html +1 -1
- package/docs/domIsRendered.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-detectXSS.html +1 -1
- package/docs/examples/ex-detectXSSDyn.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 +12 -8
- package/docs/flattenTree.mjs.html +9 -9
- 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 +14 -13
- 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 +7 -6
- 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 +1 -1
- package/docs/isbol.mjs.html +1 -1
- package/docs/isday.mjs.html +1 -1
- package/docs/isearr.mjs.html +1 -1
- package/docs/iseobj.mjs.html +1 -1
- package/docs/iser.mjs.html +1 -1
- package/docs/isernot.mjs.html +1 -1
- package/docs/isestr.mjs.html +1 -1
- package/docs/isfile.mjs.html +1 -1
- package/docs/isfun.mjs.html +1 -1
- package/docs/isint.mjs.html +1 -1
- package/docs/ismonth.mjs.html +1 -1
- package/docs/isn0int.mjs.html +1 -1
- package/docs/isn0num.mjs.html +1 -1
- package/docs/isnan.mjs.html +1 -1
- package/docs/isnbr.mjs.html +1 -1
- package/docs/isnint.mjs.html +1 -1
- package/docs/isnnum.mjs.html +1 -1
- package/docs/isnull.mjs.html +1 -1
- package/docs/isnum.mjs.html +1 -1
- package/docs/isobj.mjs.html +1 -1
- package/docs/isobj0.mjs.html +1 -1
- package/docs/isp0int.mjs.html +1 -1
- package/docs/isp0num.mjs.html +1 -1
- package/docs/ispint.mjs.html +1 -1
- package/docs/ispm.mjs.html +1 -1
- package/docs/ispnum.mjs.html +1 -1
- package/docs/isstr.mjs.html +1 -1
- package/docs/isstr0.mjs.html +1 -1
- package/docs/istime.mjs.html +1 -1
- package/docs/istimeTZ.mjs.html +1 -1
- package/docs/istimems.mjs.html +1 -1
- package/docs/istimemsTZ.mjs.html +1 -1
- package/docs/isu16arr.mjs.html +1 -1
- package/docs/isu8arr.mjs.html +1 -1
- package/docs/isundefined.mjs.html +1 -1
- package/docs/j2o.mjs.html +1 -1
- package/docs/judge.mjs.html +1 -1
- package/docs/keysmat2ltdt.mjs.html +1 -1
- package/docs/ltdt2vrtsable.mjs.html +1 -1
- package/docs/ltdtDiff.mjs.html +1 -1
- package/docs/ltdtDiffByKey.mjs.html +1 -1
- package/docs/ltdtkeys2mat.mjs.html +1 -1
- package/docs/ltdtkeysheads2mat.mjs.html +1 -1
- package/docs/ltdtmapping.mjs.html +1 -1
- package/docs/ltdtmerge.mjs.html +1 -1
- package/docs/ltdtpick.mjs.html +1 -1
- package/docs/ltdtpull.mjs.html +1 -1
- package/docs/mat2ltdt.mjs.html +1 -1
- package/docs/matConcat.mjs.html +1 -1
- package/docs/matDiff.mjs.html +1 -1
- package/docs/matat.mjs.html +1 -1
- package/docs/now2str.mjs.html +1 -1
- package/docs/now2strp.mjs.html +1 -1
- package/docs/nowDay2str.mjs.html +1 -1
- package/docs/nowms2str.mjs.html +1 -1
- package/docs/nowms2strp.mjs.html +1 -1
- package/docs/o2j.mjs.html +1 -1
- package/docs/obj2b64.mjs.html +1 -1
- package/docs/obj2pb64.mjs.html +1 -1
- package/docs/obj2str.mjs.html +1 -1
- package/docs/obj2stru8arr.mjs.html +1 -1
- package/docs/obj2u8arr.mjs.html +1 -1
- package/docs/objSortBy.mjs.html +1 -1
- package/docs/objSortByKeys.mjs.html +1 -1
- package/docs/oo.mjs.html +1 -1
- package/docs/openLink.mjs.html +1 -1
- package/docs/pb642obj.mjs.html +1 -1
- package/docs/pmChain.mjs.html +1 -1
- package/docs/pmConvertResolve.mjs.html +1 -1
- package/docs/pmDebounce.mjs.html +1 -1
- package/docs/pmHook.mjs.html +1 -1
- package/docs/pmHookReject.mjs.html +1 -1
- package/docs/pmIni.mjs.html +1 -1
- package/docs/pmInvResolve.mjs.html +1 -1
- package/docs/pmKeyMutex.mjs.html +1 -1
- package/docs/pmMap.mjs.html +1 -1
- package/docs/pmQueue.mjs.html +1 -1
- package/docs/pmSeries.mjs.html +1 -1
- package/docs/pmThrottle.mjs.html +1 -1
- package/docs/pmTimeout.mjs.html +1 -1
- package/docs/preciseNum.mjs.html +1 -1
- package/docs/pseudoRandom.mjs.html +1 -1
- package/docs/pseudoRandomIntRange.mjs.html +1 -1
- package/docs/pseudoRandomIntsNdpRange.mjs.html +1 -1
- package/docs/pseudoRandomIntsRange.mjs.html +1 -1
- package/docs/pseudoRandomRange.mjs.html +1 -1
- package/docs/pseudoRandomsRange.mjs.html +1 -1
- package/docs/queue.mjs.html +1 -1
- package/docs/random.mjs.html +1 -1
- package/docs/randomIntRange.mjs.html +1 -1
- package/docs/randomIntsNdpRange.mjs.html +1 -1
- package/docs/randomIntsRange.mjs.html +1 -1
- package/docs/randomRange.mjs.html +1 -1
- package/docs/randomsRange.mjs.html +1 -1
- package/docs/rang.mjs.html +1 -1
- package/docs/rep.mjs.html +1 -1
- package/docs/repObj.mjs.html +1 -1
- package/docs/replace.mjs.html +1 -1
- package/docs/replaceObj.mjs.html +1 -1
- package/docs/replacePlus.mjs.html +1 -1
- package/docs/round.mjs.html +1 -1
- package/docs/secd.mjs.html +1 -1
- package/docs/sep.mjs.html +1 -1
- package/docs/sepInt.mjs.html +1 -1
- package/docs/setIntervalHp.mjs.html +1 -1
- package/docs/setTimeoutHp.mjs.html +1 -1
- package/docs/sind.mjs.html +1 -1
- package/docs/split.mjs.html +1 -1
- package/docs/str2aes.mjs.html +1 -1
- package/docs/str2b64.mjs.html +1 -1
- package/docs/str2hint.mjs.html +1 -1
- package/docs/str2md5.mjs.html +1 -1
- package/docs/str2obj.mjs.html +1 -1
- package/docs/str2sha.mjs.html +1 -1
- package/docs/str2sha512.mjs.html +1 -1
- package/docs/str2u8arr.mjs.html +1 -1
- package/docs/strCompare.mjs.html +1 -1
- package/docs/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 +7 -7
- 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 +17 -3
- 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 +36 -13
- package/package.json +1 -1
- package/src/clearXSS.mjs +262 -24
- package/src/flattenToConn.mjs +11 -7
- package/src/flattenTree.mjs +8 -8
- package/src/fsTask.mjs +13 -12
- package/src/getltdtkeys.mjs +6 -5
- package/src/treeObj.mjs +6 -6
- package/src/u8arr2obj.mjs +16 -2
- package/test/clearXSS.test.mjs +1276 -1
- package/test/flattenToConn.test.mjs +83 -0
- package/test/flattenTree.test.mjs +49 -0
- package/test/fsTask.test.mjs +144 -0
- package/test/getltdtkeys.test.mjs +71 -0
- package/test/tools/clearXssWalkRunner.mjs +202 -0
- package/test/treeObj.test.mjs +119 -0
- package/test/u8arr2obj.test.mjs +107 -2
- package/toolfp/dist/wsemip.umd.js +1 -1
- package/toolparfor/dist/wpf.umd.js +1 -1
- package/toolparfor/dist/wpf_pmSeries.umd.js +1 -1
package/docs/wsemi.html
CHANGED
|
@@ -15497,14 +15497,37 @@ await test3()
|
|
|
15497
15497
|
<p>Depend on: <a href="https://jsxss.com/zh/index.html">https://jsxss.com/zh/index.html</a></p>
|
|
15498
15498
|
<p>白名單外之標籤轉義,白名單內之標籤刪除白名單外之屬性與危險網址(style屬性保留),標籤外之文字只轉義會開始標籤之<(其後為英文字母、斜線、驚嘆號、問號或位於結尾),>與其餘之<維持原樣,故'a < b'等數學式不改寫</p>
|
|
15499
15499
|
<p>輸出僅供以HTML內文呈現(如v-html、innerHTML),不可放入屬性值或註解內</p>
|
|
15500
|
-
<p
|
|
15500
|
+
<p>走訪採顯式堆疊並以來源物件之參照記憶化,不遞迴:深巢狀與循環參照不拋錯(循環保持),共用子結構只處理一次且輸出中保持共用,成本與節點數成正比,不設深度上限(僅受堆積限制)。處置如下:</p>
|
|
15501
|
+
<ol>
|
|
15502
|
+
<li>
|
|
15503
|
+
<p>字串清除(含包裝String,清除後為原始字串);空字串與number、boolean、null、undefined等非字串原值回傳</p>
|
|
15504
|
+
</li>
|
|
15505
|
+
<li>
|
|
15506
|
+
<p>物件(含類別實例)與真陣列(含子類別)走訪並保留原型(null原型物件變一般物件),length視為一般鍵(不使走訪改為類陣列,不新增鍵),成本與length值無關;物件依自有可列舉之字串鍵與Symbol鍵,陣列依索引(空洞補undefined,非索引屬性不複製,正規表示式比對結果之index與input除外,其input亦清除);Map走訪值、Set走訪元素(Map之鍵不處理,清除後相同之Set元素合併),Map與Set之自有可列舉屬性一併走訪;不可列舉屬性不複製,原型上之資料不處理</p>
|
|
15507
|
+
</li>
|
|
15508
|
+
<li>
|
|
15509
|
+
<p>物件之字串鍵與Map之鍵不清除,由使用端自行檢核</p>
|
|
15510
|
+
</li>
|
|
15511
|
+
<li>
|
|
15512
|
+
<p>arguments物件與以Symbol.toStringTag偽稱Array或Arguments之物件,視為物件並依自有可列舉鍵走訪,轉為一般物件</p>
|
|
15513
|
+
</li>
|
|
15514
|
+
<li>
|
|
15515
|
+
<p>Date、RegExp、型別陣列、Buffer、ArrayBuffer、包裝Number等回傳複本,其自有字串屬性不清除(物件值屬性依上述走訪);函數、Error、WeakMap、Promise、URL等不可複製者,巢狀時回傳同一參照而不清除其內字串,位於最外層時函數複製為一般物件(清除其可列舉屬性)、Error等回傳{};其餘經lodash cloneDeep複製後仍帶自訂Symbol.toStringTag之物件亦不清除其內字串</p>
|
|
15516
|
+
</li>
|
|
15517
|
+
<li>
|
|
15518
|
+
<p>經lodash cloneDeep複製之物件(上述第4、5點以外之非一般物件,如類別實例、null原型物件、陣列子類別、自訂標籤者)沿用其複製行為(含原型上之setter),再依複本之終態逐鍵清除;除此之外輸入不被修改</p>
|
|
15519
|
+
</li>
|
|
15520
|
+
<li>
|
|
15521
|
+
<p>清除對字串不保證冪等(如<b='<<>清一次與清兩次結果不同),已清除之值再送入可能再被改寫</p>
|
|
15522
|
+
</li>
|
|
15523
|
+
</ol>
|
|
15501
15524
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/clearXSS.test.mjs">Github</a></p></li></ul></dd>
|
|
15502
15525
|
|
|
15503
15526
|
|
|
15504
15527
|
|
|
15505
15528
|
<dt class="tag-source">Source:</dt>
|
|
15506
15529
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
15507
|
-
<a href="clearXSS.mjs.html">clearXSS.mjs</a>, <a href="clearXSS.mjs.html#
|
|
15530
|
+
<a href="clearXSS.mjs.html">clearXSS.mjs</a>, <a href="clearXSS.mjs.html#line138">line 138</a>
|
|
15508
15531
|
</li></ul></dd>
|
|
15509
15532
|
|
|
15510
15533
|
|
|
@@ -15551,7 +15574,7 @@ await test3()
|
|
|
15551
15574
|
|
|
15552
15575
|
<h5 class="h5-examples">Example</h5>
|
|
15553
15576
|
|
|
15554
|
-
<pre class="prettyprint"><code>console.log(clearXSS(`><script>alert('XSS')</script>`))
|
|
15577
|
+
<pre class="prettyprint"><code>console.log(clearXSS(`><script>alert('XSS')</script>`))
|
|
15555
15578
|
|
|
15556
15579
|
|
|
15557
15580
|
|
|
@@ -15604,7 +15627,7 @@ await test3()
|
|
|
15604
15627
|
|
|
15605
15628
|
|
|
15606
15629
|
|
|
15607
|
-
<td class="description last"><p
|
|
15630
|
+
<td class="description last"><p>輸入資料,可為字串,或含字串之物件、陣列、Map、Set</p></td>
|
|
15608
15631
|
</tr>
|
|
15609
15632
|
|
|
15610
15633
|
|
|
@@ -15630,7 +15653,7 @@ await test3()
|
|
|
15630
15653
|
|
|
15631
15654
|
|
|
15632
15655
|
<div class="param-desc">
|
|
15633
|
-
<p
|
|
15656
|
+
<p>輸出資料,字串輸入回傳清除後字串,其餘回傳清除後之新結構(原始值原樣回傳)</p>
|
|
15634
15657
|
</div>
|
|
15635
15658
|
|
|
15636
15659
|
|
|
@@ -40582,7 +40605,7 @@ if (true) {
|
|
|
40582
40605
|
<dl class="details">
|
|
40583
40606
|
|
|
40584
40607
|
<dt class="tag-description">Description:</dt>
|
|
40585
|
-
<dd class="tag-description"><ul class="dummy"><li><p
|
|
40608
|
+
<dd class="tag-description"><ul class="dummy"><li><p>展平物件或陣列成為關聯陣列,真陣列(含帶其他Symbol.toStringTag者)依索引,物件依自有鍵(length視為一般鍵),以Symbol.toStringTag偽稱Array之物件視為物件</p>
|
|
40586
40609
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/flattenToConn.test.mjs">Github</a></p></li></ul></dd>
|
|
40587
40610
|
|
|
40588
40611
|
|
|
@@ -41045,7 +41068,7 @@ if (true) {
|
|
|
41045
41068
|
<dl class="details">
|
|
41046
41069
|
|
|
41047
41070
|
<dt class="tag-description">Description:</dt>
|
|
41048
|
-
<dd class="tag-description"><ul class="dummy"><li><p
|
|
41071
|
+
<dd class="tag-description"><ul class="dummy"><li><p>展平樹狀物件或陣列,以Symbol.toStringTag偽稱Array之物件視為物件</p>
|
|
41049
41072
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/flattenTree.test.mjs">Github</a></p></li></ul></dd>
|
|
41050
41073
|
|
|
41051
41074
|
|
|
@@ -66009,7 +66032,7 @@ console.log(wb2.sheets[0].name)
|
|
|
66009
66032
|
<dl class="details">
|
|
66010
66033
|
|
|
66011
66034
|
<dt class="tag-description">Description:</dt>
|
|
66012
|
-
<dd class="tag-description"><ul class="dummy"><li><p>由ltdt提取不重複keys</p>
|
|
66035
|
+
<dd class="tag-description"><ul class="dummy"><li><p>由ltdt提取不重複keys,各列物件只依自有可列舉鍵(length視為一般鍵)</p>
|
|
66013
66036
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/getltdtkeys.test.mjs">Github</a></p></li></ul></dd>
|
|
66014
66037
|
|
|
66015
66038
|
|
|
@@ -107202,7 +107225,7 @@ console.log(strTruncate('abcdefghij', -1))
|
|
|
107202
107225
|
<dl class="details">
|
|
107203
107226
|
|
|
107204
107227
|
<dt class="tag-description">Description:</dt>
|
|
107205
|
-
<dd class="tag-description"><ul class="dummy"><li><p>遍歷物件並回傳複製物件,類似JSON.stringify
|
|
107228
|
+
<dd class="tag-description"><ul class="dummy"><li><p>遍歷物件並回傳複製物件,類似JSON.stringify,但不會序列化成為字串。真陣列(含帶其他Symbol.toStringTag者)依索引遍歷,物件依自有鍵遍歷(length視為一般鍵),以Symbol.toStringTag偽稱Array之物件視為物件</p>
|
|
107206
107229
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/treeObj.test.mjs">Github</a></p></li></ul></dd>
|
|
107207
107230
|
|
|
107208
107231
|
|
|
@@ -109916,7 +109939,7 @@ console.log(u8arr2bs('abc', { returnWithStateAndMsg: true }))
|
|
|
109916
109939
|
|
|
109917
109940
|
<dt class="tag-source">Source:</dt>
|
|
109918
109941
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
109919
|
-
<a href="u8arr2obj.mjs.html">u8arr2obj.mjs</a>, <a href="u8arr2obj.mjs.html#
|
|
109942
|
+
<a href="u8arr2obj.mjs.html">u8arr2obj.mjs</a>, <a href="u8arr2obj.mjs.html#line99">line 99</a>
|
|
109920
109943
|
</li></ul></dd>
|
|
109921
109944
|
|
|
109922
109945
|
|
|
@@ -109963,7 +109986,7 @@ console.log(u8arr2bs('abc', { returnWithStateAndMsg: true }))
|
|
|
109963
109986
|
|
|
109964
109987
|
<h5 class="h5-examples">Example</h5>
|
|
109965
109988
|
|
|
109966
|
-
<pre class="prettyprint"><code>let u8a = new Uint8Array([
|
|
109967
109989
|
64, 24, 0, 0, 0, 0, 0, 0, 91, 54, 54, 44,
|
|
109968
109990
|
51, 93, 123, 34, 97, 34, 58, 91, 49, 50, 51, 44,
|
|
109969
109991
|
52, 53, 46, 54, 55, 44, 34, 116, 101, 115, 116, 228,
|
|
109970
109992
|
184, 173, 230, 150, 135, 34, 93, 44, 34, 98, 34, 58,
|
|
109971
109993
|
123, 34, 99, 34, 58, 34, 91, 66, 108, 97, 122, 101,
|
|
109972
109994
|
70, 111, 114, 85, 105, 110, 116, 56, 65, 114, 114, 97,
|
|
109973
109995
|
121, 93, 58, 58, 48, 34, 125, 125, 66, 97, 115
|
|
109996
|
+
<pre class="prettyprint"><code>let u8a = new Uint8Array([
|
|
109974
109997
|
64, 24, 0, 0, 0, 0, 0, 0, 91, 54, 54, 44,
|
|
109975
109998
|
51, 93, 123, 34, 97, 34, 58, 91, 49, 50, 51, 44,
|
|
109976
109999
|
52, 53, 46, 54, 55, 44, 34, 116, 101, 115, 116, 228,
|
|
109977
110000
|
184, 173, 230, 150, 135, 34, 93, 44, 34, 98, 34, 58,
|
|
109978
110001
|
123, 34, 99, 34, 58, 34, 91, 66, 108, 97, 122, 101,
|
|
109979
110002
|
70, 111, 114, 85, 105, 110, 116, 56, 65, 114, 114, 97,
|
|
109980
110003
|
121, 93, 58, 58, 48, 34, 125, 125, 66, 97, 115
|
|
109981
110004
|
|
|
109982
110005
|
|
|
109983
110006
|
|
|
@@ -110162,7 +110185,7 @@ console.log(u8arr2bs('abc', { returnWithStateAndMsg: true }))
|
|
|
110162
110185
|
|
|
110163
110186
|
|
|
110164
110187
|
<div class="param-desc">
|
|
110165
|
-
<p>回傳物件或陣列資料,其內二進位數據依標記所記之原型別還原,Uint8Array、Uint16Array、ArrayBuffer皆原型別原數值返回;輸入非Uint8Array
|
|
110188
|
+
<p>回傳物件或陣列資料,其內二進位數據依標記所記之原型別還原,Uint8Array、Uint16Array、ArrayBuffer皆原型別原數值返回;輸入非Uint8Array或封包損毀時回傳空物件,封包標頭記載之分塊資訊區長度非非負整數或逾封包資料區長度(含封包短於8位元組)、分塊資訊非真陣列、含非負有限整數以外之項、總量逾封包長度、或分塊數量逾主區塊可容納之二進位標記數(每個分塊在主區塊內至少有一個25位元組之標記)亦視為損毀(msg為'invalid pks, <原因>');同一二進位索引被引用多次亦視為損毀;若opt.returnWithStateAndMsg為true則回傳{ state, msg }物件</p>
|
|
110166
110189
|
</div>
|
|
110167
110190
|
|
|
110168
110191
|
|
|
@@ -111455,7 +111478,7 @@ console.log(u8arr2u16arr('abc', { returnWithStateAndMsg: true }))
|
|
|
111455
111478
|
<br class="clear">
|
|
111456
111479
|
|
|
111457
111480
|
<footer>
|
|
111458
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
111481
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Tue Oct 20 2026 10:52:09 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
111459
111482
|
</footer>
|
|
111460
111483
|
|
|
111461
111484
|
<script>prettyPrint();</script>
|
package/package.json
CHANGED
package/src/clearXSS.mjs
CHANGED
|
@@ -1,10 +1,96 @@
|
|
|
1
|
-
import
|
|
2
|
-
import isarr from './isarr.mjs'
|
|
3
|
-
import isobj from './isobj.mjs'
|
|
1
|
+
import cloneDeepWith from 'lodash-es/cloneDeepWith.js'
|
|
4
2
|
import isestr from './isestr.mjs'
|
|
5
3
|
import fxss from './_filterXSS.mjs'
|
|
6
4
|
|
|
7
5
|
|
|
6
|
+
//內部標籤(Object.prototype.toString)與判準同isobj、isarr, 此處每個物件只取一次(標籤可為存取器), 另需判別arguments與Map、Set
|
|
7
|
+
let toStr = Object.prototype.toString
|
|
8
|
+
let hasOwn = Object.prototype.hasOwnProperty
|
|
9
|
+
let isEnum = Object.prototype.propertyIsEnumerable
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
//Skip, lodash淺複製時置換物件值之佔位, 內存原值, 由主迴圈改為走訪結果
|
|
13
|
+
class Skip {
|
|
14
|
+
constructor(v) {
|
|
15
|
+
this.v = v
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
//ownKeysEnum, 自有可列舉之字串鍵與Symbol鍵(同lodash cloneDeep複製之鍵), length視為一般鍵
|
|
21
|
+
function ownKeysEnum(o) {
|
|
22
|
+
let ks = Object.keys(o)
|
|
23
|
+
let ss = Object.getOwnPropertySymbols(o)
|
|
24
|
+
if (ss.length > 0) {
|
|
25
|
+
for (let s of ss) {
|
|
26
|
+
if (isEnum.call(o, s)) {
|
|
27
|
+
ks.push(s)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return ks
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
//newObj, 同lodash initCloneObject: constructor為函數且本身非原型物件者沿用原型, 否則為一般物件(null原型物件、constructor鍵非函數者變一般物件)
|
|
36
|
+
function newObj(v) {
|
|
37
|
+
let c = v.constructor
|
|
38
|
+
if (typeof c !== 'function') {
|
|
39
|
+
return {}
|
|
40
|
+
}
|
|
41
|
+
let p = Object.getPrototypeOf(v)
|
|
42
|
+
if (p === Object.prototype) {
|
|
43
|
+
return {} //與Object.create(Object.prototype)等價, v本身為其建構子之prototype時lodash亦得{}
|
|
44
|
+
}
|
|
45
|
+
if (v === (c.prototype || Object.prototype)) {
|
|
46
|
+
return {}
|
|
47
|
+
}
|
|
48
|
+
return (p !== null && (typeof p === 'object' || typeof p === 'function')) ? Object.create(p) : {}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
//setKey, __proto__鍵以defineProperty設為自有資料屬性(一般賦值會改原型)
|
|
53
|
+
function setKey(o, k, val) {
|
|
54
|
+
if (k === '__proto__') {
|
|
55
|
+
Object.defineProperty(o, k, { configurable: true, enumerable: true, value: val, writable: true })
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
o[k] = val
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
//isBoxedString, 以內部槽確認為包裝String(以Symbol.toStringTag偽稱String者無內部槽, 交由lodash複製後依終態處理)
|
|
64
|
+
function isBoxedString(v) {
|
|
65
|
+
try {
|
|
66
|
+
String.prototype.valueOf.call(v)
|
|
67
|
+
return true
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
return false
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
//brandOf, 以內部槽確認Map或Set(含跨realm者, 如iframe、vm; instanceof不成立), 僅偽造標籤或原型者不算; 先試tag或instanceof所指者
|
|
76
|
+
function brandOf(v, tag) {
|
|
77
|
+
let setFirst = tag === '[object Set]' || v instanceof Set
|
|
78
|
+
for (let b of setFirst ? ['set', 'map'] : ['map', 'set']) {
|
|
79
|
+
try {
|
|
80
|
+
if (b === 'map') {
|
|
81
|
+
Map.prototype.has.call(v)
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
Set.prototype.has.call(v)
|
|
85
|
+
}
|
|
86
|
+
return b
|
|
87
|
+
}
|
|
88
|
+
catch (err) {}
|
|
89
|
+
}
|
|
90
|
+
return ''
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
8
94
|
/**
|
|
9
95
|
* 清除xss攻擊語法
|
|
10
96
|
*
|
|
@@ -14,12 +100,26 @@ import fxss from './_filterXSS.mjs'
|
|
|
14
100
|
*
|
|
15
101
|
* 輸出僅供以HTML內文呈現(如v-html、innerHTML),不可放入屬性值或註解內
|
|
16
102
|
*
|
|
17
|
-
*
|
|
103
|
+
* 走訪採顯式堆疊並以來源物件之參照記憶化,不遞迴:深巢狀與循環參照不拋錯(循環保持),共用子結構只處理一次且輸出中保持共用,成本與節點數成正比,不設深度上限(僅受堆積限制)。處置如下:
|
|
104
|
+
*
|
|
105
|
+
* 1. 字串清除(含包裝String,清除後為原始字串);空字串與number、boolean、null、undefined等非字串原值回傳
|
|
106
|
+
*
|
|
107
|
+
* 2. 物件(含類別實例)與真陣列(含子類別)走訪並保留原型(null原型物件變一般物件),length視為一般鍵(不使走訪改為類陣列,不新增鍵),成本與length值無關;物件依自有可列舉之字串鍵與Symbol鍵,陣列依索引(空洞補undefined,非索引屬性不複製,正規表示式比對結果之index與input除外,其input亦清除);Map走訪值、Set走訪元素(Map之鍵不處理,清除後相同之Set元素合併),Map與Set之自有可列舉屬性一併走訪;不可列舉屬性不複製,原型上之資料不處理
|
|
108
|
+
*
|
|
109
|
+
* 3. 物件之字串鍵與Map之鍵不清除,由使用端自行檢核
|
|
110
|
+
*
|
|
111
|
+
* 4. arguments物件與以Symbol.toStringTag偽稱Array或Arguments之物件,視為物件並依自有可列舉鍵走訪,轉為一般物件
|
|
112
|
+
*
|
|
113
|
+
* 5. Date、RegExp、型別陣列、Buffer、ArrayBuffer、包裝Number等回傳複本,其自有字串屬性不清除(物件值屬性依上述走訪);函數、Error、WeakMap、Promise、URL等不可複製者,巢狀時回傳同一參照而不清除其內字串,位於最外層時函數複製為一般物件(清除其可列舉屬性)、Error等回傳{};其餘經lodash cloneDeep複製後仍帶自訂Symbol.toStringTag之物件亦不清除其內字串
|
|
114
|
+
*
|
|
115
|
+
* 6. 經lodash cloneDeep複製之物件(上述第4、5點以外之非一般物件,如類別實例、null原型物件、陣列子類別、自訂標籤者)沿用其複製行為(含原型上之setter),再依複本之終態逐鍵清除;除此之外輸入不被修改
|
|
116
|
+
*
|
|
117
|
+
* 7. 清除對字串不保證冪等(如<b='<<>清一次與清兩次結果不同),已清除之值再送入可能再被改寫
|
|
18
118
|
*
|
|
19
119
|
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/clearXSS.test.mjs Github}
|
|
20
120
|
* @memberOf wsemi
|
|
21
|
-
* @param {String|Object|Array} inp
|
|
22
|
-
* @returns {Object|Array|String}
|
|
121
|
+
* @param {String|Object|Array} inp 輸入資料,可為字串,或含字串之物件、陣列、Map、Set
|
|
122
|
+
* @returns {Object|Array|String} 輸出資料,字串輸入回傳清除後字串,其餘回傳清除後之新結構(原始值原樣回傳)
|
|
23
123
|
* @example
|
|
24
124
|
*
|
|
25
125
|
* console.log(clearXSS(`><script>alert('XSS')</script>`))
|
|
@@ -31,6 +131,9 @@ import fxss from './_filterXSS.mjs'
|
|
|
31
131
|
* console.log(clearXSS(`孔深 < 500 m 且 > 10 m`))
|
|
32
132
|
* // => `孔深 < 500 m 且 > 10 m`
|
|
33
133
|
*
|
|
134
|
+
* console.log(clearXSS({ a: `<script>alert('XSS')</script>`, b: [1, `<b>x</b>`, { c: `<img src=x onerror=alert(1)>` }], d: new Map([['k', `<script>1</script>`]]) }))
|
|
135
|
+
* // => { a: "<script>alert('XSS')</script>", b: [ 1, '<b>x</b>', { c: '<img src>' } ], d: Map(1) { 'k' => '<script>1</script>' } }
|
|
136
|
+
*
|
|
34
137
|
*/
|
|
35
138
|
function clearXSS(inp) {
|
|
36
139
|
|
|
@@ -47,33 +150,168 @@ function clearXSS(inp) {
|
|
|
47
150
|
return filterXSS(c, opt)
|
|
48
151
|
}
|
|
49
152
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
153
|
+
//根為原始值(含字串)時不配置記憶化表與工作框
|
|
154
|
+
if (typeof inp === 'string') {
|
|
155
|
+
return isestr(inp) ? ftxss(inp) : inp
|
|
156
|
+
}
|
|
157
|
+
if (inp === null || (typeof inp !== 'object' && typeof inp !== 'function')) {
|
|
158
|
+
return inp
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
//memo, 來源物件 -> 輸出物件(包裝String為清除後之字串), 使共用子結構只處理一次且輸出保持共用, 循環參照得以終止
|
|
162
|
+
let memo = new Map()
|
|
163
|
+
|
|
164
|
+
//stack, 工作框: t為型式, s為來源, d為輸出, ks為鍵陣列, es為條目/元素/物件值屬性, i為已處理數, n為總數
|
|
165
|
+
// t=0 陣列(索引, 輸出為新陣列) t=1 一般物件(鍵, 輸出為新物件) t=2 偽稱Array/Arguments之物件(鍵, 以defineProperty定義)
|
|
166
|
+
// t=3 lodash複本之終態(輸出即複本, 逐項清除; ks為null時依索引) t=4 Map條目 t=5 Set元素 t=6 複本之物件值屬性(es為[鍵, 值])
|
|
167
|
+
let stack = []
|
|
168
|
+
|
|
169
|
+
//skipClone, lodash淺複製: v之物件值(含函數)置換為Skip, 其餘(原始值、型別陣列元素等)照常複製; 回傳複本與被置換之[鍵, 值]
|
|
170
|
+
// 不可複製者(函數、Error、WeakMap、Promise等)回傳同一參照
|
|
171
|
+
function skipClone(v) {
|
|
172
|
+
let rec = []
|
|
173
|
+
let r = cloneDeepWith({ v }, (val, key, obj) => {
|
|
174
|
+
if (obj === v && val !== null && (typeof val === 'object' || typeof val === 'function')) {
|
|
175
|
+
rec.push([key, val])
|
|
176
|
+
return new Skip(val)
|
|
56
177
|
}
|
|
57
|
-
|
|
178
|
+
}).v
|
|
179
|
+
return { r, rec }
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//slow, 其餘物件(類別實例、null原型、陣列子類別、跨realm物件、Date、RegExp、型別陣列、自訂標籤者等)沿用lodash cloneDeep之行為
|
|
183
|
+
// 複製後成為一般物件或陣列者, 依複本之終態逐鍵清除(同修前先複製後走訪, 含原型setter產生之鍵與陣列建構子新增之索引); 其餘為複本, 其物件值屬性改由主迴圈走訪
|
|
184
|
+
function slow(v, isRoot) {
|
|
185
|
+
let { r, rec } = skipClone(v)
|
|
186
|
+
if (r === v) {
|
|
187
|
+
return isRoot ? {} : v //不可複製者: 巢狀回同一參照, 最外層回{}
|
|
58
188
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
189
|
+
memo.set(v, r)
|
|
190
|
+
if (Array.isArray(r)) {
|
|
191
|
+
if (hasOwn.call(r, 'index') && typeof r.input === 'string') {
|
|
192
|
+
r.input = ftxss(r.input) //正規表示式比對結果, lodash複製index與input
|
|
62
193
|
}
|
|
63
|
-
|
|
194
|
+
stack.push({ t: 3, s: null, d: r, ks: null, es: null, i: 0, n: r.length })
|
|
64
195
|
}
|
|
65
|
-
else if (
|
|
66
|
-
|
|
196
|
+
else if (toStr.call(r) === '[object Object]') {
|
|
197
|
+
let ks = ownKeysEnum(r)
|
|
198
|
+
stack.push({ t: 3, s: null, d: r, ks, es: null, i: 0, n: ks.length })
|
|
67
199
|
}
|
|
68
|
-
else {
|
|
69
|
-
|
|
200
|
+
else if (rec.length > 0) {
|
|
201
|
+
stack.push({ t: 6, s: null, d: r, ks: null, es: rec, i: 0, n: rec.length })
|
|
202
|
+
}
|
|
203
|
+
return r
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
//conv, 回傳v對應之輸出值; 容器先建立輸出並登記於memo後入工作框, 其內容由主迴圈填入
|
|
207
|
+
function conv(v, isRoot) {
|
|
208
|
+
if (typeof v === 'string') {
|
|
209
|
+
return isestr(v) ? ftxss(v) : v
|
|
210
|
+
}
|
|
211
|
+
if (v === null || typeof v !== 'object') {
|
|
212
|
+
if (isRoot === true && typeof v === 'function') { //最外層函數複製為一般物件並走訪其可列舉屬性(同lodash cloneDeep之頂層語意)
|
|
213
|
+
let d = {}
|
|
214
|
+
memo.set(v, d)
|
|
215
|
+
let ks = ownKeysEnum(v)
|
|
216
|
+
stack.push({ t: 1, s: v, d, ks, es: null, i: 0, n: ks.length })
|
|
217
|
+
return d
|
|
218
|
+
}
|
|
219
|
+
return v
|
|
220
|
+
}
|
|
221
|
+
let h = memo.get(v)
|
|
222
|
+
if (h !== undefined) {
|
|
223
|
+
return h
|
|
70
224
|
}
|
|
225
|
+
if (Array.isArray(v)) {
|
|
226
|
+
if (Object.getPrototypeOf(v) !== Array.prototype) {
|
|
227
|
+
return slow(v, isRoot) //陣列子類別、跨realm陣列
|
|
228
|
+
}
|
|
229
|
+
let n = v.length
|
|
230
|
+
let d = new Array(n)
|
|
231
|
+
memo.set(v, d)
|
|
232
|
+
if (n > 0 && typeof v[0] === 'string' && hasOwn.call(v, 'index')) {
|
|
233
|
+
d.index = v.index //正規表示式比對結果, 同lodash initCloneArray
|
|
234
|
+
d.input = conv(v.input)
|
|
235
|
+
}
|
|
236
|
+
stack.push({ t: 0, s: v, d, ks: null, es: null, i: 0, n })
|
|
237
|
+
return d
|
|
238
|
+
}
|
|
239
|
+
let tag = toStr.call(v)
|
|
240
|
+
if (tag === '[object Object]' && Object.getPrototypeOf(v) === Object.prototype) {
|
|
241
|
+
let d = {}
|
|
242
|
+
memo.set(v, d)
|
|
243
|
+
let ks = ownKeysEnum(v)
|
|
244
|
+
stack.push({ t: 1, s: v, d, ks, es: null, i: 0, n: ks.length })
|
|
245
|
+
return d
|
|
246
|
+
}
|
|
247
|
+
if (tag === '[object String]' && isBoxedString(v) && isestr(v)) {
|
|
248
|
+
let r = ftxss(v) //包裝String, 清除後為原始字串
|
|
249
|
+
memo.set(v, r)
|
|
250
|
+
return r
|
|
251
|
+
}
|
|
252
|
+
let brand = (tag === '[object Map]' || tag === '[object Set]' || v instanceof Map || v instanceof Set) ? brandOf(v, tag) : ''
|
|
253
|
+
if (brand !== '') {
|
|
254
|
+
let Ctor = v.constructor
|
|
255
|
+
let d = typeof Ctor === 'function' ? new Ctor() : (brand === 'map' ? new Map() : new Set())
|
|
256
|
+
memo.set(v, d)
|
|
257
|
+
let ks = ownKeysEnum(v)
|
|
258
|
+
if (ks.length > 0) {
|
|
259
|
+
stack.push({ t: 1, s: v, d, ks, es: null, i: 0, n: ks.length }) //自有可列舉屬性(後處理)
|
|
260
|
+
}
|
|
261
|
+
let es = brand === 'map' ? [...Map.prototype.entries.call(v)] : [...Set.prototype.values.call(v)]
|
|
262
|
+
stack.push({ t: brand === 'map' ? 4 : 5, s: null, d, ks: null, es, i: 0, n: es.length })
|
|
263
|
+
return d
|
|
264
|
+
}
|
|
265
|
+
if (tag === '[object Arguments]' || tag === '[object Array]') { //arguments物件與偽稱Array/Arguments者(lodash對不可寫偽標籤會丟失鍵或拋錯), 視為物件
|
|
266
|
+
let d = newObj(v)
|
|
267
|
+
memo.set(v, d)
|
|
268
|
+
let ks = ownKeysEnum(v)
|
|
269
|
+
stack.push({ t: 2, s: v, d, ks, es: null, i: 0, n: ks.length })
|
|
270
|
+
return d
|
|
271
|
+
}
|
|
272
|
+
return slow(v, isRoot)
|
|
71
273
|
}
|
|
72
274
|
|
|
73
|
-
|
|
74
|
-
|
|
275
|
+
let out = conv(inp, true)
|
|
276
|
+
|
|
277
|
+
//主迴圈, 取頂框逐一處理子項(深度優先前序, 字串清除順序同遞迴)
|
|
278
|
+
while (stack.length > 0) {
|
|
279
|
+
let f = stack[stack.length - 1]
|
|
280
|
+
if (f.i >= f.n) {
|
|
281
|
+
stack.pop()
|
|
282
|
+
continue
|
|
283
|
+
}
|
|
284
|
+
let i = f.i++
|
|
285
|
+
if (f.t === 1) {
|
|
286
|
+
let k = f.ks[i]
|
|
287
|
+
setKey(f.d, k, conv(f.s[k]))
|
|
288
|
+
}
|
|
289
|
+
else if (f.t === 0) {
|
|
290
|
+
f.d[i] = conv(f.s[i])
|
|
291
|
+
}
|
|
292
|
+
else if (f.t === 3) {
|
|
293
|
+
let k = f.ks === null ? i : f.ks[i]
|
|
294
|
+
let val = f.d[k]
|
|
295
|
+
f.d[k] = conv(val instanceof Skip ? val.v : val)
|
|
296
|
+
}
|
|
297
|
+
else if (f.t === 4) {
|
|
298
|
+
let e = f.es[i]
|
|
299
|
+
f.d.set(e[0], conv(e[1])) //Map之鍵不處理
|
|
300
|
+
}
|
|
301
|
+
else if (f.t === 5) {
|
|
302
|
+
f.d.add(conv(f.es[i]))
|
|
303
|
+
}
|
|
304
|
+
else if (f.t === 6) {
|
|
305
|
+
let e = f.es[i]
|
|
306
|
+
f.d[e[0]] = conv(e[1])
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
let k = f.ks[i]
|
|
310
|
+
Object.defineProperty(f.d, k, { configurable: true, enumerable: true, value: conv(f.s[k]), writable: true })
|
|
311
|
+
}
|
|
312
|
+
}
|
|
75
313
|
|
|
76
|
-
return
|
|
314
|
+
return out
|
|
77
315
|
}
|
|
78
316
|
|
|
79
317
|
|
package/src/flattenToConn.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import treeObj from './treeObj.mjs'
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 展平物件或陣列成為關聯陣列,真陣列(含帶其他Symbol.toStringTag者)依索引,物件依自有鍵(length視為一般鍵),以Symbol.toStringTag偽稱Array之物件視為物件
|
|
21
21
|
*
|
|
22
22
|
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/flattenToConn.test.mjs Github}
|
|
23
23
|
* @memberOf wsemi
|
|
@@ -688,12 +688,16 @@ function flattenToConn(data, opt = {}) {
|
|
|
688
688
|
//idParent
|
|
689
689
|
let idParent = genId(nk, null)
|
|
690
690
|
|
|
691
|
+
//isArr, isObj, 真陣列依索引; 以Symbol.toStringTag偽稱Array之物件(isarr為真而非真陣列)視為物件, 不依其length迭代(R-OBJ-ITER-01)
|
|
692
|
+
let isArr = Array.isArray(value)
|
|
693
|
+
let isObj = !isArr && (isobj(value) || isarr(value))
|
|
694
|
+
|
|
691
695
|
//type
|
|
692
696
|
let type = 'node'
|
|
693
|
-
if (
|
|
697
|
+
if (isObj) {
|
|
694
698
|
type = 'object'
|
|
695
699
|
}
|
|
696
|
-
else if (
|
|
700
|
+
else if (isArr) {
|
|
697
701
|
type = 'array'
|
|
698
702
|
}
|
|
699
703
|
|
|
@@ -710,17 +714,17 @@ function flattenToConn(data, opt = {}) {
|
|
|
710
714
|
}
|
|
711
715
|
|
|
712
716
|
//bindText
|
|
713
|
-
if (!
|
|
717
|
+
if (!isObj && !isArr) {
|
|
714
718
|
node[bindText] = value
|
|
715
719
|
}
|
|
716
720
|
|
|
717
721
|
//bindNumOfChilren
|
|
718
|
-
if (
|
|
722
|
+
if (isObj || isArr) {
|
|
719
723
|
let numOfChilren = null
|
|
720
|
-
if (
|
|
724
|
+
if (isObj) {
|
|
721
725
|
numOfChilren = size(keys(value))
|
|
722
726
|
}
|
|
723
|
-
else
|
|
727
|
+
else {
|
|
724
728
|
numOfChilren = size(value)
|
|
725
729
|
}
|
|
726
730
|
node[bindNumOfChilren] = numOfChilren
|
package/src/flattenTree.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import get from 'lodash-es/get.js'
|
|
2
|
-
import size from 'lodash-es/size.js'
|
|
1
|
+
import get from 'lodash-es/get.js'
|
|
2
|
+
import size from 'lodash-es/size.js'
|
|
3
3
|
import treeObj from './treeObj.mjs'
|
|
4
4
|
import isestr from './isestr.mjs'
|
|
5
5
|
import isarr from './isarr.mjs'
|
|
@@ -8,7 +8,7 @@ import isobj0 from './isobj0.mjs'
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* 展平樹狀物件或陣列,以Symbol.toStringTag偽稱Array之物件視為物件
|
|
12
12
|
*
|
|
13
13
|
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/flattenTree.test.mjs Github}
|
|
14
14
|
* @memberOf wsemi
|
|
@@ -74,14 +74,14 @@ import isobj0 from './isobj0.mjs'
|
|
|
74
74
|
*/
|
|
75
75
|
function flattenTree(data, opt = {}) {
|
|
76
76
|
|
|
77
|
-
//check
|
|
78
|
-
if (
|
|
77
|
+
//check, 真陣列依索引; 以Symbol.toStringTag偽稱Array之物件(isarr為真而非真陣列)視為物件, 不依其length迭代(R-OBJ-ITER-01)
|
|
78
|
+
if (Array.isArray(data)) {
|
|
79
79
|
if (data.length === 0) {
|
|
80
80
|
return []
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
else if (isobj(data)) {
|
|
84
|
-
if (isobj0(data)) {
|
|
83
|
+
else if (isobj(data) || isarr(data)) {
|
|
84
|
+
if (isobj(data) ? isobj0(data) : Object.keys(data).length === 0) { //偽稱Array之物件(isobj為假)以自有鍵數判定空物件
|
|
85
85
|
return []
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -103,7 +103,7 @@ function flattenTree(data, opt = {}) {
|
|
|
103
103
|
|
|
104
104
|
//data
|
|
105
105
|
let toArr = false
|
|
106
|
-
if (
|
|
106
|
+
if (!Array.isArray(data)) {
|
|
107
107
|
toArr = true
|
|
108
108
|
data = [data]
|
|
109
109
|
}
|
package/src/fsTask.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import fs from 'fs'
|
|
2
2
|
import get from 'lodash-es/get.js'
|
|
3
3
|
import each from 'lodash-es/each.js'
|
|
4
|
-
import map from 'lodash-es/map.js'
|
|
5
4
|
import cloneDeep from 'lodash-es/cloneDeep.js'
|
|
6
|
-
import cst from './_const.mjs'
|
|
5
|
+
import cst from './_const.mjs'
|
|
7
6
|
import evem from './evem.mjs'
|
|
8
7
|
import evEmit from './evEmit.mjs'
|
|
9
8
|
import genPm from './genPm.mjs'
|
|
10
9
|
import isestr from './isestr.mjs'
|
|
11
10
|
import ispint from './ispint.mjs'
|
|
12
11
|
import isarr from './isarr.mjs'
|
|
12
|
+
import isobj from './isobj.mjs'
|
|
13
13
|
import ispnum from './ispnum.mjs'
|
|
14
14
|
import cint from './cint.mjs'
|
|
15
15
|
import j2o from './j2o.mjs'
|
|
@@ -216,7 +216,7 @@ function fsTask(fd, opt = {}) {
|
|
|
216
216
|
if (!ispnum(timeInterval)) {
|
|
217
217
|
timeInterval = 60 * 1000 //1min
|
|
218
218
|
}
|
|
219
|
-
timeInterval = cint(timeInterval)
|
|
219
|
+
timeInterval = cint(timeInterval)
|
|
220
220
|
timeInterval = Math.min(timeInterval, cst.TIMER_TIME_MAX) //夾至計時器上限, 見_const.mjs
|
|
221
221
|
|
|
222
222
|
//fsCreateFolder
|
|
@@ -241,7 +241,7 @@ function fsTask(fd, opt = {}) {
|
|
|
241
241
|
r = j2o(j)
|
|
242
242
|
}
|
|
243
243
|
catch (err) {}
|
|
244
|
-
return r
|
|
244
|
+
return isobj(r) ? r : {} //檔案來源, 可能被竄改或損毀, 非一般物件(陣列、字串、數字、null、布林)視為無紀錄(R-OBJ-ITER-01)
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
//writeObHash
|
|
@@ -293,15 +293,15 @@ function fsTask(fd, opt = {}) {
|
|
|
293
293
|
let kpHashNew = await calcHash()
|
|
294
294
|
// console.log('kpHashNew', kpHashNew)
|
|
295
295
|
|
|
296
|
-
//hsOld
|
|
297
|
-
let hsOld =
|
|
298
|
-
return { path, hash }
|
|
296
|
+
//hsOld, 紀錄檔為檔案來源, 只依自有可列舉鍵迭代(length視為一般鍵; lodash map會把含非負整數length之物件當類陣列, R-OBJ-ITER-01)
|
|
297
|
+
let hsOld = Object.keys(kpHashsOld).map((path) => {
|
|
298
|
+
return { path, hash: kpHashsOld[path] }
|
|
299
299
|
})
|
|
300
300
|
// console.log('hsOld', hsOld)
|
|
301
301
|
|
|
302
302
|
//hsNew
|
|
303
|
-
let hsNew =
|
|
304
|
-
return { path, hash }
|
|
303
|
+
let hsNew = Object.keys(kpHashNew).map((path) => {
|
|
304
|
+
return { path, hash: kpHashNew[path] }
|
|
305
305
|
})
|
|
306
306
|
// console.log('hsNew', hsNew)
|
|
307
307
|
|
|
@@ -511,7 +511,7 @@ function fsTask(fd, opt = {}) {
|
|
|
511
511
|
r = j2o(j)
|
|
512
512
|
}
|
|
513
513
|
catch (err) {}
|
|
514
|
-
return r
|
|
514
|
+
return isobj(r) ? r : {} //檔案來源, 非一般物件視為無紀錄(R-OBJ-ITER-01)
|
|
515
515
|
}
|
|
516
516
|
|
|
517
517
|
//writeObResult
|
|
@@ -548,14 +548,15 @@ function fsTask(fd, opt = {}) {
|
|
|
548
548
|
//eliminateObResult
|
|
549
549
|
let eliminateObResult = (kpResult, fp) => {
|
|
550
550
|
let kp = {}
|
|
551
|
-
|
|
551
|
+
for (let key of Object.keys(kpResult)) { //紀錄檔為檔案來源, 只依自有可列舉鍵迭代(R-OBJ-ITER-01)
|
|
552
|
+
let rs = kpResult[key]
|
|
552
553
|
let s = sep(key, '|')
|
|
553
554
|
let _fp = get(s, 0, '')
|
|
554
555
|
// let _hash = get(s, 1, '')
|
|
555
556
|
if (_fp !== fp) {
|
|
556
557
|
kp[key] = rs
|
|
557
558
|
}
|
|
558
|
-
}
|
|
559
|
+
}
|
|
559
560
|
return kp
|
|
560
561
|
}
|
|
561
562
|
|