serialize-to-javascript 0.1.2

Serialize a serde::Serialize item to a JavaScript literal template using serde_json
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * @type {string}
 */
const keygenKey = __TEMPLATE_key__

/**
 * @type {number}
 */
const keygenLength = __TEMPLATE_length__

__RAW_optional_script__

// app logic, we are ensuring the length is equal to the expected one for some reason
if (keygenKey.length === keygenLength) {
    console.log("okay!")
} else {
    console.error("oh no!")
}