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 also continue to be in their 1.x namespace locations for backward compatibility`, () => {
		expect( Autolinker.match.Match ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.match.Match.name ).toBe( 'Match' );  // function name
		expect( Autolinker.match.Match.prototype.getMatchedText ).toEqual( jasmine.any( Function ) );

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

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

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

		expect( Autolinker.match.Phone ).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 also continue to be in their 1.x namespace locations for backward compatibility`, () => {
		expect( Autolinker.match.Match ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.match.Match.name ).toBe( 'Match' );  // function name
		expect( Autolinker.match.Match.prototype.getMatchedText ).toEqual( jasmine.any( Function ) );

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

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

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

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

		expect( Autolinker.match.Url ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.match.Url.name ).toBe( 'UrlMatch' );  // function name
		expect( Autolinker.match.Url.prototype.getUrl ).toEqual( jasmine.any( Function ) );
	} );