uomlibrarycommons-core
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
export declare enum ESite { | ||
export declare enum EUomLibrarySite { | ||
JOULE = "joule", | ||
@@ -7,6 +7,6 @@ MAIN = "main", | ||
} | ||
export declare function toESite(value: string): ESite | undefined; | ||
export declare function fromESite(value: ESite): string; | ||
export declare function keyToESite(key: string): ESite; | ||
export declare function idFromESite(site: ESite): number; | ||
export declare function prettyFromESite(site: ESite): string; | ||
export declare function toEUomLibrarySite(value: string): EUomLibrarySite | undefined; | ||
export declare function fromEUomLibrarySite(value: EUomLibrarySite): string; | ||
export declare function keyToEUomLibrarySite(key: string): EUomLibrarySite; | ||
export declare function idFromEUomLibrarySite(site: EUomLibrarySite): number; | ||
export declare function prettyFromEUomLibrarySite(site: EUomLibrarySite): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const sentry_library_site_ids_1 = require("../consts/sentry-library-site-ids"); | ||
var ESite; | ||
(function (ESite) { | ||
ESite["JOULE"] = "joule"; | ||
ESite["MAIN"] = "main"; | ||
ESite["PRECINCT"] = "precinct"; | ||
ESite["AGLC"] = "aglc"; | ||
})(ESite = exports.ESite || (exports.ESite = {})); | ||
function toESite(value) { | ||
var EUomLibrarySite; | ||
(function (EUomLibrarySite) { | ||
EUomLibrarySite["JOULE"] = "joule"; | ||
EUomLibrarySite["MAIN"] = "main"; | ||
EUomLibrarySite["PRECINCT"] = "precinct"; | ||
EUomLibrarySite["AGLC"] = "aglc"; | ||
})(EUomLibrarySite = exports.EUomLibrarySite || (exports.EUomLibrarySite = {})); | ||
function toEUomLibrarySite(value) { | ||
switch (value) { | ||
case ESite.JOULE.toString(): | ||
return ESite.JOULE; | ||
case ESite.MAIN.toString(): | ||
return ESite.MAIN; | ||
case ESite.PRECINCT.toString(): | ||
return ESite.PRECINCT; | ||
case ESite.AGLC.toString(): | ||
return ESite.AGLC; | ||
case EUomLibrarySite.JOULE.toString(): | ||
return EUomLibrarySite.JOULE; | ||
case EUomLibrarySite.MAIN.toString(): | ||
return EUomLibrarySite.MAIN; | ||
case EUomLibrarySite.PRECINCT.toString(): | ||
return EUomLibrarySite.PRECINCT; | ||
case EUomLibrarySite.AGLC.toString(): | ||
return EUomLibrarySite.AGLC; | ||
default: | ||
@@ -25,59 +25,59 @@ return undefined; | ||
} | ||
exports.toESite = toESite; | ||
function fromESite(value) { | ||
exports.toEUomLibrarySite = toEUomLibrarySite; | ||
function fromEUomLibrarySite(value) { | ||
switch (value) { | ||
case ESite.JOULE: | ||
return ESite.JOULE.toString(); | ||
case ESite.MAIN: | ||
return ESite.MAIN.toString(); | ||
case ESite.PRECINCT: | ||
return ESite.PRECINCT.toString(); | ||
case ESite.AGLC: | ||
return ESite.AGLC.toString(); | ||
case EUomLibrarySite.JOULE: | ||
return EUomLibrarySite.JOULE.toString(); | ||
case EUomLibrarySite.MAIN: | ||
return EUomLibrarySite.MAIN.toString(); | ||
case EUomLibrarySite.PRECINCT: | ||
return EUomLibrarySite.PRECINCT.toString(); | ||
case EUomLibrarySite.AGLC: | ||
return EUomLibrarySite.AGLC.toString(); | ||
} | ||
throw new Error('Unknown ESite'); | ||
throw new Error('Unknown EUomLibrarySite'); | ||
} | ||
exports.fromESite = fromESite; | ||
function keyToESite(key) { | ||
exports.fromEUomLibrarySite = fromEUomLibrarySite; | ||
function keyToEUomLibrarySite(key) { | ||
switch (key) { | ||
case 'JOULE': | ||
return ESite.JOULE; | ||
return EUomLibrarySite.JOULE; | ||
case 'MAIN': | ||
return ESite.MAIN; | ||
return EUomLibrarySite.MAIN; | ||
case 'PRECINCT': | ||
return ESite.PRECINCT; | ||
return EUomLibrarySite.PRECINCT; | ||
case 'AGLC': | ||
return ESite.AGLC; | ||
return EUomLibrarySite.AGLC; | ||
} | ||
throw new Error(`Unable to obtain ESite for key: ${key}`); | ||
throw new Error(`Unable to obtain EUomLibrarySite for key: ${key}`); | ||
} | ||
exports.keyToESite = keyToESite; | ||
function idFromESite(site) { | ||
exports.keyToEUomLibrarySite = keyToEUomLibrarySite; | ||
function idFromEUomLibrarySite(site) { | ||
switch (site) { | ||
case ESite.JOULE: | ||
case EUomLibrarySite.JOULE: | ||
return sentry_library_site_ids_1.SENTRY_LIBRARY_SITE_JOULE; | ||
case ESite.MAIN: | ||
case EUomLibrarySite.MAIN: | ||
return sentry_library_site_ids_1.SENTRY_LIBRARY_SITE_MAIN; | ||
case ESite.PRECINCT: | ||
case EUomLibrarySite.PRECINCT: | ||
return sentry_library_site_ids_1.SENTRY_LIBRARY_SITE_PRECINCT; | ||
case ESite.AGLC: | ||
case EUomLibrarySite.AGLC: | ||
return sentry_library_site_ids_1.SENTRY_LIBRARY_SITE_AGLC; | ||
} | ||
throw new Error(`Unable to obtain ID for ESite: ${site}`); | ||
throw new Error(`Unable to obtain ID for EUomLibrarySite: ${site}`); | ||
} | ||
exports.idFromESite = idFromESite; | ||
function prettyFromESite(site) { | ||
exports.idFromEUomLibrarySite = idFromEUomLibrarySite; | ||
function prettyFromEUomLibrarySite(site) { | ||
switch (site) { | ||
case ESite.AGLC: | ||
case EUomLibrarySite.AGLC: | ||
return 'Learning Commons'; | ||
case ESite.JOULE: | ||
case EUomLibrarySite.JOULE: | ||
return 'Joule Library'; | ||
case ESite.MAIN: | ||
case EUomLibrarySite.MAIN: | ||
return 'Main Library'; | ||
case ESite.PRECINCT: | ||
case EUomLibrarySite.PRECINCT: | ||
return 'Precinct Library'; | ||
} | ||
throw new Error('Unable to obtain pretty for ESite'); | ||
throw new Error('Unable to obtain pretty for EUomLibrarySite'); | ||
} | ||
exports.prettyFromESite = prettyFromESite; | ||
exports.prettyFromEUomLibrarySite = prettyFromEUomLibrarySite; | ||
//# sourceMappingURL=euom-library-site.js.map |
{ | ||
"name": "uomlibrarycommons-core", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Common Node and Angular code for UoM library development", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
13601