rust-css-parser 2.3.0

Fault-tolerant CSS parser, validator, minifier and renderer: the Rust port of @tbela99/css-parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Port of `src/validation/json.ts`: the validation data (`src/data/validation.json`), parsed once.

use std::sync::OnceLock;

pub static VALIDATION_JSON: &str = include_str!("../data/validation.json");

/// the parsed validation data (`config`)
pub fn config_json() -> &'static serde_json::Value {
    static CONFIG: OnceLock<serde_json::Value> = OnceLock::new();
    CONFIG.get_or_init(|| serde_json::from_str(VALIDATION_JSON).expect("validation.json"))
}