Skip to content

Commit

Permalink
chore: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 15, 2022
1 parent 1efd68a commit f62861e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ async function generateMath() {
Object.getOwnPropertyNames(Math)
.filter(key => !ignorelist.includes(key))
.forEach((key) => {
// @ts-expect-error cast
const value = Math[key]
if (typeof value === 'function') {
lines.push('/*@__PURE__*/')
// @ts-expect-error cast
lines.push(`export const ${rename[key] || key} = reactify(Math.${key})`)
}
})
Expand All @@ -46,6 +48,7 @@ async function generateString() {
Object.getOwnPropertyNames(String.prototype)
.filter(key => !ignorelist.includes(key))
.forEach((key) => {
// @ts-expect-error cast
const value = String.prototype[key]
if (typeof value === 'function') {
lines.push('/*@__PURE__*/')
Expand Down Expand Up @@ -75,7 +78,8 @@ async function generateNumber() {
Object.getOwnPropertyNames(Number.prototype)
.filter(key => !ignorelist.includes(key))
.forEach((key) => {
const value = Number.prototype[key]
// @ts-expect-error cast
const value = Number.prototype[KeyObject]
if (typeof value === 'function') {
lines.push('/*@__PURE__*/')
lines.push(`export const ${key} = reactifyNumber(__proto.${key})`)
Expand Down
4 changes: 4 additions & 0 deletions src/boolean/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const isFalsy = not
* Equal, "==". Use `is` for strictly equal.
*/
export function eq<L, R = L>(a: MaybeRef<L>, b: MaybeRef<R>) {
// @ts-expect-error what?
// eslint-disable-next-line eqeqeq
return computed(() => unref(a) == unref(b))
}
Expand All @@ -28,20 +29,23 @@ export function eq<L, R = L>(a: MaybeRef<L>, b: MaybeRef<R>) {
* Strictly equal, "==="
*/
export function is<L, R = L>(a: MaybeRef<L>, b: MaybeRef<R>) {
// @ts-expect-error what?
return computed(() => unref(a) === unref(b))
}

/**
* Strictly not equal, "!=="
*/
export function isNot<L, R = L>(a: MaybeRef<L>, b: MaybeRef<R>) {
// @ts-expect-error what?
return computed(() => unref(a) !== unref(b))
}

/**
* Not equal, "!="
*/
export function noEq<L, R = L>(a: MaybeRef<L>, b: MaybeRef<R>) {
// @ts-expect-error what?
// eslint-disable-next-line eqeqeq
return computed(() => unref(a) != unref(b))
}
Expand Down
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { get as _get, reactify } from '@vueuse/shared'

export { reactify, reactifyObject, set, when, MaybeRef } from '@vueuse/shared'
export { reactify, reactifyObject, set, whenever, MaybeRef } from '@vueuse/shared'

/* @__PURE__ */
export const get = reactify(_get)

0 comments on commit f62861e

Please sign in to comment.