Debian Codegraph @

node/autolinker/dist/commonjs/match/email-match.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.EmailMatch = void 0;
4 var tslib_1 = require("tslib");
5 var match_1 = require("./match");
6 /**
7 * @class Autolinker.match.Email
8 * @extends Autolinker.match.Match
9 *
10 * Represents a Email match found in an input string which should be Autolinked.
11 *
12 * See this class's superclass ({@link Autolinker.match.Match}) for more details.
13 */
14 var EmailMatch = /** @class */ (function (_super) {
15 (0, tslib_1.__extends)(EmailMatch, _super);
16 /**
17 * @method constructor
18 * @param {Object} cfg The configuration properties for the Match
19 * instance, specified in an Object (map).
20 */
21 function EmailMatch(cfg) {
22 var _this = _super.call(this, cfg) || this;
23 /**
24 * @cfg {String} email (required)
25 *
26 * The email address that was matched.
27 */
28 _this.email = ''; // default value just to get the above doc comment in the ES5 output and documentation generator
29 _this.email = cfg.email;
30 return _this;
31 }
32 /**
33 * Returns a string name for the type of match that this class represents.
34 * For the case of EmailMatch, returns 'email'.
35 *
36 * @return {String}
37 */
38 EmailMatch.prototype.getType = function () {
39 return 'email';
40 };
41 /**
42 * Returns the email address that was matched.
43 *
44 * @return {String}
45 */
46 EmailMatch.prototype.getEmail = function () {
47 return this.email;
48 };
49 /**
50 * Returns the anchor href that should be generated for the match.
51 *
52 * @return {String}
53 */
54 EmailMatch.prototype.getAnchorHref = function () {
55 return 'mailto:' + this.email;
56 };
57 /**
58 * Returns the anchor text that should be generated for the match.
59 *
60 * @return {String}
61 */
62 EmailMatch.prototype.getAnchorText = function () {
63 return this.email;
64 };
65 return EmailMatch;
66 }(match_1.Match));
67 exports.EmailMatch = EmailMatch;
68 //# sourceMappingURL=email-match.js.map