wsemi 1.9.12 → 1.9.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.
- package/README.md +1 -1
- package/dist/wsemi.umd.js +5 -5
- 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/-_optNum.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 +9 -2
- package/docs/clearXSSDyn.mjs.html +5 -3
- 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/detectXSS.mjs.html +17 -3
- 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 +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 +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 +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 +112 -9
- package/package.json +1 -1
- package/src/_filterXSS.mjs +16 -1
- package/src/clearXSS.mjs +8 -1
- package/src/clearXSSDyn.mjs +4 -2
- package/src/detectXSS.mjs +16 -2
- package/test/_filterXSS.test.mjs +18 -0
- package/test/clearXSS.test.mjs +148 -6
- package/test/detectXSS.test.mjs +10 -0
- 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/urlParse.mjs.html
CHANGED
|
@@ -111,7 +111,7 @@ export default urlParse
|
|
|
111
111
|
<br class="clear">
|
|
112
112
|
|
|
113
113
|
<footer>
|
|
114
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
114
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Oct 12 2026 12:18:17 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
115
115
|
</footer>
|
|
116
116
|
|
|
117
117
|
<script>prettyPrint();</script>
|
|
@@ -224,7 +224,7 @@ export default verifyValue
|
|
|
224
224
|
<br class="clear">
|
|
225
225
|
|
|
226
226
|
<footer>
|
|
227
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
227
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Oct 12 2026 12:18:17 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
228
228
|
</footer>
|
|
229
229
|
|
|
230
230
|
<script>prettyPrint();</script>
|
package/docs/waitFun.mjs.html
CHANGED
|
@@ -215,7 +215,7 @@ export default waitFun
|
|
|
215
215
|
<br class="clear">
|
|
216
216
|
|
|
217
217
|
<footer>
|
|
218
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
218
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Oct 12 2026 12:18:17 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
219
219
|
</footer>
|
|
220
220
|
|
|
221
221
|
<script>prettyPrint();</script>
|
package/docs/wsemi.html
CHANGED
|
@@ -15465,13 +15465,15 @@ await test3()
|
|
|
15465
15465
|
<dt class="tag-description">Description:</dt>
|
|
15466
15466
|
<dd class="tag-description"><ul class="dummy"><li><p>清除xss攻擊語法</p>
|
|
15467
15467
|
<p>Depend on: <a href="https://jsxss.com/zh/index.html">https://jsxss.com/zh/index.html</a></p>
|
|
15468
|
+
<p>白名單外之標籤轉義,白名單內之標籤刪除白名單外之屬性與危險網址(style屬性保留),標籤外之文字只轉義會開始標籤之<(其後為英文字母、斜線、驚嘆號、問號或位於結尾),>與其餘之<維持原樣,故'a < b'等數學式不改寫</p>
|
|
15469
|
+
<p>輸出僅供以HTML內文呈現(如v-html、innerHTML),不可放入屬性值或註解內</p>
|
|
15468
15470
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/clearXSS.test.mjs">Github</a></p></li></ul></dd>
|
|
15469
15471
|
|
|
15470
15472
|
|
|
15471
15473
|
|
|
15472
15474
|
<dt class="tag-source">Source:</dt>
|
|
15473
15475
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
15474
|
-
<a href="clearXSS.mjs.html">clearXSS.mjs</a>, <a href="clearXSS.mjs.html#
|
|
15476
|
+
<a href="clearXSS.mjs.html">clearXSS.mjs</a>, <a href="clearXSS.mjs.html#line34">line 34</a>
|
|
15475
15477
|
</li></ul></dd>
|
|
15476
15478
|
|
|
15477
15479
|
|
|
@@ -15518,7 +15520,7 @@ await test3()
|
|
|
15518
15520
|
|
|
15519
15521
|
<h5 class="h5-examples">Example</h5>
|
|
15520
15522
|
|
|
15521
|
-
<pre class="prettyprint"><code>console.log(clearXSS(`><script>alert('XSS')</script>`))
|
|
15523
|
+
<pre class="prettyprint"><code>console.log(clearXSS(`><script>alert('XSS')</script>`))
|
|
15522
15524
|
|
|
15523
15525
|
|
|
15524
15526
|
|
|
@@ -15630,7 +15632,7 @@ await test3()
|
|
|
15630
15632
|
|
|
15631
15633
|
|
|
15632
15634
|
|
|
15633
|
-
<h4 class="name" id=".clearXSSDyn"><span class="type-signature type-signature-async, static">(async, static) </span>clearXSSDyn<span class="signature">(inp)</span><span class="type-signature"> → {Promise}</span></h4>
|
|
15635
|
+
<h4 class="name" id=".clearXSSDyn"><span class="type-signature type-signature-async, static">(async, static) </span>clearXSSDyn<span class="signature">(inp, opt<span class="signature-attributes">opt</span>, pathItems)</span><span class="type-signature"> → {Promise}</span></h4>
|
|
15634
15636
|
|
|
15635
15637
|
|
|
15636
15638
|
|
|
@@ -15640,7 +15642,7 @@ await test3()
|
|
|
15640
15642
|
<dl class="details">
|
|
15641
15643
|
|
|
15642
15644
|
<dt class="tag-description">Description:</dt>
|
|
15643
|
-
<dd class="tag-description"><ul class="dummy"><li><p>清除xss
|
|
15645
|
+
<dd class="tag-description"><ul class="dummy"><li><p>清除xss攻擊語法,採用動態加載技術,處理規則同clearXSS</p>
|
|
15644
15646
|
<p>Depend on: <a href="https://jsxss.com/zh/index.html">https://jsxss.com/zh/index.html</a></p>
|
|
15645
15647
|
<p>Unit Test: <a href="https://github.com/yuda-lyu/wsemi/blob/master/test/clearXSSDyn.test.mjs">Github</a></p></li></ul></dd>
|
|
15646
15648
|
|
|
@@ -15648,7 +15650,7 @@ await test3()
|
|
|
15648
15650
|
|
|
15649
15651
|
<dt class="tag-source">Source:</dt>
|
|
15650
15652
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
15651
|
-
<a href="clearXSSDyn.mjs.html">clearXSSDyn.mjs</a>, <a href="clearXSSDyn.mjs.html#
|
|
15653
|
+
<a href="clearXSSDyn.mjs.html">clearXSSDyn.mjs</a>, <a href="clearXSSDyn.mjs.html#line30">line 30</a>
|
|
15652
15654
|
</li></ul></dd>
|
|
15653
15655
|
|
|
15654
15656
|
|
|
@@ -15695,7 +15697,7 @@ await test3()
|
|
|
15695
15697
|
|
|
15696
15698
|
<h5 class="h5-examples">Example</h5>
|
|
15697
15699
|
|
|
15698
|
-
<pre class="prettyprint"><code>let r
|
|
15700
|
+
<pre class="prettyprint"><code>let r
|
|
15699
15701
|
|
|
15700
15702
|
|
|
15701
15703
|
|
|
@@ -15713,8 +15715,12 @@ await test3()
|
|
|
15713
15715
|
<th>Type</th>
|
|
15714
15716
|
|
|
15715
15717
|
|
|
15718
|
+
<th>Attributes</th>
|
|
15719
|
+
|
|
15716
15720
|
|
|
15717
15721
|
|
|
15722
|
+
<th>Default</th>
|
|
15723
|
+
|
|
15718
15724
|
|
|
15719
15725
|
<th class="last">Description</th>
|
|
15720
15726
|
</tr>
|
|
@@ -15745,13 +15751,107 @@ await test3()
|
|
|
15745
15751
|
</td>
|
|
15746
15752
|
|
|
15747
15753
|
|
|
15754
|
+
<td class="attributes">
|
|
15755
|
+
|
|
15748
15756
|
|
|
15757
|
+
|
|
15758
|
+
|
|
15759
|
+
|
|
15760
|
+
</td>
|
|
15761
|
+
|
|
15762
|
+
|
|
15763
|
+
|
|
15764
|
+
<td class="default">
|
|
15765
|
+
|
|
15766
|
+
</td>
|
|
15749
15767
|
|
|
15750
15768
|
|
|
15751
15769
|
<td class="description last"><p>輸入資料</p></td>
|
|
15752
15770
|
</tr>
|
|
15753
15771
|
|
|
15754
15772
|
|
|
15773
|
+
|
|
15774
|
+
<tr>
|
|
15775
|
+
|
|
15776
|
+
<td class="name"><code>opt</code></td>
|
|
15777
|
+
|
|
15778
|
+
|
|
15779
|
+
<td class="type">
|
|
15780
|
+
|
|
15781
|
+
|
|
15782
|
+
<span class="param-type">Object</span>
|
|
15783
|
+
|
|
15784
|
+
|
|
15785
|
+
|
|
15786
|
+
|
|
15787
|
+
</td>
|
|
15788
|
+
|
|
15789
|
+
|
|
15790
|
+
<td class="attributes">
|
|
15791
|
+
|
|
15792
|
+
<optional><br>
|
|
15793
|
+
|
|
15794
|
+
|
|
15795
|
+
|
|
15796
|
+
|
|
15797
|
+
|
|
15798
|
+
</td>
|
|
15799
|
+
|
|
15800
|
+
|
|
15801
|
+
|
|
15802
|
+
<td class="default">
|
|
15803
|
+
|
|
15804
|
+
<code>{}</code>
|
|
15805
|
+
|
|
15806
|
+
</td>
|
|
15807
|
+
|
|
15808
|
+
|
|
15809
|
+
<td class="description last"><p>輸入設定物件,保留簽名相容,目前不使用</p></td>
|
|
15810
|
+
</tr>
|
|
15811
|
+
|
|
15812
|
+
|
|
15813
|
+
|
|
15814
|
+
<tr>
|
|
15815
|
+
|
|
15816
|
+
<td class="name"><code>pathItems</code></td>
|
|
15817
|
+
|
|
15818
|
+
|
|
15819
|
+
<td class="type">
|
|
15820
|
+
|
|
15821
|
+
|
|
15822
|
+
<span class="param-type">String</span>
|
|
15823
|
+
|
|
|
15824
|
+
|
|
15825
|
+
<span class="param-type">Object</span>
|
|
15826
|
+
|
|
|
15827
|
+
|
|
15828
|
+
<span class="param-type">Array</span>
|
|
15829
|
+
|
|
15830
|
+
|
|
15831
|
+
|
|
15832
|
+
|
|
15833
|
+
</td>
|
|
15834
|
+
|
|
15835
|
+
|
|
15836
|
+
<td class="attributes">
|
|
15837
|
+
|
|
15838
|
+
|
|
15839
|
+
|
|
15840
|
+
|
|
15841
|
+
|
|
15842
|
+
</td>
|
|
15843
|
+
|
|
15844
|
+
|
|
15845
|
+
|
|
15846
|
+
<td class="default">
|
|
15847
|
+
|
|
15848
|
+
</td>
|
|
15849
|
+
|
|
15850
|
+
|
|
15851
|
+
<td class="description last"><p>輸入資源字串、字串陣列、物件、物件陣列</p></td>
|
|
15852
|
+
</tr>
|
|
15853
|
+
|
|
15854
|
+
|
|
15755
15855
|
</tbody>
|
|
15756
15856
|
</table>
|
|
15757
15857
|
|
|
@@ -18830,7 +18930,7 @@ console.log(wb)
|
|
|
18830
18930
|
<p>與clearXSS共用同一份js-xss設定(白名單、網址判定、白名單外之style屬性保留),判定規則:</p>
|
|
18831
18931
|
<ol>
|
|
18832
18932
|
<li>
|
|
18833
|
-
<p>標籤(type為'tag'):白名單外之標籤,名稱由原始標籤片段取得且其後須接空白、斜線、大於或結尾,故含'<svg/onload=...>',不含'孔深 < 500 m'、'5<6>4'、'<o:p>'
|
|
18933
|
+
<p>標籤(type為'tag'):白名單外之標籤,名稱由原始標籤片段取得且其後須接空白、斜線、大於或結尾,故含'<svg/onload=...>',不含'孔深 < 500 m'、'5<6>4'、'<o:p>';結尾未閉合且無屬性之白名單標籤(如'若 a<b'之'<b')亦不計</p>
|
|
18834
18934
|
</li>
|
|
18835
18935
|
<li>
|
|
18836
18936
|
<p>屬性(type為'attr'):白名單內標籤被刪除之事件屬性,名稱為on接英文字母且有值,故不含'a<b and once>c'之once</p>
|
|
@@ -18852,7 +18952,7 @@ console.log(wb)
|
|
|
18852
18952
|
|
|
18853
18953
|
<dt class="tag-source">Source:</dt>
|
|
18854
18954
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
18855
|
-
<a href="detectXSS.mjs.html">detectXSS.mjs</a>, <a href="detectXSS.mjs.html#
|
|
18955
|
+
<a href="detectXSS.mjs.html">detectXSS.mjs</a>, <a href="detectXSS.mjs.html#line95">line 95</a>
|
|
18856
18956
|
</li></ul></dd>
|
|
18857
18957
|
|
|
18858
18958
|
|
|
@@ -18917,6 +19017,9 @@ console.log(detectXSS('&lt;b&gt; 為粗體標籤'))
|
|
|
18917
19017
|
console.log(detectXSS('孔深 < 500 m 且 > 10 m'))
|
|
18918
19018
|
// => []
|
|
18919
19019
|
|
|
19020
|
+
console.log(detectXSS('若 a<b'))
|
|
19021
|
+
// => []
|
|
19022
|
+
|
|
18920
19023
|
console.log(detectXSS('a<b and once>c'))
|
|
18921
19024
|
// => []
|
|
18922
19025
|
|
|
@@ -110548,7 +110651,7 @@ console.log(u8arr2u16arr('abc', { returnWithStateAndMsg: true }))
|
|
|
110548
110651
|
<br class="clear">
|
|
110549
110652
|
|
|
110550
110653
|
<footer>
|
|
110551
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
110654
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Oct 12 2026 12:18:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
110552
110655
|
</footer>
|
|
110553
110656
|
|
|
110554
110657
|
<script>prettyPrint();</script>
|
package/package.json
CHANGED
package/src/_filterXSS.mjs
CHANGED
|
@@ -30,9 +30,24 @@ function getFilterXSS(mod = xss) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
//reTagStart, 會開始標籤之<: 依HTML規格(Tag open state), <後接英文字母、斜線、驚嘆號或問號才進入標籤、結束標籤、註解等狀態, 其餘之<為一般文字
|
|
34
|
+
//結尾之<亦轉義: 其後字元由組裝處決定, 如兩欄相鄰組進畫面時, 前一欄結尾之<會與後一欄開頭之字母拼成標籤
|
|
35
|
+
//js-xss會分段呼叫escapeHtml, 段尾之<亦視為結尾而轉義, 只多轉義不影響安全(如'a << b'為'a << b')
|
|
36
|
+
let reTagStart = /<(?=[A-Za-z!/?]|$)/g
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
//escapeHtml, 取代js-xss預設之escapeHtml(<與>全部轉義), 只轉義會開始標籤之<, 令數學式、箭頭、markdown引用等之<與>維持原樣
|
|
40
|
+
//js-xss以此處理標籤外之文字與白名單外之標籤; >於標籤外恆為一般文字故不轉義; 白名單內標籤之屬性值由js-xss之escapeAttrValue另行轉義<>"而不經此函數
|
|
41
|
+
//輸出僅供HTML內文使用, 放入屬性值或註解內並不安全(引號、空白與'-->'皆未轉義)
|
|
42
|
+
function escapeHtml(html) {
|
|
43
|
+
return html.replace(reTagStart, '<')
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
//getOpt, 取得clearXSS與detectXSS共用之js-xss設定(單一出處), 白名單、網址判定與白名單外標籤之處理皆用js-xss預設, 另保留白名單外之style屬性(值跳脫<>"), 文字之轉義改用escapeHtml
|
|
34
48
|
function getOpt(filterXSS) {
|
|
35
49
|
return {
|
|
50
|
+
escapeHtml,
|
|
36
51
|
onIgnoreTagAttr: function(tag, name, value, isWhiteAttr) {
|
|
37
52
|
if (name === 'style') {
|
|
38
53
|
return name + '="' + filterXSS.escapeAttrValue(value) + '"'
|
package/src/clearXSS.mjs
CHANGED
|
@@ -11,6 +11,10 @@ import fxss from './_filterXSS.mjs'
|
|
|
11
11
|
*
|
|
12
12
|
* Depend on: {@link https://jsxss.com/zh/index.html https://jsxss.com/zh/index.html}
|
|
13
13
|
*
|
|
14
|
+
* 白名單外之標籤轉義,白名單內之標籤刪除白名單外之屬性與危險網址(style屬性保留),標籤外之文字只轉義會開始標籤之<(其後為英文字母、斜線、驚嘆號、問號或位於結尾),>與其餘之<維持原樣,故'a < b'等數學式不改寫
|
|
15
|
+
*
|
|
16
|
+
* 輸出僅供以HTML內文呈現(如v-html、innerHTML),不可放入屬性值或註解內
|
|
17
|
+
*
|
|
14
18
|
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/clearXSS.test.mjs Github}
|
|
15
19
|
* @memberOf wsemi
|
|
16
20
|
* @param {String|Object|Array} inp 輸入資料
|
|
@@ -18,11 +22,14 @@ import fxss from './_filterXSS.mjs'
|
|
|
18
22
|
* @example
|
|
19
23
|
*
|
|
20
24
|
* console.log(clearXSS(`><script>alert('XSS')</script>`))
|
|
21
|
-
* // =>
|
|
25
|
+
* // => `><script>alert('XSS')</script>`
|
|
22
26
|
*
|
|
23
27
|
* console.log(clearXSS(`<img src="javascript:alert('XSS')">`))
|
|
24
28
|
* // => `<img src>`
|
|
25
29
|
*
|
|
30
|
+
* console.log(clearXSS(`孔深 < 500 m 且 > 10 m`))
|
|
31
|
+
* // => `孔深 < 500 m 且 > 10 m`
|
|
32
|
+
*
|
|
26
33
|
*/
|
|
27
34
|
function clearXSS(inp) {
|
|
28
35
|
|
package/src/clearXSSDyn.mjs
CHANGED
|
@@ -4,13 +4,15 @@ import clearXSS from './clearXSS.mjs'
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* 清除xss
|
|
7
|
+
* 清除xss攻擊語法,採用動態加載技術,處理規則同clearXSS
|
|
8
8
|
*
|
|
9
9
|
* Depend on: {@link https://jsxss.com/zh/index.html https://jsxss.com/zh/index.html}
|
|
10
10
|
*
|
|
11
11
|
* Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/clearXSSDyn.test.mjs Github}
|
|
12
12
|
* @memberOf wsemi
|
|
13
13
|
* @param {String|Object|Array} inp 輸入資料
|
|
14
|
+
* @param {Object} [opt={}] 輸入設定物件,保留簽名相容,目前不使用
|
|
15
|
+
* @param {String|Object|Array} pathItems 輸入資源字串、字串陣列、物件、物件陣列
|
|
14
16
|
* @returns {Promise} 回傳Promise,resolve回傳輸出資料,reject回傳錯誤訊息
|
|
15
17
|
* @example
|
|
16
18
|
*
|
|
@@ -18,7 +20,7 @@ import clearXSS from './clearXSS.mjs'
|
|
|
18
20
|
*
|
|
19
21
|
* r = await clearXSSDyn(`><script>alert('XSS')</script>`)
|
|
20
22
|
* console.log(r)
|
|
21
|
-
* // =>
|
|
23
|
+
* // => `><script>alert('XSS')</script>`
|
|
22
24
|
*
|
|
23
25
|
* r = await clearXSSDyn(`<img src="javascript:alert('XSS')">`)
|
|
24
26
|
* console.log(r)
|
package/src/detectXSS.mjs
CHANGED
|
@@ -43,7 +43,7 @@ function getScheme(value) {
|
|
|
43
43
|
*
|
|
44
44
|
* 與clearXSS共用同一份js-xss設定(白名單、網址判定、白名單外之style屬性保留),判定規則:
|
|
45
45
|
*
|
|
46
|
-
* 1. 標籤(type為'tag'):白名單外之標籤,名稱由原始標籤片段取得且其後須接空白、斜線、大於或結尾,故含'<svg/onload=...>',不含'孔深 < 500 m'、'5<6>4'、'<o:p>'
|
|
46
|
+
* 1. 標籤(type為'tag'):白名單外之標籤,名稱由原始標籤片段取得且其後須接空白、斜線、大於或結尾,故含'<svg/onload=...>',不含'孔深 < 500 m'、'5<6>4'、'<o:p>';結尾未閉合且無屬性之白名單標籤(如'若 a<b'之'<b')亦不計
|
|
47
47
|
*
|
|
48
48
|
* 2. 屬性(type為'attr'):白名單內標籤被刪除之事件屬性,名稱為on接英文字母且有值,故不含'a<b and once>c'之once
|
|
49
49
|
*
|
|
@@ -79,6 +79,9 @@ function getScheme(value) {
|
|
|
79
79
|
* console.log(detectXSS('孔深 < 500 m 且 > 10 m'))
|
|
80
80
|
* // => []
|
|
81
81
|
*
|
|
82
|
+
* console.log(detectXSS('若 a<b'))
|
|
83
|
+
* // => []
|
|
84
|
+
*
|
|
82
85
|
* console.log(detectXSS('a<b and once>c'))
|
|
83
86
|
* // => []
|
|
84
87
|
*
|
|
@@ -105,6 +108,12 @@ function detectXSS(str) {
|
|
|
105
108
|
let baseOnIgnoreTagAttr = opt.onIgnoreTagAttr || filterXSS.onIgnoreTagAttr
|
|
106
109
|
let baseSafeAttrValue = opt.safeAttrValue || filterXSS.safeAttrValue
|
|
107
110
|
|
|
111
|
+
//isWhiteTag, 是否為白名單標籤, 同js-xss以自身屬性判定(不含原型鍵)
|
|
112
|
+
let whiteList = opt.whiteList || filterXSS.whiteList
|
|
113
|
+
let isWhiteTag = (name) => {
|
|
114
|
+
return Object.prototype.hasOwnProperty.call(whiteList, name)
|
|
115
|
+
}
|
|
116
|
+
|
|
108
117
|
//rs, add, 重複項目合併為1筆
|
|
109
118
|
let rs = []
|
|
110
119
|
let ks = {}
|
|
@@ -128,7 +137,12 @@ function detectXSS(str) {
|
|
|
128
137
|
if (r === undefined || r === null) {
|
|
129
138
|
let m = reTagName.exec(html)
|
|
130
139
|
if (m) {
|
|
131
|
-
|
|
140
|
+
let name = m[1].toLowerCase()
|
|
141
|
+
//結尾未閉合且無屬性之標籤(原始片段恰為'<名稱'或'</名稱'), js-xss取名會少一字而歸為白名單外, 名稱實為白名單者不計(如'若 a<b'之'<b')
|
|
142
|
+
if (html.length === m[0].length && isWhiteTag(name)) {
|
|
143
|
+
return r
|
|
144
|
+
}
|
|
145
|
+
add({ type: 'tag', tag: name })
|
|
132
146
|
}
|
|
133
147
|
}
|
|
134
148
|
return r
|
package/test/_filterXSS.test.mjs
CHANGED
|
@@ -85,6 +85,24 @@ describe(`_filterXSS`, function() {
|
|
|
85
85
|
assert.strict.deepStrictEqual(r, '<img src="https://a/b.png">')
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
+
it(`should escape in text only the < that starts a tag or ends the string`, function() {
|
|
89
|
+
//<後接英文字母、斜線、驚嘆號、問號或位於結尾者轉義, >與其餘之<不轉義
|
|
90
|
+
let opt = fxss.getOpt(xss)
|
|
91
|
+
assert.strict.deepStrictEqual(xss('a < b > c', opt), 'a < b > c')
|
|
92
|
+
assert.strict.deepStrictEqual(xss('x<y', opt), 'x<y')
|
|
93
|
+
assert.strict.deepStrictEqual(xss('x</y', opt), 'x</y')
|
|
94
|
+
assert.strict.deepStrictEqual(xss('x<!y', opt), 'x<!y')
|
|
95
|
+
assert.strict.deepStrictEqual(xss('x<?y', opt), 'x<?y')
|
|
96
|
+
assert.strict.deepStrictEqual(xss('a <', opt), 'a <')
|
|
97
|
+
assert.strict.deepStrictEqual(xss('<svg onload=x()>', opt), '<svg onload=x()>')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it(`should not change the escaping of attribute values`, function() {
|
|
101
|
+
//白名單內標籤之屬性值由js-xss之escapeAttrValue轉義<>", 不經文字之轉義
|
|
102
|
+
let r = xss('<a href="https://a/b" title="a<b>c">x</a>', fxss.getOpt(xss))
|
|
103
|
+
assert.strict.deepStrictEqual(r, '<a href="https://a/b" title="a<b>c">x</a>')
|
|
104
|
+
})
|
|
105
|
+
|
|
88
106
|
})
|
|
89
107
|
|
|
90
108
|
})
|
package/test/clearXSS.test.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import assert from 'assert'
|
|
2
|
+
import xss from 'xss'
|
|
2
3
|
import clearXSS from '../src/clearXSS.mjs'
|
|
3
4
|
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ describe(`clearXSS`, function() {
|
|
|
9
10
|
|
|
10
11
|
k = 1
|
|
11
12
|
x[k] = `><script>alert('XSS')</script>`
|
|
12
|
-
fx[k] =
|
|
13
|
+
fx[k] = `><script>alert('XSS')</script>`
|
|
13
14
|
it(`should return ' + fx[k] + ' when input ' + x[k]`, function() {
|
|
14
15
|
k = 1
|
|
15
16
|
let r = clearXSS(x[k])
|
|
@@ -18,7 +19,7 @@ describe(`clearXSS`, function() {
|
|
|
18
19
|
|
|
19
20
|
k = 2
|
|
20
21
|
x[k] = `='><script>alert('XSS')</script>`
|
|
21
|
-
fx[k] = `='
|
|
22
|
+
fx[k] = `='><script>alert('XSS')</script>`
|
|
22
23
|
it(`should return ' + fx[k] + ' when input ' + x[k]`, function() {
|
|
23
24
|
k = 2
|
|
24
25
|
let r = clearXSS(x[k])
|
|
@@ -27,7 +28,7 @@ describe(`clearXSS`, function() {
|
|
|
27
28
|
|
|
28
29
|
k = 3
|
|
29
30
|
x[k] = `"><script>alert('XSS')</script>`
|
|
30
|
-
fx[k] = `"
|
|
31
|
+
fx[k] = `"><script>alert('XSS')</script>`
|
|
31
32
|
it(`should return ' + fx[k] + ' when input ' + x[k]`, function() {
|
|
32
33
|
k = 3
|
|
33
34
|
let r = clearXSS(x[k])
|
|
@@ -36,7 +37,7 @@ describe(`clearXSS`, function() {
|
|
|
36
37
|
|
|
37
38
|
k = 4
|
|
38
39
|
x[k] = `<script>alert('XSS')</script>`
|
|
39
|
-
fx[k] = `<script
|
|
40
|
+
fx[k] = `<script>alert('XSS')</script>`
|
|
40
41
|
it(`should return ' + fx[k] + ' when input ' + x[k]`, function() {
|
|
41
42
|
k = 4
|
|
42
43
|
let r = clearXSS(x[k])
|
|
@@ -45,7 +46,7 @@ describe(`clearXSS`, function() {
|
|
|
45
46
|
|
|
46
47
|
k = 5
|
|
47
48
|
x[k] = `<script>alert (vulnerable)</script>`
|
|
48
|
-
fx[k] = `<script
|
|
49
|
+
fx[k] = `<script>alert (vulnerable)</script>`
|
|
49
50
|
it(`should return ' + fx[k] + ' when input ' + x[k]`, function() {
|
|
50
51
|
k = 5
|
|
51
52
|
let r = clearXSS(x[k])
|
|
@@ -63,7 +64,7 @@ describe(`clearXSS`, function() {
|
|
|
63
64
|
|
|
64
65
|
k = 7
|
|
65
66
|
x[k] = `<script>alert('XSS')</script>`
|
|
66
|
-
fx[k] = `<script
|
|
67
|
+
fx[k] = `<script>alert('XSS')</script>`
|
|
67
68
|
it(`should return ' + fx[k] + ' when input ' + x[k]`, function() {
|
|
68
69
|
k = 7
|
|
69
70
|
let r = clearXSS(x[k])
|
|
@@ -181,4 +182,145 @@ describe(`clearXSS`, function() {
|
|
|
181
182
|
assert.strict.deepStrictEqual(r, NaN)
|
|
182
183
|
})
|
|
183
184
|
|
|
185
|
+
describe(`標籤外之文字只轉義會開始標籤之<`, function() {
|
|
186
|
+
|
|
187
|
+
//不會開始標籤之<(後接空白、數字、符號、非英文字母)與標籤外之>維持原樣
|
|
188
|
+
let keep = [
|
|
189
|
+
'a < b',
|
|
190
|
+
'1 > 0',
|
|
191
|
+
'x <= 5',
|
|
192
|
+
'x>=3',
|
|
193
|
+
'溫度 > 30°C',
|
|
194
|
+
'孔深 < 500 m 且 > 10 m',
|
|
195
|
+
'if (a < b && c > d)',
|
|
196
|
+
'<3',
|
|
197
|
+
'2<3',
|
|
198
|
+
'x<=y',
|
|
199
|
+
'3<4>2',
|
|
200
|
+
'<新增>',
|
|
201
|
+
'輸入 -> 輸出 <- 回饋',
|
|
202
|
+
'> 引用一段話\n\n- 若 a < b 則停止\n- `x => y`',
|
|
203
|
+
]
|
|
204
|
+
for (let s of keep) {
|
|
205
|
+
it(`should keep ${JSON.stringify(s)}`, function() {
|
|
206
|
+
assert.strict.deepStrictEqual(clearXSS(s), s)
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
//<後接英文字母、斜線、驚嘆號、問號, 或位於結尾者轉義(結尾之<於兩欄相鄰組進畫面時會與後一欄開頭拼成標籤)
|
|
211
|
+
let esc = [
|
|
212
|
+
['a<b', 'a<b'],
|
|
213
|
+
['x<y>z', 'x<y>z'],
|
|
214
|
+
['a <', 'a <'],
|
|
215
|
+
['x<', 'x<'],
|
|
216
|
+
['請見 <https://example.com>', '請見 <https://example.com>'],
|
|
217
|
+
['<script>alert(1)</script>', '<script>alert(1)</script>'],
|
|
218
|
+
['<SCRIPT>alert(1)</SCRIPT>', '<SCRIPT>alert(1)</SCRIPT>'],
|
|
219
|
+
['A<B', 'A<B'],
|
|
220
|
+
['<img src="x" onerror="alert(1)"', '<img src="x" onerror="alert(1)"'],
|
|
221
|
+
['<svg onload=alert(1)//', '<svg onload=alert(1)//'],
|
|
222
|
+
['</title><script>alert(1)</script>', '</title><script>alert(1)</script>'],
|
|
223
|
+
['<!DOCTYPE html>', '<!DOCTYPE html>'],
|
|
224
|
+
['<?xml version="1.0"?><script>alert(1)</script>', '<?xml version="1.0"?><script>alert(1)</script>'],
|
|
225
|
+
]
|
|
226
|
+
for (let [s, e] of esc) {
|
|
227
|
+
it(`should escape ${JSON.stringify(s)}`, function() {
|
|
228
|
+
assert.strict.deepStrictEqual(clearXSS(s), e)
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
it(`should escape the former of two adjacent <`, function() {
|
|
233
|
+
//js-xss於第二個<前切段而分段轉義, 前者位於段尾視為結尾而轉義, 只多轉義不影響安全
|
|
234
|
+
assert.strict.deepStrictEqual(clearXSS('a << b'), 'a << b')
|
|
235
|
+
assert.strict.deepStrictEqual(clearXSS('x <<= 2'), 'x <<= 2')
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
it(`should apply to strings inside objects and arrays`, function() {
|
|
239
|
+
let r = clearXSS({ a: 'a < b', b: ['<script>', 1] })
|
|
240
|
+
assert.strict.deepStrictEqual(r, { a: 'a < b', b: ['<script>', 1] })
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
describe(`白名單內標籤、事件屬性、網址、style、屬性值與註解之處理不變`, function() {
|
|
246
|
+
|
|
247
|
+
let same = [
|
|
248
|
+
['<img src=x onerror=alert(1)>', '<img src>'],
|
|
249
|
+
['<b onclick=alert(1)>x</b>', '<b>x</b>'],
|
|
250
|
+
['<a href="javascript:alert(1)">x</a>', '<a href>x</a>'],
|
|
251
|
+
['a<b and c>d', 'a<b>d'],
|
|
252
|
+
['<div style="a:b<c" title="t">x</div>', '<div style="a:b<c">x</div>'],
|
|
253
|
+
['<!-- x -->y', 'y'],
|
|
254
|
+
//白名單內標籤之屬性值仍由js-xss之escapeAttrValue轉義<>", 不經文字之轉義
|
|
255
|
+
['<img alt="1 > 0" src="https://a/b.png">', '<img alt="1 > 0" src="https://a/b.png">'],
|
|
256
|
+
['<a href="https://a/b" title="a<b>c">x</a>', '<a href="https://a/b" title="a<b>c">x</a>'],
|
|
257
|
+
[`<a title='x"y'>z</a>`, '<a title="x"y">z</a>'],
|
|
258
|
+
]
|
|
259
|
+
for (let [s, e] of same) {
|
|
260
|
+
it(`should keep the handling of ${JSON.stringify(s)}`, function() {
|
|
261
|
+
assert.strict.deepStrictEqual(clearXSS(s), e)
|
|
262
|
+
})
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
describe(`兩欄各自清除後相連不會拼出標籤`, function() {
|
|
268
|
+
|
|
269
|
+
//相連結果中會開始標籤之<只能是js-xss重建之白名單標籤且不帶事件屬性, 結尾亦不得留下<
|
|
270
|
+
let reStart = /<(?=[A-Za-z!/?]|$)/g
|
|
271
|
+
let reTag = /^<\/?([A-Za-z][A-Za-z0-9-]*)(\s[^<>]*)?\/?>$/
|
|
272
|
+
let isWhite = (name) => Object.prototype.hasOwnProperty.call(xss.whiteList, name)
|
|
273
|
+
let findBad = (r) => {
|
|
274
|
+
reStart.lastIndex = 0
|
|
275
|
+
let m
|
|
276
|
+
while ((m = reStart.exec(r)) !== null) {
|
|
277
|
+
let j = r.indexOf('>', m.index)
|
|
278
|
+
if (j < 0) {
|
|
279
|
+
return `unclosed: ${r.slice(m.index)}`
|
|
280
|
+
}
|
|
281
|
+
let t = r.slice(m.index, j + 1)
|
|
282
|
+
let mt = reTag.exec(t)
|
|
283
|
+
if (!mt || !isWhite(mt[1].toLowerCase())) {
|
|
284
|
+
return `tag: ${t}`
|
|
285
|
+
}
|
|
286
|
+
if (/\son[a-z]+\s*=/i.test(t)) {
|
|
287
|
+
return `event: ${t}`
|
|
288
|
+
}
|
|
289
|
+
reStart.lastIndex = j + 1
|
|
290
|
+
}
|
|
291
|
+
return ''
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
let attacks = [
|
|
295
|
+
'<script>alert(1)</script>',
|
|
296
|
+
'<img src=x onerror=alert(1)>',
|
|
297
|
+
'<svg onload=alert(1)>',
|
|
298
|
+
'<svg/onload=alert(1)>',
|
|
299
|
+
'<a href="javascript:alert(1)">x</a>',
|
|
300
|
+
'<iframe src=javascript:alert(1)>',
|
|
301
|
+
'<b onclick=alert(1)>x</b>',
|
|
302
|
+
'<!--><svg onload=alert(1)>-->',
|
|
303
|
+
'<?xml?><svg onload=alert(1)>',
|
|
304
|
+
'</title><script>alert(1)</script>',
|
|
305
|
+
'x<img src=1 onerror=alert(1)>',
|
|
306
|
+
'a <b>粗體</b> c',
|
|
307
|
+
'<table><tr><td>t</td></tr></table>',
|
|
308
|
+
]
|
|
309
|
+
|
|
310
|
+
it(`should not form tags when two cleared fields are joined at any position`, function() {
|
|
311
|
+
let bad = []
|
|
312
|
+
for (let s of attacks) {
|
|
313
|
+
for (let i = 1; i < s.length; i++) {
|
|
314
|
+
let r = clearXSS(s.slice(0, i)) + clearXSS(s.slice(i))
|
|
315
|
+
let err = findBad(r)
|
|
316
|
+
if (err) {
|
|
317
|
+
bad.push({ s, i, r, err })
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
assert.strict.deepStrictEqual(bad, [])
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
})
|
|
325
|
+
|
|
184
326
|
})
|
package/test/detectXSS.test.mjs
CHANGED
|
@@ -53,6 +53,16 @@ describe(`detectXSS`, function() {
|
|
|
53
53
|
|
|
54
54
|
it(`should report the full name of an unclosed tag at the end`, function() {
|
|
55
55
|
check('<script', [tag('script')])
|
|
56
|
+
check('x<y', [tag('y')])
|
|
57
|
+
check('<img/src="x"/onerror=alert(1)', [tag('img')])
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it(`should not report a whitelisted tag left unclosed without attributes at the end`, function() {
|
|
61
|
+
//js-xss對結尾未閉合且無屬性之標籤取名少一字而歸為白名單外, 名稱實為白名單者不計
|
|
62
|
+
check('a<b', [])
|
|
63
|
+
check('若 a<b', [])
|
|
64
|
+
check('a</b', [])
|
|
65
|
+
check('<img', [])
|
|
56
66
|
})
|
|
57
67
|
|
|
58
68
|
it(`should report form controls and custom elements`, function() {
|