UNPKG

@buildit/job-listings

Version:

Small JS library for fetching Buildit job listings data from SmartRecruiter's API

41 lines (30 loc) 954 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _lodash = _interopRequireDefault(require("lodash.kebabcase")); var _countryList = require("country-list"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class JobLocation { constructor(srLocation) { this.city = srLocation.city; this.region = srLocation.region; this.countryCode = srLocation.country; } get country() { return (0, _countryList.getName)(this.countryCode); } get citySlug() { return encodeURIComponent((0, _lodash.default)(this.city)); } /** * The Buildit URI for this job location. * * See https://github.com/buildit/buildit/blob/develop/docs/metadata.md#resoure-uris */ get uri() { return `https://buildit.wiprodigital.com/thing/job-location/${this.countryCode}/${this.citySlug}`; } } exports.default = JobLocation;