valaxy-theme-hairy 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,8 @@
2
2
  import { computed, provide, useCssVars, useSlots } from 'vue'
3
3
  import { executeOverlay } from 'unoverlay-vue'
4
4
  import type { ImageViewerProps } from 'element-plus/es/components/image-viewer/index'
5
- import type { AtWillNumber } from '@hairy/libcore'
6
- import { atWillToUnit } from '@hairy/libcore'
5
+ import type { AtWillNumber } from '../utils'
6
+ import { atWillToUnit } from '../utils'
7
7
  import HairyImageViewer from './HairyImageViewer.vue'
8
8
 
9
9
  const props = withDefaults(defineProps<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "packageManager": "pnpm@7.5.0",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
@@ -21,7 +21,6 @@
21
21
  "dependencies": {
22
22
  "@docsearch/css": "^3.1.1",
23
23
  "@docsearch/js": "^3.1.1",
24
- "@hairy/libcore": "^0.3.0",
25
24
  "@hairy/vue-use": "^1.2.0",
26
25
  "@iconify-json/ant-design": "^1.1.3",
27
26
  "@iconify-json/simple-icons": "^1.1.19",
package/utils/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { isNumber, isString } from 'lodash-es'
2
+
1
3
  /**
2
4
  * 跳转到新的页面
3
5
  * @param url 跳转url
@@ -26,3 +28,11 @@ export const toArr = <T>(arr: T[] | T): T[] => {
26
28
  return arr as any
27
29
  else return [arr].filter(Boolean) as any
28
30
  }
31
+
32
+ export type AtWillNumber = string | number
33
+
34
+ export const atWillToUnit = (value: AtWillNumber, unit = 'px') => {
35
+ if (!(isString(value) || isNumber(value)))
36
+ return ''
37
+ return isString(value) && /\D/g.test(value) ? value : value + unit
38
+ }