UNPKG

apr-api

Version:

Performing queries on Business Registers Agency of Serbia data. Work in progress, currently searching only by registration number.

16 lines (13 loc) 423 B
require("babel-polyfill"); import client from './helpers/HttpClient'; import Record from './Entity/Record'; class AprApi { async getByRegistrationNumber(regNo) { if (!/^\d+$/.exec(regNo.toString())) { reject("Registration number must be numeric"); } const data = await client.searchByRegistrationNumber(regNo); return new Record(data); } } export default new AprApi();