versa_semval 0.7.2

Cross-platform module for semantic validation of Versa data
Documentation
#![deny(clippy::all)]

use model::SemanticValidationOutput;

mod helpers;
mod itemization;
mod model;
mod rules;
mod schema_version;
mod subtotal;
mod total;
pub mod validation;

#[cfg(feature = "nodejs")]
#[macro_use]
extern crate napi_derive;

#[cfg_attr(feature = "nodejs", napi)]
pub fn run_semantic_validation(data: serde_json::Value) -> SemanticValidationOutput {
  validation::execute(data).unwrap_or_else(|e| SemanticValidationOutput {
    violations: Vec::new(),
    error: Some(e.to_string()),
  })
}