Skip to content

Commit

Permalink
fix: global undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 3, 2021
1 parent 1383ff9 commit c3d9e8e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/number/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ import { Ref } from 'vue-demi'
export * from './generated'

/*@__PURE__*/
export const parseFloat = reactify(global.parseFloat)
const _parseFloat = reactify(parseFloat)

/*@__PURE__*/
export const parseInt = reactify(global.parseInt)
const _parseInt = reactify(parseInt)

/*@__PURE__*/
export const isNaN = reactify(global.isNaN)
const _isNaN = reactify(isNaN)

/*@__PURE__*/
export const isFinite = reactify(global.isFinite)
const _isFinite = reactify(isFinite)

export {
_parseFloat as parseFloat,
_parseInt as parseInt,
_isNaN as isNaN,
_isFinite as isFinite,
}

export function inc(a: Ref<number>, v = 1) { a.value += v }
export function dec(a: Ref<number>, v = 1) { a.value -= v }

0 comments on commit c3d9e8e

Please sign in to comment.