@welldot/core

~~Variable: convertProfileFromJSON~~

Parses a JSON string produced by serializeWell (or older legacy formats) and returns a normalized Well object.

const convertProfileFromJSON: (jsonString) => Well | null = deserializeWell

Parses a JSON string produced by serializeWell (or older legacy formats) and returns a normalized Well object.

Handles:

  • Versioned format v1 and v2
  • Legacy format with constructive / geologic sub-objects
  • Legacy diam_pol inch diameters → diameter mm conversion
  • Typo bole_hole → bore_hole compatibility
  • v1→v2 normalizations: fgdc_texture, screen_slot_mm, lat/lng/elevation → location

Parameters

jsonString

string

Raw JSON string to parse.

Returns

Well | null

A normalized Well, or null if the parsed data is empty.

Throws

If jsonString is not valid JSON.

Throws

If the version field is present but not supported.

Deprecated

Use deserializeWell