ngo-login-client
Version:
Auth and User services for Angular v2 and up. Requires backend REST service.
30 lines • 1.16 kB
JavaScript
import { Pipe } from '@angular/core';
// tslint:disable-next-line:use-pipe-transform-interface
var OfUserName = /** @class */ (function () {
function OfUserName() {
}
// TODO: find out if "null = null" is needed or can just be "null"
OfUserName.prototype.transform = function (userObj, notFound) {
if (userObj === void 0) { userObj = null; }
if (notFound === void 0) { notFound = 'User not found'; }
if (typeof (userObj) === 'undefined' || userObj === null) {
return notFound;
}
if (userObj.hasOwnProperty('attributes')) {
if (userObj.attributes.hasOwnProperty('fullName')) {
if (userObj.attributes.fullName && userObj.attributes.fullName.trim()) {
return userObj.attributes.fullName;
}
}
}
return '';
};
OfUserName.decorators = [
{ type: Pipe, args: [{ name: 'ofUserName', pure: true },] },
];
/** @nocollapse */
OfUserName.ctorParameters = function () { return []; };
return OfUserName;
}());
export { OfUserName };
//# sourceMappingURL=of-user-name.pipe.js.map