UNPKG

@regulaforensics/document-reader

Version:

This is an npm module for Regula Document Reader SDK. It allows you to read various kinds of identification documents using your phone's camera.

37 lines (30 loc) 990 B
import { Attribute } from './Attribute'; import { RFIDValue } from './RFIDValue'; export class Authority { attributes data friendlyName static fromJson(jsonObject) { if (jsonObject == null) return null; const result = new Authority(); result.data = jsonObject["data"]; result.friendlyName = RFIDValue.fromJson(jsonObject["friendlyName"]); if (jsonObject["attributes"] != null) { result.attributes = []; for (const item of jsonObject["attributes"]) { const attribute = Attribute.fromJson(item); if (attribute != null) { result.attributes.push(attribute); } } } return result; } toJson() { return { "attributes": this.attributes?.map(e => e.toJson()), "data": this.data, "friendlyName": this.friendlyName?.toJson(), } } }