json_inference 0.2.0 copy "json_inference: ^0.2.0" to clipboard
json_inference: ^0.2.0 copied to clipboard

A Dart package providing functionality to infer JSON data types.

example/json_inference_example.dart

// ignore_for_file: avoid_print

import 'dart:convert';

import 'package:json_inference/json_inference.dart';

void main() {
  const a = {
    'value1': 1,
    'value2': 2.0,
    'value3': '3',
    'value4': true,
  };

  const b = {
    'value1': 4,
    'value2': 5,
    'value3': 6,
  };

  final valueType = inferValueTypes([a, b]);

  print(const JsonEncoder.withIndent('  ').convert(a));
  print(const JsonEncoder.withIndent('  ').convert(b));
  print(const JsonEncoder.withIndent('  ').convert(valueType));
}
1
likes
150
pub points
3%
popularity

Publisher

verified publisherhacker1024.tk

A Dart package providing functionality to infer JSON data types.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on json_inference