Skip to content

Commit

Permalink
feat: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chaxus committed Sep 22, 2023
1 parent 811e2a4 commit c374c34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
15 changes: 9 additions & 6 deletions packages/ranui/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const requestFile = (
options: Partial<Url2FileOption> = {},
): Promise<File> => {
const {
onProgress = () => {},
onProgress = () => { },
headers = {},
responseType = 'blob',
method = 'GET',
Expand Down Expand Up @@ -177,7 +177,7 @@ export const getPixelRatio = (
}

export interface CustomErrorType {
new (m: string): void
new(m: string): void
}

export function createCustomError(msg: string): CustomErrorType {
Expand All @@ -194,9 +194,12 @@ export function createCustomError(msg: string): CustomErrorType {
* @return {*}
*/
export const presentDevice = (function () {
const ua = navigator.userAgent.toLowerCase()
if (/ipad|ipod/.test(ua)) return 'ipad'
if (/android/.test(ua)) return 'android'
if (/iphone/.test(ua)) return 'iphone'
if (typeof window !== 'undefined') {
const ua = navigator.userAgent.toLowerCase()
if (/ipad|ipod/.test(ua)) return 'ipad'
if (/android/.test(ua)) return 'android'
if (/iphone/.test(ua)) return 'iphone'
return 'pc'
}
return 'pc'
})()
11 changes: 5 additions & 6 deletions packages/ranuts/test/arithmetic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { describe, expect, it } from 'vitest'
import randomArray from '../src/sort/randomArray'
import { MinHeap } from '../src/arithmetic/index'

// describe('Heap', () => {
// it('Heap sort', () => {
describe('Heap', () => {
it('Heap sort', () => {
const list = randomArray(20)
const { arr } = new MinHeap(list)
console.log('arr-->',list, arr, [...list].sort((a, b) => a - b));
// expect(arr).toEqual([...list].sort((a, b) => a - b))
// })
// })
expect(arr).toEqual([...list].sort((a, b) => a - b))
})
})

0 comments on commit c374c34

Please sign in to comment.