source: node_modules/autolinker/dist/commonjs/match/email-match.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 2.0 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.EmailMatch = void 0;
4var tslib_1 = require("tslib");
5var 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 */
14var 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));
67exports.EmailMatch = EmailMatch;
68//# sourceMappingURL=email-match.js.map
Note: See TracBrowser for help on using the repository browser.