8000 TypeError: configureMeasurements is not a function · Issue #314 · convert-units/convert-units · GitHub
[go: up one dir, main page]

Skip to content

TypeError: configureMeasurements is not a function #314

@faribauc

Description

@faribauc

Hi all,

I'm trying to implement convert-units in an Electron preload script (basically, shared code between main and renderer threads) and I'm getting the following error:

TypeError: configureMeasurements is not a function

The doc says configureMeasurements but I see configMeasurements in the code so I'm a but confused here. And nether of them work. Same error.

Intellisense doesn't auto-complete anothing when I start typing conf and @types/convert-units seems out of sync (types 2.3.9 vs repo 2.3.3) with the repo so I removed it before upgrading to 3.0.0-beta6.

import configureMeasurements, { Converter } from 'convert-units'

import allMeasures, {
  AllMeasures,
  AllMeasuresSystems,
  AllMeasuresUnits
} from 'convert-units/definitions/all'

function convert(value: number): Converter<AllMeasures, AllMeasuresSystems, AllMeasuresUnits> {
  return configureMeasurements<AllMeasures, AllMeasuresSystems, AllMeasuresUnits>(allMeasures)(value)
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0