Skip to content

Revert "test(utils): add vitest for utils package" #2812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type {
} from '../file-upload'

import { extend } from '@mobile-root/utils/object'
import { xss, log } from '@mobile-root/utils'
import { xss, log } from '@mobile-root/utils/xss'
import uploadAjax from '@mobile-root/utils/deps/upload-ajax'
import { isObject } from '@mobile-root/utils/type'
import { isEmptyObject } from '@mobile-root/utils/type'
Expand Down Expand Up @@ -577,7 +577,7 @@ export const handleStart =
state,
vm
}: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'props' | 'state' | 'vm'>) =>
(rawFiles: IFileUploadFile[], updateId: string, reUpload = false) => {
(rawFiles: IFileUploadFile[], updateId: string, reUpload: boolean = false) => {
if (state.isHwh5) {
rawFiles = handleHwh5Files(rawFiles, props.hwh5)
}
Expand Down Expand Up @@ -921,7 +921,7 @@ export const abort =

export const abortDownload =
({ state }: Pick<IFileUploadRenderlessParams, 'state'>) =>
(file: IFileUploadFile, batch = false) => {
(file: IFileUploadFile, batch: boolean = false) => {
const cancel = (docId) => {
if (!docId) return
const cancels = state.downloadCancelToken[docId]
Expand Down Expand Up @@ -2246,7 +2246,7 @@ export const getToken =

export const previewFile =
({ api, props }: Pick<IFileUploadRenderlessParams, 'api' | 'props'>) =>
(file: IFileUploadFile, open = false) => {
(file: IFileUploadFile, open: boolean = false) => {
return new Promise((resolve, reject) => {
try {
const tokenParams = { isOnlinePreview: true, file, type: 'preview', token: props.edm.preview.token }
Expand Down
6 changes: 5 additions & 1 deletion packages/renderless/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

import { xss } from '@opentiny/utils'
import { log as uLog, xss } from '@opentiny/utils'

export const KEY_CODE = {
Backspace: 8,
Expand Down Expand Up @@ -264,4 +264,8 @@ export const CASCADER = {

export const version = process.env.RUNTIME_VERSION

export const log = (data, type = 'log') => {
uLog.logger[type](data)
}

export { xss }
2 changes: 1 addition & 1 deletion packages/renderless/src/tree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { on, off } from '../common/deps/dom'
import { getDataset } from '../common/dataset'
import { copyArray } from '../common/object'

import { log } from '@opentiny/utils'
import { log } from '../common'

export const setChildren = (props) => (data) => (props.data = data)

Expand Down
6 changes: 1 addition & 5 deletions packages/utils/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
## 安装

```bash
npm install --save @opentiny/utils
```
# @opentiny/utils
8 changes: 3 additions & 5 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@opentiny/utils",
"type": "module",
"version": "1.0.0",
"description": "nanoid console xss",
"author": "",
"license": "ISC",
"type": "module",
"repository": {
"type": "git",
"url": "git@github.com:opentiny/tiny-vue.git"
Expand All @@ -16,16 +16,14 @@
],
"scripts": {
"build": "vite build",
"pub": "pnpm publish --no-git-checks --access=public",
"test": "vitest"
"pub": "pnpm publish --no-git-checks --access=public"
},
"dependencies": {
"xss": "1.0.14"
},
"devDependencies": {
"typescript": "catalog:",
"vite": "catalog:",
"vite-plugin-dts": "~4.3.0",
"vitest": "catalog:"
"vite": "catalog:"
}
}

This file was deleted.

7 changes: 0 additions & 7 deletions packages/utils/src/crypt/__test__/crypt.test.ts

This file was deleted.

Loading
Loading