function json_to_reg(json, reg) {
    reg || (reg = new Set());
    for (let i = 0; i < json.length; i++) {
        reg.add(json[i]);
    }
    return (/** @type {Set<string|number>} */reg
    );
}
@param {Array<string|number>} json
@param {
  Set<string|number>|
  Map<Array<string|number>>|
  KeystoreSet<string|number>|
  KeystoreMap<Array<string|number>>
} reg
@return {
  Set<string|number>|
  KeystoreSet<string|number>
}