diff --git a/packages/utils/src/_getOnlyValue.ts b/packages/utils/src/_getOnlyValue.ts index fbc7911e..cbf63ef1 100644 --- a/packages/utils/src/_getOnlyValue.ts +++ b/packages/utils/src/_getOnlyValue.ts @@ -4,7 +4,7 @@ import { _pickBy } from './_pickBy'; remove null ,undefined empty string * @param values */ -export function getOnlyValue(values: T): T { +export default function _getOnlyValue(values: T): T { return _pickBy( values || {}, (v) => v !== null && v !== undefined && v !== ' ' && v !== 'null', diff --git a/packages/utils/src/_isArrary.ts b/packages/utils/src/_isArray.ts similarity index 100% rename from packages/utils/src/_isArrary.ts rename to packages/utils/src/_isArray.ts diff --git a/packages/utils/src/_isMergableObject.ts b/packages/utils/src/_isMergableObject.ts index 3a70f0d3..9538fda9 100644 --- a/packages/utils/src/_isMergableObject.ts +++ b/packages/utils/src/_isMergableObject.ts @@ -5,6 +5,6 @@ import { _isObject } from './_isObject'; * @param item * @see https://github.com/antfu/utils/blob/7570fb0dddf22d54504370c552c4b3a52389cfe6/src/object.ts#L105 */ -export default function isMergableObject(item: any): item is Object { +export default function _isMergableObject(item: any): item is Object { return _isObject(item) && !Array.isArray(item); } diff --git a/packages/utils/src/_listToFlat.ts b/packages/utils/src/_listToFlat.ts index 171772a3..c50a861a 100644 --- a/packages/utils/src/_listToFlat.ts +++ b/packages/utils/src/_listToFlat.ts @@ -9,7 +9,7 @@ import { TKeyValue } from './_types'; * @returns TKeyValue * @summary It is recommended to use with the memoize method to avoid unnecessary conversion and improve performance */ -export function listToFlat( +export default function _listToFlat( items: T[], key: string | number = 'value', text: string = 'label', diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 80227c02..a6f320f4 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -20,6 +20,54 @@ export { default as _isMobile } from './_isMobile'; export { default as _objGetOnlyValue } from './_objGetOnlyValue'; export { default as _objToUndef } from './_objToUndef'; export { _omit } from './_omit'; +export { default as _asyncSleep } from './_asyncSleep'; +export { _axios } from './_axios'; +export * from './_capitalize'; +export { default as _dateConstant } from './_constantDate'; +export { default as _constantLayout } from './_constantLayout'; +export { default as _constantsValidateAntENG } from './_constantsValidateAntENG'; +export { default as copyToClipboard } from './_copyToClipboard'; +export { default as _dataArrayToOption } from './_dataArrayToOption'; +export { _dateUtils } from './_date'; +export { default as _debugDeprecated } from './_debugDeprecated'; +export { default as _debugLogger } from './_debugLogger'; +export { default as _debugWarning } from './_debugWarning'; +export * from './_devLorem'; +export { default as _files } from './_files'; +export { default as _formatTimeMs } from './_formatTimeMs'; +export { default as getKeyNameByValue } from './_getKeyNameByValue'; +export { default as _getOnlyValue } from './_getOnlyValue'; +export * from './_isArray'; +export * from './_isBoolean'; +export * from './_isClient'; +export * from './_isEmpty'; +export * from './_isEqual'; +export * from './_isExternalLink'; +export * from './_isFunction'; +export * from './_isImg'; +export * from './_isInteger'; +export { default as _isKeyOf } from './_isKeyOf'; +export { default as _isMergableObject } from './_isMergableObject'; +export * from './_isNaN'; +export * from './_isNull'; +export * from './_isNumber'; +export * from './_isObject'; +export * from './_isPromise'; +export * from './_isRegExp'; +export * from './_isUndefined'; +export { default as _listToFlat } from './_listToFlat'; +export { default as _urlToList } from './_urlToList'; +export { default as _keyCode } from './_keyCode'; +export { default as _nanoid } from './_nanoid'; +export { _noop } from './_noop'; +export { _pickBy } from './_pickBy'; +export { default as _placeholder } from './_placeholder'; +export { default as _removeEmpty } from './_removeEmpty'; +export { default as _removeNil } from './_removeNil'; +export { default as _renameObjKeys } from './_renameObjKeys'; + +export * from './_browser'; +export * from './_authority'; // _lodash export * from './_isEmpty'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index acc9f5d3..d31de197 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2624,7 +2624,7 @@ packages: resolution: {integrity: sha512-CGulbEDcg/ND1Im7fUNRZdGXmX2MTWVVZacQi/6DiKE5HNwZ3aVTm5PV4lO8HHz0B2h8WQyvKKjbX5XgTtydsg==} engines: {node: '>=6.9.0'} dependencies: - core-js-pure: 3.26.0 + core-js-pure: 3.26.1 regenerator-runtime: 0.13.10 dev: false @@ -3777,7 +3777,7 @@ packages: /@types/is-ci/3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: - ci-info: 3.5.0 + ci-info: 3.6.1 dev: true /@types/isomorphic-fetch/0.0.35: @@ -5320,6 +5320,15 @@ packages: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 uri-js: 4.4.1 + dev: false + + /ajv/8.11.2: + resolution: {integrity: sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 /ansi-colors/4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} @@ -6319,8 +6328,9 @@ packages: /ci-info/2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} - /ci-info/3.5.0: - resolution: {integrity: sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==} + /ci-info/3.6.1: + resolution: {integrity: sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==} + engines: {node: '>=8'} dev: true /cipher-base/1.0.4: @@ -6588,8 +6598,8 @@ packages: requiresBuild: true dev: true - /core-js-pure/3.26.0: - resolution: {integrity: sha512-LiN6fylpVBVwT8twhhluD9TzXmZQQsr2I2eIKtWNbZI1XMfBT7CV18itaN6RA7EtQd/SDdRx/wzvAShX2HvhQA==} + /core-js-pure/3.26.1: + resolution: {integrity: sha512-VVXcDpp/xJ21KdULRq/lXdLzQAtX7+37LzpyfFM973il0tWSsDEoyzG38G14AjTpK9VTfiNM9jnFauq/CpaWGQ==} requiresBuild: true dev: false @@ -9671,7 +9681,7 @@ packages: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true dependencies: - ci-info: 3.5.0 + ci-info: 3.6.1 dev: true /is-core-module/2.10.0: @@ -12126,7 +12136,7 @@ packages: resolution: {integrity: sha512-C92S4sHlbDpefJ2QQJjrucCcypq3+KZPstjfuvgOCNnGx0tF9h8hXgAlOIATGAxMXZXaF+nVp+/Mi8pCAWdSmw==} engines: {node: '>=10'} dependencies: - postcss: 8.4.18 + postcss: 8.4.19 dev: false /postcss-load-config/2.1.2: @@ -12347,13 +12357,13 @@ packages: cssesc: 3.0.0 util-deprecate: 1.0.2 - /postcss-sorting/6.0.0_postcss@8.4.18: + /postcss-sorting/6.0.0_postcss@8.4.19: resolution: {integrity: sha512-bYJ0vgAiGbjCBKi7B07CzsBc9eM84nLEbavUmwNp8rAa+PNyrgdH+6PpnqTtciLuUs99c4rFQQmCaYgeBQYmSQ==} peerDependencies: postcss: ^8.0.4 dependencies: lodash: 4.17.21 - postcss: 8.4.18 + postcss: 8.4.19 dev: false /postcss-syntax/0.36.2_kei4jy7wdgbhc236h4oijypxom: @@ -12420,8 +12430,8 @@ packages: source-map-js: 1.0.2 dev: true - /postcss/8.4.18: - resolution: {integrity: sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==} + /postcss/8.4.19: + resolution: {integrity: sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.4 @@ -12494,9 +12504,9 @@ packages: peerDependencies: prettier: '>= 2.0.0' dependencies: - postcss: 8.4.18 + postcss: 8.4.19 postcss-less: 4.0.1 - postcss-sorting: 6.0.0_postcss@8.4.18 + postcss-sorting: 6.0.0_postcss@8.4.19 prettier: 2.7.1 dev: false @@ -14767,8 +14777,8 @@ packages: fsevents: 2.3.2 dev: true - /rollup/3.2.5: - resolution: {integrity: sha512-/Ha7HhVVofduy+RKWOQJrxe4Qb3xyZo+chcpYiD8SoQa4AG7llhupUtyfKSSrdBM2mWJjhM8wZwmbY23NmlIYw==} + /rollup/3.3.0: + resolution: {integrity: sha512-wqOV/vUJCYEbWsXvwCkgGWvgaEnsbn4jxBQWKpN816CqsmCimDmCNJI83c6if7QVD4v/zlyRzxN7U2yDT5rfoA==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -15650,7 +15660,7 @@ packages: resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} engines: {node: '>=10.0.0'} dependencies: - ajv: 8.11.0 + ajv: 8.11.2 lodash.truncate: 4.4.2 slice-ansi: 4.0.0 string-width: 4.2.3 @@ -15967,7 +15977,7 @@ packages: joycon: 3.1.1 postcss-load-config: 3.1.4 resolve-from: 5.0.0 - rollup: 3.2.5 + rollup: 3.3.0 source-map: 0.8.0-beta.0 sucrase: 3.28.0 tree-kill: 1.2.2