How to use the autolinker.Match function in autolinker

To help you get started, we’ve selected a few autolinker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gregjacobs / Autolinker.js / tests-integration / test-require.spec.ts View on Github external
it( `The 'Match' classes should be top-level named exports of 'autolinker' (as of v2.0)`, () => {
		expect( Autolinker.Match ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.Match.name ).toBe( 'Match' );  // function name
		expect( Autolinker.Match.prototype.getMatchedText ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.EmailMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.EmailMatch.name ).toBe( 'EmailMatch' );  // function name
		expect( Autolinker.EmailMatch.prototype.getEmail ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.HashtagMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.HashtagMatch.name ).toBe( 'HashtagMatch' );  // function name
		expect( Autolinker.HashtagMatch.prototype.getHashtag ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.MentionMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.MentionMatch.name ).toBe( 'MentionMatch' );  // function name
		expect( Autolinker.MentionMatch.prototype.getMention ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.PhoneMatch ).toEqual( jasmine.any( Function ) );  // constructor function
github gregjacobs / Autolinker.js / tests-integration / test-require.spec.ts View on Github external
it( `The 'Match' classes should be top-level named exports of 'autolinker' (as of v2.0)`, () => {
		expect( Autolinker.Match ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.Match.name ).toBe( 'Match' );  // function name
		expect( Autolinker.Match.prototype.getMatchedText ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.EmailMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.EmailMatch.name ).toBe( 'EmailMatch' );  // function name
		expect( Autolinker.EmailMatch.prototype.getEmail ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.HashtagMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.HashtagMatch.name ).toBe( 'HashtagMatch' );  // function name
		expect( Autolinker.HashtagMatch.prototype.getHashtag ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.MentionMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.MentionMatch.name ).toBe( 'MentionMatch' );  // function name
		expect( Autolinker.MentionMatch.prototype.getMention ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.PhoneMatch ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.PhoneMatch.name ).toBe( 'PhoneMatch' );  // function name