@unicom-cloud/utils 0.1.45 → 0.1.47
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/.virtual/_rolldown/runtime.js +1 -1
- package/.vite/manifest.json +339 -34
- package/array/index.js +1 -1
- package/assert/index.js +1 -1
- package/case-name/index.js +1 -1
- package/class-name/index.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +1 -1
- package/constant/protocol.js +1 -1
- package/constant/string.js +1 -1
- package/constant/ui.js +1 -1
- package/content-disposition/index.js +1 -1
- package/cookie/api.js +1 -1
- package/cookie/assign.js +1 -1
- package/cookie/converter.js +1 -1
- package/cookie/index.js +1 -1
- package/css/cssSupported.d.ts +8 -0
- package/css/cssSupported.js +11 -0
- package/css/index.d.ts +1 -0
- package/css/index.js +4 -0
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +1 -1
- package/decimal/decimal.js +1 -1
- package/decimal/index.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getElementCoordinates.js +1 -1
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +1 -1
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +1 -1
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/emitter/index.js +1 -1
- package/emoji/emoji.js +1 -1
- package/emoji/emojis.js +1 -1
- package/emoji/index.js +1 -1
- package/escape/index.js +1 -1
- package/fflate/LICENSE +20 -0
- package/fflate/index.d.ts +1 -0
- package/fflate/index.js +4 -0
- package/fflate/src/index.d.ts +1538 -0
- package/fflate/src/index.js +1424 -0
- package/fflate/src/node-worker.d.ts +2 -0
- package/fflate/src/worker.d.ts +13 -0
- package/fflate/src/worker.js +39 -0
- package/file/fileRead.js +1 -1
- package/file/fileToDataURL.js +1 -1
- package/file/img.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/filesize/index.js +1 -1
- package/filesize/src/constants.js +1 -1
- package/filesize/src/filesize.js +1 -1
- package/filesize/src/helpers.js +1 -1
- package/function/index.js +1 -1
- package/idb/async-iterators.js +1 -1
- package/idb/database-extras.js +1 -1
- package/idb/entry.js +1 -1
- package/idb/index-.js +1 -1
- package/idb/index.js +1 -1
- package/idb/util.js +1 -1
- package/idb/wrap-idb-value.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/is/index.js +1 -1
- package/is/lib/isAscii.js +1 -1
- package/is/lib/isBase64.js +1 -1
- package/is/lib/isChinese.js +1 -1
- package/is/lib/isDataURI.js +1 -1
- package/is/lib/isEmail.js +1 -1
- package/is/lib/isFQDN.js +1 -1
- package/is/lib/isFullWidth.js +1 -1
- package/is/lib/isHSL.js +1 -1
- package/is/lib/isHalfWidth.js +1 -1
- package/is/lib/isHash.js +1 -1
- package/is/lib/isHexColor.js +1 -1
- package/is/lib/isIMEI.js +1 -1
- package/is/lib/isIP.js +1 -1
- package/is/lib/isIPRange.js +1 -1
- package/is/lib/isIdentityCard.js +1 -1
- package/is/lib/isJWT.js +1 -1
- package/is/lib/isMACAddress.js +1 -1
- package/is/lib/isMD5.js +1 -1
- package/is/lib/isMimeType.js +1 -1
- package/is/lib/isMobilePhone.js +1 -1
- package/is/lib/isPort.js +1 -1
- package/is/lib/isRgbColor.js +1 -1
- package/is/lib/isSemVer.js +1 -1
- package/is/lib/isSlug.js +1 -1
- package/is/lib/isStrongPassword.js +1 -1
- package/is/lib/isURL.js +1 -1
- package/is/lib/isUUID.js +1 -1
- package/is/lib/isVariableWidth.js +1 -1
- package/lodash/_DataView.js +1 -1
- package/lodash/_Hash.js +1 -1
- package/lodash/_LazyWrapper.js +1 -1
- package/lodash/_ListCache.js +1 -1
- package/lodash/_LodashWrapper.js +1 -1
- package/lodash/_Map.js +1 -1
- package/lodash/_MapCache.js +1 -1
- package/lodash/_Promise.js +1 -1
- package/lodash/_Set.js +1 -1
- package/lodash/_SetCache.js +1 -1
- package/lodash/_Stack.js +1 -1
- package/lodash/_Symbol.js +1 -1
- package/lodash/_Uint8Array.js +1 -1
- package/lodash/_WeakMap.js +1 -1
- package/lodash/_addMapEntry.js +1 -1
- package/lodash/_addSetEntry.js +1 -1
- package/lodash/_apply.js +1 -1
- package/lodash/_arrayAggregator.js +1 -1
- package/lodash/_arrayEach.js +1 -1
- package/lodash/_arrayEachRight.js +1 -1
- package/lodash/_arrayEvery.js +1 -1
- package/lodash/_arrayFilter.js +1 -1
- package/lodash/_arrayIncludes.js +1 -1
- package/lodash/_arrayIncludesWith.js +1 -1
- package/lodash/_arrayLikeKeys.js +1 -1
- package/lodash/_arrayMap.js +1 -1
- package/lodash/_arrayPush.js +1 -1
- package/lodash/_arrayReduce.js +1 -1
- package/lodash/_arrayReduceRight.js +1 -1
- package/lodash/_arraySample.js +1 -1
- package/lodash/_arraySampleSize.js +1 -1
- package/lodash/_arrayShuffle.js +1 -1
- package/lodash/_arraySome.js +1 -1
- package/lodash/_asciiSize.js +1 -1
- package/lodash/_asciiToArray.js +1 -1
- package/lodash/_asciiWords.js +1 -1
- package/lodash/_assignMergeValue.js +1 -1
- package/lodash/_assignValue.js +1 -1
- package/lodash/_assocIndexOf.js +1 -1
- package/lodash/_baseAggregator.js +1 -1
- package/lodash/_baseAssign.js +1 -1
- package/lodash/_baseAssignIn.js +1 -1
- package/lodash/_baseAssignValue.js +1 -1
- package/lodash/_baseAt.js +1 -1
- package/lodash/_baseClamp.js +1 -1
- package/lodash/_baseClone.js +1 -1
- package/lodash/_baseConforms.js +1 -1
- package/lodash/_baseConformsTo.js +1 -1
- package/lodash/_baseCreate.js +1 -1
- package/lodash/_baseDelay.js +1 -1
- package/lodash/_baseDifference.js +1 -1
- package/lodash/_baseEach.js +1 -1
- package/lodash/_baseEachRight.js +1 -1
- package/lodash/_baseEvery.js +1 -1
- package/lodash/_baseExtremum.js +1 -1
- package/lodash/_baseFill.js +1 -1
- package/lodash/_baseFilter.js +1 -1
- package/lodash/_baseFindIndex.js +1 -1
- package/lodash/_baseFindKey.js +1 -1
- package/lodash/_baseFlatten.js +1 -1
- package/lodash/_baseFor.js +1 -1
- package/lodash/_baseForOwn.js +1 -1
- package/lodash/_baseForOwnRight.js +1 -1
- package/lodash/_baseForRight.js +1 -1
- package/lodash/_baseFunctions.js +1 -1
- package/lodash/_baseGet.js +1 -1
- package/lodash/_baseGetAllKeys.js +1 -1
- package/lodash/_baseGetTag.js +1 -1
- package/lodash/_baseGt.js +1 -1
- package/lodash/_baseHas.js +1 -1
- package/lodash/_baseHasIn.js +1 -1
- package/lodash/_baseInRange.js +1 -1
- package/lodash/_baseIndexOf.js +1 -1
- package/lodash/_baseIndexOfWith.js +1 -1
- package/lodash/_baseIntersection.js +1 -1
- package/lodash/_baseInverter.js +1 -1
- package/lodash/_baseInvoke.js +1 -1
- package/lodash/_baseIsArguments.js +1 -1
- package/lodash/_baseIsArrayBuffer.js +1 -1
- package/lodash/_baseIsDate.js +1 -1
- package/lodash/_baseIsEqual.js +1 -1
- package/lodash/_baseIsEqualDeep.js +1 -1
- package/lodash/_baseIsMap.js +1 -1
- package/lodash/_baseIsMatch.js +1 -1
- package/lodash/_baseIsNaN.js +1 -1
- package/lodash/_baseIsNative.js +1 -1
- package/lodash/_baseIsRegExp.js +1 -1
- package/lodash/_baseIsSet.js +1 -1
- package/lodash/_baseIsTypedArray.js +1 -1
- package/lodash/_baseIteratee.js +1 -1
- package/lodash/_baseKeys.js +1 -1
- package/lodash/_baseKeysIn.js +1 -1
- package/lodash/_baseLodash.js +1 -1
- package/lodash/_baseLt.js +1 -1
- package/lodash/_baseMap.js +1 -1
- package/lodash/_baseMatches.js +1 -1
- package/lodash/_baseMatchesProperty.js +1 -1
- package/lodash/_baseMean.js +1 -1
- package/lodash/_baseMerge.js +1 -1
- package/lodash/_baseMergeDeep.js +1 -1
- package/lodash/_baseNth.js +1 -1
- package/lodash/_baseOrderBy.js +1 -1
- package/lodash/_basePick.js +1 -1
- package/lodash/_basePickBy.js +1 -1
- package/lodash/_baseProperty.js +1 -1
- package/lodash/_basePropertyDeep.js +1 -1
- package/lodash/_basePropertyOf.js +1 -1
- package/lodash/_basePullAll.js +1 -1
- package/lodash/_basePullAt.js +1 -1
- package/lodash/_baseRandom.js +1 -1
- package/lodash/_baseRange.js +1 -1
- package/lodash/_baseReduce.js +1 -1
- package/lodash/_baseRepeat.js +1 -1
- package/lodash/_baseRest.js +1 -1
- package/lodash/_baseSample.js +1 -1
- package/lodash/_baseSampleSize.js +1 -1
- package/lodash/_baseSet.js +1 -1
- package/lodash/_baseSetData.js +1 -1
- package/lodash/_baseSetToString.js +1 -1
- package/lodash/_baseShuffle.js +1 -1
- package/lodash/_baseSlice.js +1 -1
- package/lodash/_baseSome.js +1 -1
- package/lodash/_baseSortBy.js +1 -1
- package/lodash/_baseSortedIndex.js +1 -1
- package/lodash/_baseSortedIndexBy.js +1 -1
- package/lodash/_baseSortedUniq.js +1 -1
- package/lodash/_baseSum.js +1 -1
- package/lodash/_baseTimes.js +1 -1
- package/lodash/_baseToNumber.js +1 -1
- package/lodash/_baseToPairs.js +1 -1
- package/lodash/_baseToString.js +1 -1
- package/lodash/_baseTrim.js +1 -1
- package/lodash/_baseUnary.js +1 -1
- package/lodash/_baseUniq.js +1 -1
- package/lodash/_baseUnset.js +1 -1
- package/lodash/_baseUpdate.js +1 -1
- package/lodash/_baseValues.js +1 -1
- package/lodash/_baseWhile.js +1 -1
- package/lodash/_baseWrapperValue.js +1 -1
- package/lodash/_baseXor.js +1 -1
- package/lodash/_baseZipObject.js +1 -1
- package/lodash/_cacheHas.js +1 -1
- package/lodash/_castArrayLikeObject.js +1 -1
- package/lodash/_castFunction.js +1 -1
- package/lodash/_castPath.js +1 -1
- package/lodash/_castRest.js +1 -1
- package/lodash/_castSlice.js +1 -1
- package/lodash/_charsEndIndex.js +1 -1
- package/lodash/_charsStartIndex.js +1 -1
- package/lodash/_cloneArrayBuffer.js +1 -1
- package/lodash/_cloneBuffer.js +1 -1
- package/lodash/_cloneDataView.js +1 -1
- package/lodash/_cloneMap.js +1 -1
- package/lodash/_cloneRegExp.js +1 -1
- package/lodash/_cloneSet.js +1 -1
- package/lodash/_cloneSymbol.js +1 -1
- package/lodash/_cloneTypedArray.js +1 -1
- package/lodash/_compareAscending.js +1 -1
- package/lodash/_compareMultiple.js +1 -1
- package/lodash/_composeArgs.js +1 -1
- package/lodash/_composeArgsRight.js +1 -1
- package/lodash/_copyArray.js +1 -1
- package/lodash/_copyObject.js +1 -1
- package/lodash/_copySymbols.js +1 -1
- package/lodash/_copySymbolsIn.js +1 -1
- package/lodash/_coreJsData.js +1 -1
- package/lodash/_countHolders.js +1 -1
- package/lodash/_createAggregator.js +1 -1
- package/lodash/_createAssigner.js +1 -1
- package/lodash/_createBaseEach.js +1 -1
- package/lodash/_createBaseFor.js +1 -1
- package/lodash/_createBind.js +1 -1
- package/lodash/_createCaseFirst.js +1 -1
- package/lodash/_createCompounder.js +1 -1
- package/lodash/_createCtor.js +1 -1
- package/lodash/_createCurry.js +1 -1
- package/lodash/_createFind.js +1 -1
- package/lodash/_createFlow.js +1 -1
- package/lodash/_createHybrid.js +1 -1
- package/lodash/_createInverter.js +1 -1
- package/lodash/_createMathOperation.js +1 -1
- package/lodash/_createOver.js +1 -1
- package/lodash/_createPadding.js +1 -1
- package/lodash/_createPartial.js +1 -1
- package/lodash/_createRange.js +1 -1
- package/lodash/_createRecurry.js +1 -1
- package/lodash/_createRelationalOperation.js +1 -1
- package/lodash/_createRound.js +1 -1
- package/lodash/_createSet.js +1 -1
- package/lodash/_createToPairs.js +1 -1
- package/lodash/_createWrap.js +1 -1
- package/lodash/_customDefaultsAssignIn.js +1 -1
- package/lodash/_customDefaultsMerge.js +1 -1
- package/lodash/_customOmitClone.js +1 -1
- package/lodash/_deburrLetter.js +1 -1
- package/lodash/_defineProperty.js +1 -1
- package/lodash/_equalArrays.js +1 -1
- package/lodash/_equalByTag.js +1 -1
- package/lodash/_equalObjects.js +1 -1
- package/lodash/_escapeHtmlChar.js +1 -1
- package/lodash/_escapeStringChar.js +1 -1
- package/lodash/_flatRest.js +1 -1
- package/lodash/_freeGlobal.js +1 -1
- package/lodash/_getAllKeys.js +1 -1
- package/lodash/_getAllKeysIn.js +1 -1
- package/lodash/_getData.js +1 -1
- package/lodash/_getFuncName.js +1 -1
- package/lodash/_getHolder.js +1 -1
- package/lodash/_getMapData.js +1 -1
- package/lodash/_getMatchData.js +1 -1
- package/lodash/_getNative.js +1 -1
- package/lodash/_getPrototype.js +1 -1
- package/lodash/_getRawTag.js +1 -1
- package/lodash/_getSymbols.js +1 -1
- package/lodash/_getSymbolsIn.js +1 -1
- package/lodash/_getTag.js +1 -1
- package/lodash/_getValue.js +1 -1
- package/lodash/_getView.js +1 -1
- package/lodash/_getWrapDetails.js +1 -1
- package/lodash/_hasPath.js +1 -1
- package/lodash/_hasUnicode.js +1 -1
- package/lodash/_hasUnicodeWord.js +1 -1
- package/lodash/_hashClear.js +1 -1
- package/lodash/_hashDelete.js +1 -1
- package/lodash/_hashGet.js +1 -1
- package/lodash/_hashHas.js +1 -1
- package/lodash/_hashSet.js +1 -1
- package/lodash/_initCloneArray.js +1 -1
- package/lodash/_initCloneByTag.js +1 -1
- package/lodash/_initCloneObject.js +1 -1
- package/lodash/_insertWrapDetails.js +1 -1
- package/lodash/_isFlattenable.js +1 -1
- package/lodash/_isIndex.js +1 -1
- package/lodash/_isIterateeCall.js +1 -1
- package/lodash/_isKey.js +1 -1
- package/lodash/_isKeyable.js +1 -1
- package/lodash/_isLaziable.js +1 -1
- package/lodash/_isMaskable.js +1 -1
- package/lodash/_isMasked.js +1 -1
- package/lodash/_isPrototype.js +1 -1
- package/lodash/_isStrictComparable.js +1 -1
- package/lodash/_iteratorToArray.js +1 -1
- package/lodash/_lazyClone.js +1 -1
- package/lodash/_lazyReverse.js +1 -1
- package/lodash/_lazyValue.js +1 -1
- package/lodash/_listCacheClear.js +1 -1
- package/lodash/_listCacheDelete.js +1 -1
- package/lodash/_listCacheGet.js +1 -1
- package/lodash/_listCacheHas.js +1 -1
- package/lodash/_listCacheSet.js +1 -1
- package/lodash/_mapCacheClear.js +1 -1
- package/lodash/_mapCacheDelete.js +1 -1
- package/lodash/_mapCacheGet.js +1 -1
- package/lodash/_mapCacheHas.js +1 -1
- package/lodash/_mapCacheSet.js +1 -1
- package/lodash/_mapToArray.js +1 -1
- package/lodash/_matchesStrictComparable.js +1 -1
- package/lodash/_memoizeCapped.js +1 -1
- package/lodash/_mergeData.js +1 -1
- package/lodash/_metaMap.js +1 -1
- package/lodash/_nativeCreate.js +1 -1
- package/lodash/_nativeKeys.js +1 -1
- package/lodash/_nativeKeysIn.js +1 -1
- package/lodash/_nodeUtil.js +1 -1
- package/lodash/_objectToString.js +1 -1
- package/lodash/_overArg.js +1 -1
- package/lodash/_overRest.js +1 -1
- package/lodash/_parent.js +1 -1
- package/lodash/_reEscape.js +1 -1
- package/lodash/_reEvaluate.js +1 -1
- package/lodash/_reInterpolate.js +1 -1
- package/lodash/_realNames.js +1 -1
- package/lodash/_reorder.js +1 -1
- package/lodash/_replaceHolders.js +1 -1
- package/lodash/_root.js +1 -1
- package/lodash/_safeGet.js +1 -1
- package/lodash/_setCacheAdd.js +1 -1
- package/lodash/_setCacheHas.js +1 -1
- package/lodash/_setData.js +1 -1
- package/lodash/_setToArray.js +1 -1
- package/lodash/_setToPairs.js +1 -1
- package/lodash/_setToString.js +1 -1
- package/lodash/_setWrapToString.js +1 -1
- package/lodash/_shortOut.js +1 -1
- package/lodash/_shuffleSelf.js +1 -1
- package/lodash/_stackClear.js +1 -1
- package/lodash/_stackDelete.js +1 -1
- package/lodash/_stackGet.js +1 -1
- package/lodash/_stackHas.js +1 -1
- package/lodash/_stackSet.js +1 -1
- package/lodash/_strictIndexOf.js +1 -1
- package/lodash/_strictLastIndexOf.js +1 -1
- package/lodash/_stringSize.js +1 -1
- package/lodash/_stringToArray.js +1 -1
- package/lodash/_stringToPath.js +1 -1
- package/lodash/_toKey.js +1 -1
- package/lodash/_toSource.js +1 -1
- package/lodash/_trimmedEndIndex.js +1 -1
- package/lodash/_unescapeHtmlChar.js +1 -1
- package/lodash/_unicodeSize.js +1 -1
- package/lodash/_unicodeToArray.js +1 -1
- package/lodash/_unicodeWords.js +1 -1
- package/lodash/_updateWrapDetails.js +1 -1
- package/lodash/_wrapperClone.js +1 -1
- package/lodash/add.js +1 -1
- package/lodash/after.js +1 -1
- package/lodash/array.default.js +1 -1
- package/lodash/array.js +1 -1
- package/lodash/ary.js +1 -1
- package/lodash/assign.js +1 -1
- package/lodash/assignIn.js +1 -1
- package/lodash/assignInWith.js +1 -1
- package/lodash/assignWith.js +1 -1
- package/lodash/at.js +1 -1
- package/lodash/attempt.js +1 -1
- package/lodash/before.js +1 -1
- package/lodash/bind.js +1 -1
- package/lodash/bindAll.js +1 -1
- package/lodash/bindKey.js +1 -1
- package/lodash/camelCase.js +1 -1
- package/lodash/capitalize.js +1 -1
- package/lodash/castArray.js +1 -1
- package/lodash/ceil.js +1 -1
- package/lodash/chain.js +1 -1
- package/lodash/chunk.js +1 -1
- package/lodash/clamp.js +1 -1
- package/lodash/clone.js +1 -1
- package/lodash/cloneDeep.js +1 -1
- package/lodash/cloneDeepWith.js +1 -1
- package/lodash/cloneWith.js +1 -1
- package/lodash/collection.default.js +1 -1
- package/lodash/collection.js +1 -1
- package/lodash/commit.js +1 -1
- package/lodash/compact.js +1 -1
- package/lodash/concat.js +1 -1
- package/lodash/cond.js +1 -1
- package/lodash/conforms.js +1 -1
- package/lodash/conformsTo.js +1 -1
- package/lodash/constant.js +1 -1
- package/lodash/countBy.js +1 -1
- package/lodash/create.js +1 -1
- package/lodash/curry.js +1 -1
- package/lodash/curryRight.js +1 -1
- package/lodash/date.default.js +1 -1
- package/lodash/date.js +1 -1
- package/lodash/debounce.js +1 -1
- package/lodash/deburr.js +1 -1
- package/lodash/defaultTo.js +1 -1
- package/lodash/defaults.js +1 -1
- package/lodash/defaultsDeep.js +1 -1
- package/lodash/defer.js +1 -1
- package/lodash/delay.js +1 -1
- package/lodash/difference.js +1 -1
- package/lodash/differenceBy.js +1 -1
- package/lodash/differenceWith.js +1 -1
- package/lodash/divide.js +1 -1
- package/lodash/drop.js +1 -1
- package/lodash/dropRight.js +1 -1
- package/lodash/dropRightWhile.js +1 -1
- package/lodash/dropWhile.js +1 -1
- package/lodash/each.js +1 -1
- package/lodash/eachRight.js +1 -1
- package/lodash/endsWith.js +1 -1
- package/lodash/entries.js +1 -1
- package/lodash/entriesIn.js +1 -1
- package/lodash/eq.js +1 -1
- package/lodash/escape.js +1 -1
- package/lodash/escapeRegExp.js +1 -1
- package/lodash/every.js +1 -1
- package/lodash/extend.js +1 -1
- package/lodash/extendWith.js +1 -1
- package/lodash/fill.js +1 -1
- package/lodash/filter.js +1 -1
- package/lodash/find.js +1 -1
- package/lodash/findIndex.js +1 -1
- package/lodash/findKey.js +1 -1
- package/lodash/findLast.js +1 -1
- package/lodash/findLastIndex.js +1 -1
- package/lodash/findLastKey.js +1 -1
- package/lodash/first.js +1 -1
- package/lodash/flatMap.js +1 -1
- package/lodash/flatMapDeep.js +1 -1
- package/lodash/flatMapDepth.js +1 -1
- package/lodash/flatten.js +1 -1
- package/lodash/flattenDeep.js +1 -1
- package/lodash/flattenDepth.js +1 -1
- package/lodash/flip.js +1 -1
- package/lodash/floor.js +1 -1
- package/lodash/flow.js +1 -1
- package/lodash/flowRight.js +1 -1
- package/lodash/forEach.js +1 -1
- package/lodash/forEachRight.js +1 -1
- package/lodash/forIn.js +1 -1
- package/lodash/forInRight.js +1 -1
- package/lodash/forOwn.js +1 -1
- package/lodash/forOwnRight.js +1 -1
- package/lodash/fromPairs.js +1 -1
- package/lodash/function.default.js +1 -1
- package/lodash/function.js +1 -1
- package/lodash/functions.js +1 -1
- package/lodash/functionsIn.js +1 -1
- package/lodash/get.js +1 -1
- package/lodash/groupBy.js +1 -1
- package/lodash/gt.js +1 -1
- package/lodash/gte.js +1 -1
- package/lodash/has.js +1 -1
- package/lodash/hasIn.js +1 -1
- package/lodash/head.js +1 -1
- package/lodash/identity.js +1 -1
- package/lodash/inRange.js +1 -1
- package/lodash/includes.js +1 -1
- package/lodash/index.js +1 -1
- package/lodash/indexOf.js +1 -1
- package/lodash/initial.js +1 -1
- package/lodash/intersection.js +1 -1
- package/lodash/intersectionBy.js +1 -1
- package/lodash/intersectionWith.js +1 -1
- package/lodash/invert.js +1 -1
- package/lodash/invertBy.js +1 -1
- package/lodash/invoke.js +1 -1
- package/lodash/invokeMap.js +1 -1
- package/lodash/isArguments.js +1 -1
- package/lodash/isArray.js +1 -1
- package/lodash/isArrayBuffer.js +1 -1
- package/lodash/isArrayLike.js +1 -1
- package/lodash/isArrayLikeObject.js +1 -1
- package/lodash/isBoolean.js +1 -1
- package/lodash/isBuffer.js +1 -1
- package/lodash/isDate.js +1 -1
- package/lodash/isElement.js +1 -1
- package/lodash/isEmpty.js +1 -1
- package/lodash/isEqual.js +1 -1
- package/lodash/isEqualWith.js +1 -1
- package/lodash/isError.js +1 -1
- package/lodash/isFinite.js +1 -1
- package/lodash/isFunction.js +1 -1
- package/lodash/isInteger.js +1 -1
- package/lodash/isLength.js +1 -1
- package/lodash/isMap.js +1 -1
- package/lodash/isMatch.js +1 -1
- package/lodash/isMatchWith.js +1 -1
- package/lodash/isNaN.js +1 -1
- package/lodash/isNative.js +1 -1
- package/lodash/isNil.js +1 -1
- package/lodash/isNull.js +1 -1
- package/lodash/isNumber.js +1 -1
- package/lodash/isObject.js +1 -1
- package/lodash/isObjectLike.js +1 -1
- package/lodash/isPlainObject.js +1 -1
- package/lodash/isPromise.js +1 -1
- package/lodash/isRegExp.js +1 -1
- package/lodash/isSafeInteger.js +1 -1
- package/lodash/isSet.js +1 -1
- package/lodash/isString.js +1 -1
- package/lodash/isSymbol.js +1 -1
- package/lodash/isTypedArray.js +1 -1
- package/lodash/isUndefined.js +1 -1
- package/lodash/isWeakMap.js +1 -1
- package/lodash/isWeakSet.js +1 -1
- package/lodash/iteratee.js +1 -1
- package/lodash/join.js +1 -1
- package/lodash/kebabCase.js +1 -1
- package/lodash/keyBy.js +1 -1
- package/lodash/keys.js +1 -1
- package/lodash/keysIn.js +1 -1
- package/lodash/lang.default.js +1 -1
- package/lodash/lang.js +1 -1
- package/lodash/last.js +1 -1
- package/lodash/lastIndexOf.js +1 -1
- package/lodash/lodash.default.js +1 -1
- package/lodash/lodash.js +1 -1
- package/lodash/lowerCase.js +1 -1
- package/lodash/lowerFirst.js +1 -1
- package/lodash/lt.js +1 -1
- package/lodash/lte.js +1 -1
- package/lodash/map.js +1 -1
- package/lodash/mapKeys.js +1 -1
- package/lodash/mapValues.js +1 -1
- package/lodash/matches.js +1 -1
- package/lodash/matchesProperty.js +1 -1
- package/lodash/math.default.js +1 -1
- package/lodash/math.js +1 -1
- package/lodash/max.js +1 -1
- package/lodash/maxBy.js +1 -1
- package/lodash/mean.js +1 -1
- package/lodash/meanBy.js +1 -1
- package/lodash/memoize.js +1 -1
- package/lodash/merge.js +1 -1
- package/lodash/mergeWith.js +1 -1
- package/lodash/method.js +1 -1
- package/lodash/methodOf.js +1 -1
- package/lodash/min.js +1 -1
- package/lodash/minBy.js +1 -1
- package/lodash/mixin.js +1 -1
- package/lodash/multiply.js +1 -1
- package/lodash/negate.js +1 -1
- package/lodash/next.js +1 -1
- package/lodash/noop.js +1 -1
- package/lodash/now.js +1 -1
- package/lodash/nth.js +1 -1
- package/lodash/nthArg.js +1 -1
- package/lodash/number.default.js +1 -1
- package/lodash/number.js +1 -1
- package/lodash/object.default.js +1 -1
- package/lodash/object.js +1 -1
- package/lodash/omit.js +1 -1
- package/lodash/omitBy.js +1 -1
- package/lodash/once.js +1 -1
- package/lodash/orderBy.js +1 -1
- package/lodash/over.js +1 -1
- package/lodash/overArgs.js +1 -1
- package/lodash/overEvery.js +1 -1
- package/lodash/overSome.js +1 -1
- package/lodash/pad.js +1 -1
- package/lodash/padEnd.js +1 -1
- package/lodash/padStart.js +1 -1
- package/lodash/parseInt.js +1 -1
- package/lodash/partial.js +1 -1
- package/lodash/partialRight.js +1 -1
- package/lodash/partition.js +1 -1
- package/lodash/pick.js +1 -1
- package/lodash/pickBy.js +1 -1
- package/lodash/plant.js +1 -1
- package/lodash/property.js +1 -1
- package/lodash/propertyOf.js +1 -1
- package/lodash/pull.js +1 -1
- package/lodash/pullAll.js +1 -1
- package/lodash/pullAllBy.js +1 -1
- package/lodash/pullAllWith.js +1 -1
- package/lodash/pullAt.js +1 -1
- package/lodash/random.js +1 -1
- package/lodash/range.js +1 -1
- package/lodash/rangeRight.js +1 -1
- package/lodash/rearg.js +1 -1
- package/lodash/reduce.js +1 -1
- package/lodash/reduceRight.js +1 -1
- package/lodash/reject.js +1 -1
- package/lodash/remove.js +1 -1
- package/lodash/repeat.js +1 -1
- package/lodash/replace.js +1 -1
- package/lodash/rest.js +1 -1
- package/lodash/result.js +1 -1
- package/lodash/reverse.js +1 -1
- package/lodash/round.js +1 -1
- package/lodash/sample.js +1 -1
- package/lodash/sampleSize.js +1 -1
- package/lodash/seq.default.js +1 -1
- package/lodash/seq.js +1 -1
- package/lodash/set.js +1 -1
- package/lodash/setWith.js +1 -1
- package/lodash/shuffle.js +1 -1
- package/lodash/size.js +1 -1
- package/lodash/slice.js +1 -1
- package/lodash/snakeCase.js +1 -1
- package/lodash/some.js +1 -1
- package/lodash/sortBy.js +1 -1
- package/lodash/sortedIndex.js +1 -1
- package/lodash/sortedIndexBy.js +1 -1
- package/lodash/sortedIndexOf.js +1 -1
- package/lodash/sortedLastIndex.js +1 -1
- package/lodash/sortedLastIndexBy.js +1 -1
- package/lodash/sortedLastIndexOf.js +1 -1
- package/lodash/sortedUniq.js +1 -1
- package/lodash/sortedUniqBy.js +1 -1
- package/lodash/split.js +1 -1
- package/lodash/spread.js +1 -1
- package/lodash/startCase.js +1 -1
- package/lodash/startsWith.js +1 -1
- package/lodash/string.default.js +1 -1
- package/lodash/string.js +1 -1
- package/lodash/stubArray.js +1 -1
- package/lodash/stubFalse.js +1 -1
- package/lodash/stubObject.js +1 -1
- package/lodash/stubString.js +1 -1
- package/lodash/stubTrue.js +1 -1
- package/lodash/subtract.js +1 -1
- package/lodash/sum.js +1 -1
- package/lodash/sumBy.js +1 -1
- package/lodash/tail.js +1 -1
- package/lodash/take.js +1 -1
- package/lodash/takeRight.js +1 -1
- package/lodash/takeRightWhile.js +1 -1
- package/lodash/takeWhile.js +1 -1
- package/lodash/tap.js +1 -1
- package/lodash/template.js +1 -1
- package/lodash/templateSettings.js +1 -1
- package/lodash/throttle.js +1 -1
- package/lodash/thru.js +1 -1
- package/lodash/times.js +1 -1
- package/lodash/toArray.js +1 -1
- package/lodash/toFinite.js +1 -1
- package/lodash/toInteger.js +1 -1
- package/lodash/toIterator.js +1 -1
- package/lodash/toJSON.js +1 -1
- package/lodash/toLength.js +1 -1
- package/lodash/toLower.js +1 -1
- package/lodash/toNumber.js +1 -1
- package/lodash/toPairs.js +1 -1
- package/lodash/toPairsIn.js +1 -1
- package/lodash/toPath.js +1 -1
- package/lodash/toPlainObject.js +1 -1
- package/lodash/toSafeInteger.js +1 -1
- package/lodash/toString.js +1 -1
- package/lodash/toUpper.js +1 -1
- package/lodash/transform.js +1 -1
- package/lodash/trim.js +1 -1
- package/lodash/trimEnd.js +1 -1
- package/lodash/trimStart.js +1 -1
- package/lodash/truncate.js +1 -1
- package/lodash/unary.js +1 -1
- package/lodash/unescape.js +1 -1
- package/lodash/union.js +1 -1
- package/lodash/unionBy.js +1 -1
- package/lodash/unionWith.js +1 -1
- package/lodash/uniq.js +1 -1
- package/lodash/uniqBy.js +1 -1
- package/lodash/uniqWith.js +1 -1
- package/lodash/uniqueId.js +1 -1
- package/lodash/unset.js +1 -1
- package/lodash/unzip.js +1 -1
- package/lodash/unzipWith.js +1 -1
- package/lodash/update.js +1 -1
- package/lodash/updateWith.js +1 -1
- package/lodash/upperCase.js +1 -1
- package/lodash/upperFirst.js +1 -1
- package/lodash/util.default.js +1 -1
- package/lodash/util.js +1 -1
- package/lodash/value.js +1 -1
- package/lodash/valueOf.js +1 -1
- package/lodash/values.js +1 -1
- package/lodash/valuesIn.js +1 -1
- package/lodash/without.js +1 -1
- package/lodash/words.js +1 -1
- package/lodash/wrap.js +1 -1
- package/lodash/wrapperAt.js +1 -1
- package/lodash/wrapperChain.js +1 -1
- package/lodash/wrapperLodash.js +1 -1
- package/lodash/wrapperReverse.js +1 -1
- package/lodash/wrapperValue.js +1 -1
- package/lodash/xor.js +1 -1
- package/lodash/xorBy.js +1 -1
- package/lodash/xorWith.js +1 -1
- package/lodash/zip.js +1 -1
- package/lodash/zipObject.js +1 -1
- package/lodash/zipObjectDeep.js +1 -1
- package/lodash/zipWith.js +1 -1
- package/math/index.js +1 -1
- package/md5/index.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/object/index.js +1 -1
- package/package.json +1 -1
- package/pinyin/LICENSE +13 -12
- package/pinyin/index.d.ts +2 -1
- package/pinyin/index.js +14 -3
- package/pinyin/lib/common/constant.d.ts +16 -0
- package/pinyin/lib/common/constant.js +16 -0
- package/pinyin/lib/common/segmentit/AC.d.ts +18 -0
- package/pinyin/lib/common/segmentit/AC.js +95 -0
- package/pinyin/lib/common/segmentit/TrieNode.d.ts +30 -0
- package/pinyin/lib/common/segmentit/TrieNode.js +12 -0
- package/pinyin/lib/common/segmentit/index.d.ts +3 -0
- package/pinyin/lib/common/segmentit/index.js +21 -0
- package/pinyin/lib/common/segmentit/max-probability.d.ts +2 -0
- package/pinyin/lib/common/segmentit/max-probability.js +41 -0
- package/pinyin/lib/common/segmentit/min-tokenization.d.ts +2 -0
- package/pinyin/lib/common/segmentit/min-tokenization.js +35 -0
- package/pinyin/lib/common/segmentit/reverse-max-match.d.ts +2 -0
- package/pinyin/lib/common/segmentit/reverse-max-match.js +17 -0
- package/pinyin/lib/common/type.d.ts +69 -0
- package/pinyin/lib/common/utils.d.ts +10 -0
- package/pinyin/lib/common/utils.js +39 -0
- package/pinyin/lib/core/convert/index.d.ts +29 -0
- package/pinyin/lib/core/convert/index.js +128 -0
- package/pinyin/lib/core/custom/index.d.ts +25 -0
- package/pinyin/lib/core/custom/index.js +39 -0
- package/pinyin/lib/core/dict/index.d.ts +10 -0
- package/pinyin/lib/core/dict/index.js +48 -0
- package/pinyin/lib/core/html/index.d.ts +44 -0
- package/pinyin/lib/core/html/index.js +36 -0
- package/pinyin/lib/core/match/index.d.ts +35 -0
- package/pinyin/lib/core/match/index.js +103 -0
- package/pinyin/lib/core/pinyin/handle.d.ts +81 -0
- package/pinyin/lib/core/pinyin/handle.js +140 -0
- package/pinyin/lib/core/pinyin/index.d.ts +117 -0
- package/pinyin/lib/core/pinyin/index.js +32 -0
- package/pinyin/lib/core/pinyin/middlewares.d.ts +25 -0
- package/pinyin/lib/core/pinyin/middlewares.js +110 -0
- package/pinyin/lib/core/polyphonic/index.d.ts +87 -0
- package/pinyin/lib/core/polyphonic/index.js +60 -0
- package/pinyin/lib/core/segment/index.d.ts +87 -0
- package/pinyin/lib/core/segment/index.js +33 -0
- package/pinyin/lib/core/segment/middlewares.d.ts +55 -0
- package/pinyin/lib/core/segment/middlewares.js +67 -0
- package/pinyin/lib/core/traditional/index.d.ts +2 -0
- package/pinyin/lib/core/traditional/index.js +15 -0
- package/pinyin/lib/data/dict1-pinyin.d.ts +3 -0
- package/pinyin/lib/data/dict1.d.ts +3 -0
- package/pinyin/lib/data/dict1.js +13920 -0
- package/pinyin/lib/data/dict2.d.ts +6 -0
- package/pinyin/lib/data/dict2.js +2167 -0
- package/pinyin/lib/data/dict3.d.ts +6 -0
- package/pinyin/lib/data/dict3.js +338 -0
- package/pinyin/lib/data/dict4.d.ts +6 -0
- package/pinyin/lib/data/dict4.js +1608 -0
- package/pinyin/lib/data/dict5.d.ts +6 -0
- package/pinyin/lib/data/dict5.js +30 -0
- package/pinyin/lib/data/special.d.ts +45 -0
- package/pinyin/lib/data/special.js +180 -0
- package/pinyin/lib/data/surname.d.ts +6 -0
- package/pinyin/lib/data/surname.js +508 -0
- package/pinyin/lib/index.d.ts +10 -0
- package/pinyin/lib/index.js +13 -0
- package/pinyin-match/index.d.ts +1 -0
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/sanitize-url/index.js +1 -1
- package/screenfull/index.js +1 -1
- package/sleep/index.js +5 -3
- package/snapdom/index.browser.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +1 -1
- package/snapdom/src/api/snapdom.js +1 -1
- package/snapdom/src/core/cache.js +1 -1
- package/snapdom/src/core/capture.js +1 -1
- package/snapdom/src/core/clone.js +1 -1
- package/snapdom/src/core/context.js +1 -1
- package/snapdom/src/core/plugins.js +1 -1
- package/snapdom/src/core/prepare.js +1 -1
- package/snapdom/src/exporters/download.js +1 -1
- package/snapdom/src/exporters/toBlob.js +1 -1
- package/snapdom/src/exporters/toCanvas.js +1 -1
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/index.browser.js +1 -1
- package/snapdom/src/index.js +1 -1
- package/snapdom/src/modules/CSSVar.js +1 -1
- package/snapdom/src/modules/background.js +1 -1
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +1 -1
- package/snapdom/src/modules/fonts.js +1 -1
- package/snapdom/src/modules/iconFonts.js +1 -1
- package/snapdom/src/modules/images.js +1 -1
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pictureResolver.js +1 -1
- package/snapdom/src/modules/pseudo.js +1 -1
- package/snapdom/src/modules/rasterize.js +1 -1
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +1 -1
- package/snapdom/src/modules/svgDefs.js +1 -1
- package/snapdom/src/utils/browser.js +1 -1
- package/snapdom/src/utils/capture.helpers.js +1 -1
- package/snapdom/src/utils/clone.helpers.js +1 -1
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/debug.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +1 -1
- package/snapdom/src/utils/index.js +1 -1
- package/snapdom/src/utils/prepare.helpers.js +1 -1
- package/snapdom/src/utils/transforms.helpers.js +1 -1
- package/string/chars.js +1 -1
- package/string/index.js +1 -1
- package/tinycolor/conversion.js +1 -1
- package/tinycolor/css-color-names.js +1 -1
- package/tinycolor/format-input.js +29 -29
- package/tinycolor/from-ratio.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/interfaces.js +1 -1
- package/tinycolor/public_api.js +1 -1
- package/tinycolor/random.js +1 -1
- package/tinycolor/readability.js +1 -1
- package/tinycolor/to-ms-filter.js +1 -1
- package/tinycolor/umd_api.js +1 -1
- package/tinycolor/utils.js +1 -1
- package/tree/index.js +1 -1
- package/tree/searchTree.js +1 -1
- package/tween/easing.js +1 -1
- package/tween/index.js +1 -1
- package/tween/tween.js +1 -1
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +1 -1
- package/url-toolkit/index.js +1 -1
- package/validate/index.js +1 -1
- package/validate/interface.js +1 -1
- package/validate/locale/en-US.js +1 -1
- package/validate/locale/index.js +1 -1
- package/validate/locale/zh-CN.js +1 -1
- package/validate/rules/array.js +1 -1
- package/validate/rules/base.js +1 -1
- package/validate/rules/boolean.js +1 -1
- package/validate/rules/custom.js +1 -1
- package/validate/rules/number.js +1 -1
- package/validate/rules/object.js +1 -1
- package/validate/rules/string.js +1 -1
- package/validate/rules/type.js +1 -1
- package/version/index.js +1 -1
- package/xlsx/crc32.js +1 -1
- package/xlsx/index.js +1 -1
- package/xlsx/xlsx.js +607 -623
- package/pinyin/core.js +0 -136
- package/pinyin/simplified.js +0 -8
- package/pinyin/simplified_dict.js +0 -411
- package/pinyin/traditional.js +0 -8
- package/pinyin/traditional_dict.js +0 -404
- /package/{pinyin → pinyin-match}/core.d.ts +0 -0
- /package/{pinyin → pinyin-match}/simplified.d.ts +0 -0
- /package/{pinyin → pinyin-match}/simplified_dict.d.ts +0 -0
- /package/{pinyin → pinyin-match}/traditional.d.ts +0 -0
- /package/{pinyin → pinyin-match}/traditional_dict.d.ts +0 -0
package/pinyin/LICENSE
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2022-present zh-lx
|
|
4
4
|
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
the Software without restriction, including without limitation the rights
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
the Software, and to permit persons to whom the Software is
|
|
10
|
-
subject to the following conditions:
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
11
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/pinyin/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './lib';
|
|
2
|
+
export { pinyin as default } from './lib';
|
package/pinyin/index.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-05-
|
|
2
|
-
import e from "./
|
|
3
|
-
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { clearCustomDict as e, customPinyin as t } from "./lib/core/custom/index.js";
|
|
3
|
+
import { addTraditionalDict as n, getTraditionalDict as r } from "./lib/core/traditional/index.js";
|
|
4
|
+
import { getFinalParts as i, getInitialAndFinal as a, getNumOfTone as o } from "./lib/core/pinyin/handle.js";
|
|
5
|
+
import { convert as s } from "./lib/core/convert/index.js";
|
|
6
|
+
import { addDict as c, removeDict as l } from "./lib/core/dict/index.js";
|
|
7
|
+
import { pinyin as u } from "./lib/core/pinyin/index.js";
|
|
8
|
+
import { html as d } from "./lib/core/html/index.js";
|
|
9
|
+
import { match as f } from "./lib/core/match/index.js";
|
|
10
|
+
import { polyphonic as p } from "./lib/core/polyphonic/index.js";
|
|
11
|
+
import { OutputFormat as m } from "./lib/core/segment/middlewares.js";
|
|
12
|
+
import { segment as h } from "./lib/core/segment/index.js";
|
|
13
|
+
import "./lib/index.js";
|
|
14
|
+
export { m as OutputFormat, c as addDict, n as addTraditionalDict, e as clearCustomDict, s as convert, t as customPinyin, u as default, i as getFinalParts, a as getInitialAndFinal, o as getNumOfTone, r as getTraditionalDict, d as html, f as match, u as pinyin, p as polyphonic, l as removeDict, h as segment };
|
|
4
15
|
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DoubleUnicodePrefixReg: RegExp;
|
|
2
|
+
export declare const DoubleUnicodeSuffixReg: RegExp;
|
|
3
|
+
export declare const DoubleUnicodeReg: RegExp;
|
|
4
|
+
export declare const DoubleUnicodeCharReg: RegExp;
|
|
5
|
+
export declare const Probability: {
|
|
6
|
+
readonly Unknown: 1e-13;
|
|
7
|
+
readonly Rule: 1e-12;
|
|
8
|
+
readonly DICT: 2e-8;
|
|
9
|
+
readonly Surname: 1;
|
|
10
|
+
readonly Custom: 1;
|
|
11
|
+
};
|
|
12
|
+
export declare const Priority: {
|
|
13
|
+
Normal: number;
|
|
14
|
+
Surname: number;
|
|
15
|
+
Custom: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
//#region utils/pinyin/lib/common/constant.ts
|
|
3
|
+
var e = /^[\uD800-\uDBFF]$/, t = /^[\uDC00-\uDFFF]$/, n = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, r = {
|
|
4
|
+
Unknown: 1e-13,
|
|
5
|
+
Rule: 1e-12,
|
|
6
|
+
DICT: 2e-8,
|
|
7
|
+
Surname: 1,
|
|
8
|
+
Custom: 1
|
|
9
|
+
}, i = {
|
|
10
|
+
Normal: 1,
|
|
11
|
+
Surname: 10,
|
|
12
|
+
Custom: 100
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as DoubleUnicodePrefixReg, n as DoubleUnicodeReg, t as DoubleUnicodeSuffixReg, i as Priority, r as Probability };
|
|
16
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SurnameMode } from '../type';
|
|
2
|
+
import type { MatchPattern, Pattern } from './TrieNode';
|
|
3
|
+
import { TokenizationAlgorithm, TrieNode } from './TrieNode';
|
|
4
|
+
export declare class AC {
|
|
5
|
+
root: TrieNode;
|
|
6
|
+
dictMap: Map<string | symbol, Set<Pattern>>;
|
|
7
|
+
queues: TrieNode[][];
|
|
8
|
+
constructor();
|
|
9
|
+
build(patternList: Pattern[]): void;
|
|
10
|
+
buildTrie(patternList: Pattern[]): void;
|
|
11
|
+
buildFailPointer(): void;
|
|
12
|
+
addPatternToDictMap(pattern: Pattern): void;
|
|
13
|
+
addNodeToQueues(trieNode: TrieNode): void;
|
|
14
|
+
insertPattern(patterns: Pattern[], pattern: Pattern): void;
|
|
15
|
+
removeDict(dictName: string | symbol): void;
|
|
16
|
+
match(text: string, surname: SurnameMode): MatchPattern[];
|
|
17
|
+
search(text: string, surname: SurnameMode, algorithm?: TokenizationAlgorithm): MatchPattern[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { Priority as e } from "../constant.js";
|
|
3
|
+
import { splitString as t, stringLength as n } from "../utils.js";
|
|
4
|
+
import { maxProbability as r } from "./max-probability.js";
|
|
5
|
+
import { minTokenization as i } from "./min-tokenization.js";
|
|
6
|
+
import { reverseMaxMatch as a } from "./reverse-max-match.js";
|
|
7
|
+
import { TokenizationAlgorithm as o, TrieNode as s } from "./TrieNode.js";
|
|
8
|
+
//#region utils/pinyin/lib/common/segmentit/AC.ts
|
|
9
|
+
var c = class {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.dictMap = /* @__PURE__ */ new Map(), this.queues = [], this.root = new s(null);
|
|
12
|
+
}
|
|
13
|
+
build(e) {
|
|
14
|
+
this.buildTrie(e), this.buildFailPointer();
|
|
15
|
+
}
|
|
16
|
+
buildTrie(e) {
|
|
17
|
+
for (let n of e) {
|
|
18
|
+
let e = t(n.zh), r = this.root;
|
|
19
|
+
for (let t = 0; t < e.length; t++) {
|
|
20
|
+
let n = e[t];
|
|
21
|
+
if (!r.children.has(n)) {
|
|
22
|
+
let i = new s(r, e.slice(0, t).join(""), n);
|
|
23
|
+
r.children.set(n, i), this.addNodeToQueues(i);
|
|
24
|
+
}
|
|
25
|
+
r = r.children.get(n);
|
|
26
|
+
}
|
|
27
|
+
this.insertPattern(r.patterns, n), n.node = r, this.addPatternToDictMap(n);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
buildFailPointer() {
|
|
31
|
+
let e = [], t = 0;
|
|
32
|
+
for (this.queues.forEach((t) => {
|
|
33
|
+
e = e.concat(t);
|
|
34
|
+
}), this.queues = []; e.length > t;) {
|
|
35
|
+
let n = e[t++], r = n.parent && n.parent.fail, i = n.key;
|
|
36
|
+
for (; r && !r.children.has(i);) r = r.fail;
|
|
37
|
+
r ? n.fail = r.children.get(i) : n.fail = this.root;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
addPatternToDictMap(e) {
|
|
41
|
+
this.dictMap.has(e.dict) || this.dictMap.set(e.dict, /* @__PURE__ */ new Set()), this.dictMap.get(e.dict).add(e);
|
|
42
|
+
}
|
|
43
|
+
addNodeToQueues(e) {
|
|
44
|
+
this.queues[n(e.prefix)] || (this.queues[n(e.prefix)] = []), this.queues[n(e.prefix)].push(e);
|
|
45
|
+
}
|
|
46
|
+
insertPattern(e, t) {
|
|
47
|
+
for (let n = e.length - 1; n >= 0; n--) {
|
|
48
|
+
let r = e[n];
|
|
49
|
+
if (t.priority === r.priority && t.probability >= r.probability) e[n + 1] = r;
|
|
50
|
+
else if (t.priority > r.priority) e[n + 1] = r;
|
|
51
|
+
else {
|
|
52
|
+
e[n + 1] = t;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
e[0] = t;
|
|
57
|
+
}
|
|
58
|
+
removeDict(e) {
|
|
59
|
+
this.dictMap.has(e) && (this.dictMap.get(e).forEach((e) => {
|
|
60
|
+
e.node.patterns = e.node.patterns.filter((t) => t !== e);
|
|
61
|
+
}), this.dictMap.delete(e));
|
|
62
|
+
}
|
|
63
|
+
match(n, r) {
|
|
64
|
+
let i = this.root, a = [], o = t(n);
|
|
65
|
+
for (let t = 0; t < o.length; t++) {
|
|
66
|
+
let n = o[t];
|
|
67
|
+
for (; i !== null && !i.children.has(n);) i = i.fail;
|
|
68
|
+
if (i === null) i = this.root;
|
|
69
|
+
else {
|
|
70
|
+
i = i.children.get(n);
|
|
71
|
+
let o = i.patterns.find((n) => r === "off" ? n.priority !== e.Surname : r === "head" ? n.length - 1 - t == 0 : !0);
|
|
72
|
+
o && a.push({
|
|
73
|
+
...o,
|
|
74
|
+
index: t - o.length + 1
|
|
75
|
+
});
|
|
76
|
+
let s = i.fail;
|
|
77
|
+
for (; s !== null;) {
|
|
78
|
+
let n = s.patterns.find((n) => r === "off" ? n.priority !== e.Surname : r === "head" ? n.length - 1 - t == 0 : !0);
|
|
79
|
+
n && a.push({
|
|
80
|
+
...n,
|
|
81
|
+
index: t - n.length + 1
|
|
82
|
+
}), s = s.fail;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return a;
|
|
87
|
+
}
|
|
88
|
+
search(e, t, s = o.MaxProbability) {
|
|
89
|
+
let c = this.match(e, t);
|
|
90
|
+
return s === o.ReverseMaxMatch ? a(c) : s === o.MinTokenization ? i(c, n(e)) : r(c, n(e));
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { c as AC };
|
|
95
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const enum TokenizationAlgorithm {
|
|
2
|
+
ReverseMaxMatch = 1,
|
|
3
|
+
MaxProbability = 2,
|
|
4
|
+
MinTokenization = 3
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @description: AC 自动机
|
|
8
|
+
*/
|
|
9
|
+
export interface Pattern {
|
|
10
|
+
zh: string;
|
|
11
|
+
pinyin: string;
|
|
12
|
+
probability: number;
|
|
13
|
+
length: number;
|
|
14
|
+
priority: number;
|
|
15
|
+
dict: string | symbol;
|
|
16
|
+
pos?: string;
|
|
17
|
+
node?: TrieNode;
|
|
18
|
+
}
|
|
19
|
+
export interface MatchPattern extends Pattern {
|
|
20
|
+
index: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class TrieNode {
|
|
23
|
+
children: Map<string, TrieNode>;
|
|
24
|
+
fail: TrieNode | null;
|
|
25
|
+
patterns: Pattern[];
|
|
26
|
+
prefix: string;
|
|
27
|
+
parent: TrieNode | null;
|
|
28
|
+
key: string;
|
|
29
|
+
constructor(parent: TrieNode | null, prefix?: string, key?: string);
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
//#region utils/pinyin/lib/common/segmentit/TrieNode.ts
|
|
3
|
+
var e = /* @__PURE__ */ function(e) {
|
|
4
|
+
return e[e.ReverseMaxMatch = 1] = "ReverseMaxMatch", e[e.MaxProbability = 2] = "MaxProbability", e[e.MinTokenization = 3] = "MinTokenization", e;
|
|
5
|
+
}({}), t = class {
|
|
6
|
+
constructor(e, t = "", n = "") {
|
|
7
|
+
this.children = /* @__PURE__ */ new Map(), this.fail = null, this.patterns = [], this.parent = e, this.prefix = t, this.key = n;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as TokenizationAlgorithm, t as TrieNode };
|
|
12
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { Pattern2 as e } from "../../data/dict2.js";
|
|
3
|
+
import { Pattern3 as t } from "../../data/dict3.js";
|
|
4
|
+
import { Pattern4 as n } from "../../data/dict4.js";
|
|
5
|
+
import { Pattern5 as r } from "../../data/dict5.js";
|
|
6
|
+
import { PatternNumberDict as i } from "../../data/special.js";
|
|
7
|
+
import { PatternSurname as a } from "../../data/surname.js";
|
|
8
|
+
import { AC as o } from "./AC.js";
|
|
9
|
+
//#region utils/pinyin/lib/common/segmentit/index.ts
|
|
10
|
+
var s = [
|
|
11
|
+
...r,
|
|
12
|
+
...n,
|
|
13
|
+
...t,
|
|
14
|
+
...e,
|
|
15
|
+
...i,
|
|
16
|
+
...a
|
|
17
|
+
], c = new o();
|
|
18
|
+
c.build(s);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { c as acTree };
|
|
21
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { Priority as e, Probability as t } from "../constant.js";
|
|
3
|
+
//#region utils/pinyin/lib/common/segmentit/max-probability.ts
|
|
4
|
+
function n(e, t) {
|
|
5
|
+
return e && (e.decimal < t.decimal || e.decimal === t.decimal && e.probability > t.probability) ? e : t;
|
|
6
|
+
}
|
|
7
|
+
function r(e) {
|
|
8
|
+
e.probability < 1e-300 && (e.probability *= 1e300, e.decimal += 1);
|
|
9
|
+
}
|
|
10
|
+
function i(t) {
|
|
11
|
+
return t.priority === e.Custom ? -(t.length * t.length * 100) : t.priority === e.Surname ? -(t.length * t.length * 10) : 0;
|
|
12
|
+
}
|
|
13
|
+
function a(e, a) {
|
|
14
|
+
let o = [], s = e.length - 1, c = e[s];
|
|
15
|
+
for (let l = a - 1; l >= 0; l--) {
|
|
16
|
+
let u = l + 1 >= a ? {
|
|
17
|
+
probability: 1,
|
|
18
|
+
decimal: 0,
|
|
19
|
+
patterns: []
|
|
20
|
+
} : o[l + 1];
|
|
21
|
+
for (; c && c.index + c.length - 1 === l;) {
|
|
22
|
+
let t = c.index, a = {
|
|
23
|
+
probability: c.probability * u.probability,
|
|
24
|
+
decimal: u.decimal + i(c),
|
|
25
|
+
patterns: u.patterns,
|
|
26
|
+
concatPattern: c
|
|
27
|
+
};
|
|
28
|
+
r(a), o[t] = n(o[t], a), c = e[--s];
|
|
29
|
+
}
|
|
30
|
+
let d = {
|
|
31
|
+
probability: t.Unknown * u.probability,
|
|
32
|
+
decimal: 0,
|
|
33
|
+
patterns: u.patterns
|
|
34
|
+
};
|
|
35
|
+
r(d), o[l] = n(o[l], d), o[l].concatPattern && (o[l].patterns = o[l].patterns.concat(o[l].concatPattern), o[l].concatPattern = void 0, delete o[l + 1]);
|
|
36
|
+
}
|
|
37
|
+
return o[0].patterns.reverse();
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { a as maxProbability };
|
|
41
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { Priority as e } from "../constant.js";
|
|
3
|
+
//#region utils/pinyin/lib/common/segmentit/min-tokenization.ts
|
|
4
|
+
function t(e, t) {
|
|
5
|
+
return e && e.count <= t.count ? e : t;
|
|
6
|
+
}
|
|
7
|
+
function n(t) {
|
|
8
|
+
return t.priority === e.Custom ? -(t.length * t.length * 1e5) : t.priority === e.Surname ? -(t.length * t.length * 100) : 1;
|
|
9
|
+
}
|
|
10
|
+
function r(e, r) {
|
|
11
|
+
let i = [], a = e.length - 1, o = e[a];
|
|
12
|
+
for (let s = r - 1; s >= 0; s--) {
|
|
13
|
+
let c = s + 1 >= r ? {
|
|
14
|
+
count: 0,
|
|
15
|
+
patterns: []
|
|
16
|
+
} : i[s + 1];
|
|
17
|
+
for (; o && o.index + o.length - 1 === s;) {
|
|
18
|
+
let r = o.index, s = {
|
|
19
|
+
count: n(o) + c.count,
|
|
20
|
+
patterns: c.patterns,
|
|
21
|
+
concatPattern: o
|
|
22
|
+
};
|
|
23
|
+
i[r] = t(i[r], s), o = e[--a];
|
|
24
|
+
}
|
|
25
|
+
let l = {
|
|
26
|
+
count: 1 + c.count,
|
|
27
|
+
patterns: c.patterns
|
|
28
|
+
};
|
|
29
|
+
i[s] = t(i[s], l), i[s].concatPattern && (i[s].patterns = i[s].patterns.concat(i[s].concatPattern), i[s].concatPattern = void 0, delete i[s + 1]);
|
|
30
|
+
}
|
|
31
|
+
return i[0].patterns.reverse();
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { r as minTokenization };
|
|
35
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
//#region utils/pinyin/lib/common/segmentit/reverse-max-match.ts
|
|
3
|
+
function e(e, t) {
|
|
4
|
+
return !(t.index + t.length <= e.index || t.priority > e.priority || t.priority === e.priority && t.length > e.length);
|
|
5
|
+
}
|
|
6
|
+
function t(t) {
|
|
7
|
+
let n = [];
|
|
8
|
+
for (let r = t.length - 1; r >= 0;) {
|
|
9
|
+
let { index: i } = t[r], a = r - 1;
|
|
10
|
+
for (; a >= 0 && e(t[r], t[a]);) a--;
|
|
11
|
+
(a < 0 || t[a].index + t[a].length <= i) && n.push(t[r]), r = a;
|
|
12
|
+
}
|
|
13
|
+
return n.reverse();
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as reverseMaxMatch };
|
|
17
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface SingleWordResult {
|
|
2
|
+
origin: string;
|
|
3
|
+
originPinyin: string;
|
|
4
|
+
result: string;
|
|
5
|
+
isZh: boolean;
|
|
6
|
+
delete?: boolean;
|
|
7
|
+
traditional?: string;
|
|
8
|
+
}
|
|
9
|
+
export type ToneType = 'symbol' | 'num' | 'none';
|
|
10
|
+
export type PinyinMode = 'normal' | 'surname';
|
|
11
|
+
export type SurnameMode = 'all' | 'head' | 'off';
|
|
12
|
+
export type InitialPattern = 'yw' | 'standard';
|
|
13
|
+
export type CommonOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* @description 返回的拼音音调类型
|
|
16
|
+
* @value symbol:在字母上加音调 (默认值)
|
|
17
|
+
* @value num:以数字格式展示音调,并跟在拼音后面
|
|
18
|
+
* @value none:不展示音调
|
|
19
|
+
*/
|
|
20
|
+
toneType?: 'symbol' | 'num' | 'none';
|
|
21
|
+
/**
|
|
22
|
+
* @description 返回的拼音格式类型
|
|
23
|
+
* @value pinyin:返回完整拼音 (默认值)
|
|
24
|
+
* @value initial:返回声母
|
|
25
|
+
* @value final:返回韵母
|
|
26
|
+
* @value num:返回音调对应的数字
|
|
27
|
+
* @value first:返回首字母
|
|
28
|
+
* @value finalHead:返回韵头(介音)
|
|
29
|
+
* @value finalBody:返回韵腹
|
|
30
|
+
* @value finalTail:返回韵尾
|
|
31
|
+
*/
|
|
32
|
+
pattern?: 'pinyin' | 'initial' | 'final' | 'num' | 'first' | 'finalHead' | 'finalBody' | 'finalTail';
|
|
33
|
+
/**
|
|
34
|
+
* @description 是否移除非汉字字符(推荐使用 removeNonZh: removed 代替)
|
|
35
|
+
* @value false:返回结果保留非汉字字符 (默认值)
|
|
36
|
+
* @value true:返回结果移除非汉字字符
|
|
37
|
+
*/
|
|
38
|
+
removeNonZh?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @description 非汉字字符的间距格式
|
|
41
|
+
* @value spaced:连续非汉字字符之间用空格隔开 (默认值)
|
|
42
|
+
* @value consecutive:连续非汉字字符无间距
|
|
43
|
+
* @value removed:返回结果移除非汉字字符
|
|
44
|
+
*/
|
|
45
|
+
nonZh?: 'spaced' | 'consecutive' | 'removed';
|
|
46
|
+
/**
|
|
47
|
+
* @description nonZh 生效范围的正则表达式
|
|
48
|
+
*/
|
|
49
|
+
nonZhScope?: RegExp;
|
|
50
|
+
/**
|
|
51
|
+
* @description 对于 ü 的返回是否转换成 v(仅在 toneType: none 启用时生效)
|
|
52
|
+
* @value false:返回值中保留 ü (默认值)
|
|
53
|
+
* @value true:返回值中 ü 转换成 v
|
|
54
|
+
* @value string:返回值中 ü 转换成指定字符
|
|
55
|
+
*/
|
|
56
|
+
v?: boolean | string;
|
|
57
|
+
/**
|
|
58
|
+
* @description 是否将 `y`、`w` 视为声母
|
|
59
|
+
* @value yw:将 `y`、`w` 视为声母
|
|
60
|
+
* @value standard:不将 `y`、`w` 视为声母
|
|
61
|
+
*/
|
|
62
|
+
initialPattern?: InitialPattern;
|
|
63
|
+
/**
|
|
64
|
+
* @description 是否启用繁体字模式(可以更好地识别繁体字)
|
|
65
|
+
* @value false:不启用繁体字模式 (默认值)
|
|
66
|
+
* @value true:启用繁体字模式
|
|
67
|
+
*/
|
|
68
|
+
traditional?: boolean;
|
|
69
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function stringLength(text: string): number;
|
|
2
|
+
export declare function splitString(text: string): string[];
|
|
3
|
+
export declare class FastDictFactory {
|
|
4
|
+
NumberDICT: string[];
|
|
5
|
+
StringDICT: Map<string, string>;
|
|
6
|
+
constructor();
|
|
7
|
+
get(word: string): string;
|
|
8
|
+
set(word: string, pinyin: string): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { DoubleUnicodePrefixReg as e, DoubleUnicodeReg as t, DoubleUnicodeSuffixReg as n } from "./constant.js";
|
|
3
|
+
//#region utils/pinyin/lib/common/utils.ts
|
|
4
|
+
function r(e) {
|
|
5
|
+
return e.length - (e.match(t)?.length || 0);
|
|
6
|
+
}
|
|
7
|
+
function i(t) {
|
|
8
|
+
let r = [], i = 0;
|
|
9
|
+
for (; i < t.length;) {
|
|
10
|
+
let a = t[i];
|
|
11
|
+
e.test(a) && n.test(t[i + 1]) ? (r.push(t.substring(i, i + 2)), i += 2) : (r.push(a), i += 1);
|
|
12
|
+
}
|
|
13
|
+
return r;
|
|
14
|
+
}
|
|
15
|
+
var a = class {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.NumberDICT = [], this.StringDICT = /* @__PURE__ */ new Map();
|
|
18
|
+
}
|
|
19
|
+
get(e) {
|
|
20
|
+
if (e.length > 1) return this.StringDICT.get(e);
|
|
21
|
+
{
|
|
22
|
+
let t = e.charCodeAt(0);
|
|
23
|
+
return this.NumberDICT[t];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
set(e, t) {
|
|
27
|
+
if (e.length > 1) this.StringDICT.set(e, t);
|
|
28
|
+
else {
|
|
29
|
+
let n = e.charCodeAt(0);
|
|
30
|
+
this.NumberDICT[n] = t;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
clear() {
|
|
34
|
+
this.NumberDICT = [], this.StringDICT.clear();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { a as FastDictFactory, i as splitString, r as stringLength };
|
|
39
|
+
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type ConvertFormat = 'numToSymbol' | 'symbolToNum' | 'toneNone';
|
|
2
|
+
interface ConvertOptions {
|
|
3
|
+
/**
|
|
4
|
+
* @description 拼音之间的分隔符,默认为空格,convert方法会以该分隔符分割拼音进行转换
|
|
5
|
+
*/
|
|
6
|
+
separator?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @description 转换的格式, 默认为 numToSymbol
|
|
9
|
+
* @example numToSymbol: pin1 yin1 -> pīn yīn
|
|
10
|
+
* @example symbolToNum: pīn yīn -> pin1 yin1
|
|
11
|
+
* @example toneNone: pīn yīn -> pin yin
|
|
12
|
+
*/
|
|
13
|
+
format?: ConvertFormat;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @description: 拼音格式转换。pin1 yin1 -> pīn yīn 或 pīn yīn -> pin1 yin1 或 pīn yīn -> pin yin
|
|
17
|
+
* @param {string} pinyin 要转换的拼音字符串或者拼音字符串数组
|
|
18
|
+
* @param {ConvertOptions=} options 配置项
|
|
19
|
+
* @return {string} 转换后的拼音字符串或者拼音字符串数组
|
|
20
|
+
*/
|
|
21
|
+
declare function convert(pinyin: string, options?: ConvertOptions): string;
|
|
22
|
+
/**
|
|
23
|
+
* @description: 拼音格式转换。pin1 yin1 -> pīn yīn 或 pīn yīn -> pin1 yin1 或 pīn yīn -> pin yin
|
|
24
|
+
* @param {string[]} pinyin 要转换的拼音字符串或者拼音字符串数组
|
|
25
|
+
* @param {ConvertOptions=} options 配置项
|
|
26
|
+
* @return {string[]} 转换后的拼音字符串或者拼音字符串数组
|
|
27
|
+
*/
|
|
28
|
+
declare function convert(pinyin: string[], options?: ConvertOptions): string[];
|
|
29
|
+
export { convert };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* 潘启宝 2026-05-26 15:49:57 星期二 山东省济南市 */
|
|
2
|
+
import { getNumOfTone as e, getPinyinWithoutTone as t } from "../pinyin/handle.js";
|
|
3
|
+
//#region utils/pinyin/lib/core/convert/index.ts
|
|
4
|
+
var n = {
|
|
5
|
+
separator: " ",
|
|
6
|
+
format: "numToSymbol"
|
|
7
|
+
}, r = {
|
|
8
|
+
a: [
|
|
9
|
+
"a",
|
|
10
|
+
"ā",
|
|
11
|
+
"á",
|
|
12
|
+
"ǎ",
|
|
13
|
+
"à"
|
|
14
|
+
],
|
|
15
|
+
o: [
|
|
16
|
+
"o",
|
|
17
|
+
"ō",
|
|
18
|
+
"ó",
|
|
19
|
+
"ǒ",
|
|
20
|
+
"ò"
|
|
21
|
+
],
|
|
22
|
+
e: [
|
|
23
|
+
"e",
|
|
24
|
+
"ē",
|
|
25
|
+
"é",
|
|
26
|
+
"ě",
|
|
27
|
+
"è"
|
|
28
|
+
],
|
|
29
|
+
ü: [
|
|
30
|
+
"ü",
|
|
31
|
+
"ǖ",
|
|
32
|
+
"ǘ",
|
|
33
|
+
"ǚ",
|
|
34
|
+
"ǜ"
|
|
35
|
+
],
|
|
36
|
+
v: [
|
|
37
|
+
"ü",
|
|
38
|
+
"ǖ",
|
|
39
|
+
"ǘ",
|
|
40
|
+
"ǚ",
|
|
41
|
+
"ǜ"
|
|
42
|
+
],
|
|
43
|
+
ui: [
|
|
44
|
+
"ui",
|
|
45
|
+
"uī",
|
|
46
|
+
"uí",
|
|
47
|
+
"uǐ",
|
|
48
|
+
"uì"
|
|
49
|
+
],
|
|
50
|
+
iu: [
|
|
51
|
+
"iu",
|
|
52
|
+
"iū",
|
|
53
|
+
"iú",
|
|
54
|
+
"iǔ",
|
|
55
|
+
"iù"
|
|
56
|
+
],
|
|
57
|
+
i: [
|
|
58
|
+
"i",
|
|
59
|
+
"ī",
|
|
60
|
+
"í",
|
|
61
|
+
"ǐ",
|
|
62
|
+
"ì"
|
|
63
|
+
],
|
|
64
|
+
u: [
|
|
65
|
+
"u",
|
|
66
|
+
"ū",
|
|
67
|
+
"ú",
|
|
68
|
+
"ǔ",
|
|
69
|
+
"ù"
|
|
70
|
+
],
|
|
71
|
+
n: [
|
|
72
|
+
"n",
|
|
73
|
+
"n̄",
|
|
74
|
+
"ń",
|
|
75
|
+
"ň",
|
|
76
|
+
"ǹ"
|
|
77
|
+
],
|
|
78
|
+
m: [
|
|
79
|
+
"m",
|
|
80
|
+
"m̄",
|
|
81
|
+
"ḿ",
|
|
82
|
+
"m̌",
|
|
83
|
+
"m̀"
|
|
84
|
+
],
|
|
85
|
+
ê: [
|
|
86
|
+
"ê",
|
|
87
|
+
"ê̄",
|
|
88
|
+
"ế",
|
|
89
|
+
"ê̌",
|
|
90
|
+
"ề"
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
function i(e, t) {
|
|
94
|
+
t = {
|
|
95
|
+
...n,
|
|
96
|
+
...t || {}
|
|
97
|
+
};
|
|
98
|
+
let r = typeof e;
|
|
99
|
+
return typeof e == "string" && (e = e.split(t.separator)), e = e.map((e) => {
|
|
100
|
+
let n = t.format;
|
|
101
|
+
return n === "numToSymbol" ? a(e) : n === "symbolToNum" ? o(e) : n === "toneNone" ? s(e) : e;
|
|
102
|
+
}), r === "string" ? e.join(t.separator) : e;
|
|
103
|
+
}
|
|
104
|
+
function a(e) {
|
|
105
|
+
let t = "";
|
|
106
|
+
if (e.length > 2 && e.endsWith("r")) {
|
|
107
|
+
let n = Number(e[e.length - 2]);
|
|
108
|
+
n >= 0 && n <= 4 && (t = "r", e = e.slice(0, -1));
|
|
109
|
+
}
|
|
110
|
+
let n = Number(e[e.length - 1]);
|
|
111
|
+
if (n >= 0 && n <= 4) {
|
|
112
|
+
for (let i in r) if (e.includes(i)) return e.slice(0, e.length - 1).replace(i, r[i][n]) + t;
|
|
113
|
+
return e + t;
|
|
114
|
+
} else return e + t;
|
|
115
|
+
}
|
|
116
|
+
function o(n) {
|
|
117
|
+
if (n.endsWith("r") && n.length > 1 && !/^[eēéěè]r$/.test(n)) {
|
|
118
|
+
let r = n.slice(0, -1), i = e(r);
|
|
119
|
+
if (i !== "" && i !== "0") return `${t(r)}${i}r`;
|
|
120
|
+
}
|
|
121
|
+
return `${t(n)}${e(n)}`;
|
|
122
|
+
}
|
|
123
|
+
function s(e) {
|
|
124
|
+
return t(e);
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { i as convert };
|
|
128
|
+
/* 独立思考,明辨是非 */
|