chore(deps): update dependency ohash to v2 (v3) (#3362)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
renovate[bot]
2025-03-04 16:18:54 +01:00
committed by GitHub
parent 99e531d8df
commit 3f7df7be9b
7 changed files with 30 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { murmurHash } from 'ohash'
import { hash } from 'ohash'
const props = defineProps<{
type: string
@@ -23,7 +23,7 @@ const type = computed(() => {
return type
})
const { data: ast } = await useAsyncData(`hightlight-inline-code-${murmurHash(type.value)}`, () => parseMarkdown(`\`${type.value}\`{lang="ts-type"}`))
const { data: ast } = await useAsyncData(`hightlight-inline-code-${hash(type.value).slice(0, 10)}`, () => parseMarkdown(`\`${type.value}\`{lang="ts-type"}`))
</script>
<template>

View File

@@ -106,7 +106,7 @@
"knitwork": "^1.2.0",
"magic-string": "^0.30.17",
"mlly": "^1.7.4",
"ohash": "^1.1.5",
"ohash": "^2.0.10",
"pathe": "^2.0.3",
"reka-ui": "^2.0.2",
"scule": "^1.3.0",

18
pnpm-lock.yaml generated
View File

@@ -105,8 +105,8 @@ importers:
specifier: ^1.7.4
version: 1.7.4
ohash:
specifier: ^1.1.5
version: 1.1.5
specifier: ^2.0.10
version: 2.0.10
pathe:
specifier: ^2.0.3
version: 2.0.3
@@ -5343,8 +5343,8 @@ packages:
ohash@1.1.5:
resolution: {integrity: sha512-AtXrG/lMFjPBWj3uhWYFwYVZQqutPYRsv6nnPLTipnC+gJuMFc+WFzf/jx+94Ebray1vxfQfEFDtpIpppOe4xQ==}
ohash@2.0.9:
resolution: {integrity: sha512-ljz2sybhXrRpBW9LleuJPP9uxbMKW8qxFz9lLOHW2QEel78rJ1sUgaX2cBNDt49w+JleNSkhYkVOCx6RgkKn0Q==}
ohash@2.0.10:
resolution: {integrity: sha512-jf9szh2McTXpXGqejbfHxy4wcs6CXc6MShfzLIdHuCrl2W3qG49qutlOMq1Bdmvpv3s/XJffTu4ElRBPtIOncQ==}
on-finished@2.4.1:
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
@@ -8264,7 +8264,7 @@ snapshots:
listhen: 1.9.0
nypm: 0.6.0
ofetch: 1.4.1
ohash: 2.0.9
ohash: 2.0.10
pathe: 2.0.3
perfect-debounce: 1.0.0
pkg-types: 2.0.1
@@ -10240,7 +10240,7 @@ snapshots:
giget: 1.2.5
jiti: 2.4.2
mlly: 1.7.4
ohash: 2.0.9
ohash: 2.0.10
pathe: 2.0.3
perfect-debounce: 1.0.0
pkg-types: 1.3.1
@@ -10257,7 +10257,7 @@ snapshots:
exsolve: 1.0.1
giget: 2.0.0
jiti: 2.4.2
ohash: 2.0.9
ohash: 2.0.10
pathe: 2.0.3
perfect-debounce: 1.0.0
pkg-types: 2.0.1
@@ -13022,7 +13022,7 @@ snapshots:
nuxt-site-config: 3.1.1(magicast@0.3.5)(rollup@4.32.1)(vue@3.5.13(typescript@5.6.3))
nypm: 0.6.0
ofetch: 1.4.1
ohash: 2.0.9
ohash: 2.0.10
pathe: 2.0.3
pkg-types: 2.0.1
playwright-core: 1.50.1
@@ -13228,7 +13228,7 @@ snapshots:
ohash@1.1.5: {}
ohash@2.0.9: {}
ohash@2.0.10: {}
on-finished@2.4.1:
dependencies:

View File

@@ -157,7 +157,7 @@ export interface InputMenuSlots<T, M extends boolean> {
import { computed, ref, toRef, onMounted, toRaw } from 'vue'
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from 'reka-ui'
import { defu } from 'defu'
import { isEqual } from 'ohash'
import { isEqual } from 'ohash/utils'
import { reactivePick, createReusableTemplate } from '@vueuse/core'
import { useAppConfig } from '#imports'
import { useButtonGroup } from '../composables/useButtonGroup'

View File

@@ -91,7 +91,7 @@ export interface LinkSlots {
<script setup lang="ts">
import { computed } from 'vue'
import { isEqual, diff } from 'ohash'
import { isEqual, diff } from 'ohash/utils'
import { useForwardProps } from 'reka-ui'
import { reactiveOmit } from '@vueuse/core'
import { useRoute } from '#imports'
@@ -124,11 +124,15 @@ const ui = computed(() => tv({
function isPartiallyEqual(item1: any, item2: any) {
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
if (q.type === 'added') {
filtered.push(q.key)
filtered.add(q.key)
}
return filtered
}, [] as string[])
return isEqual(item1, item2, { excludeKeys: key => diffedKeys.includes(key) })
}, new Set<string>())
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)))
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)))
return isEqual(item1Filtered, item2Filtered)
}
function isLinkActive({ route: linkRoute, isActive, isExactActive }: any) {

View File

@@ -1,4 +1,4 @@
import { isEqual } from 'ohash'
import { isEqual } from 'ohash/utils'
export function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys> {
const result = {} as Pick<Data, Keys>

View File

@@ -91,7 +91,7 @@ export interface LinkSlots {
<script setup lang="ts">
import { computed, getCurrentInstance } from 'vue'
import { isEqual, diff } from 'ohash'
import { isEqual, diff } from 'ohash/utils'
import { useForwardProps } from 'reka-ui'
import { reactiveOmit } from '@vueuse/core'
import { hasProtocol } from 'ufo'
@@ -140,11 +140,15 @@ const ui = computed(() => tv({
function isPartiallyEqual(item1: any, item2: any) {
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
if (q.type === 'added') {
filtered.push(q.key)
filtered.add(q.key)
}
return filtered
}, [] as string[])
return isEqual(item1, item2, { excludeKeys: key => diffedKeys.includes(key) })
}, new Set<string>())
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)))
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)))
return isEqual(item1Filtered, item2Filtered)
}
const isExternal = computed(() => {