How to use the autolinker.matcher 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 'Matcher' classes should also continue to be in their 1.x namespace locations for backward compatibility`, () => {
		expect( Autolinker.matcher.Matcher ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Matcher.name ).toBe( 'Matcher' );  // function name
		// Note: no methods which can be checked here - abstract methods are not compiled into ES5

		expect( Autolinker.matcher.Email ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Email.name ).toBe( 'EmailMatcher' );  // function name
		expect( Autolinker.matcher.Email.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Hashtag ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Hashtag.name ).toBe( 'HashtagMatcher' );  // function name
		expect( Autolinker.matcher.Hashtag.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Mention ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Mention.name ).toBe( 'MentionMatcher' );  // function name
		expect( Autolinker.matcher.Mention.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Phone ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Phone.name ).toBe( 'PhoneMatcher' );  // function name
		expect( Autolinker.matcher.Phone.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Url ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Url.name ).toBe( 'UrlMatcher' );  // function name
		expect( Autolinker.matcher.Url.prototype.parseMatches ).toEqual( jasmine.any( Function ) );
	} );
github gregjacobs / Autolinker.js / tests-integration / test-require.spec.ts View on Github external
it( `The 'Matcher' classes should also continue to be in their 1.x namespace locations for backward compatibility`, () => {
		expect( Autolinker.matcher.Matcher ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Matcher.name ).toBe( 'Matcher' );  // function name
		// Note: no methods which can be checked here - abstract methods are not compiled into ES5

		expect( Autolinker.matcher.Email ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Email.name ).toBe( 'EmailMatcher' );  // function name
		expect( Autolinker.matcher.Email.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Hashtag ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Hashtag.name ).toBe( 'HashtagMatcher' );  // function name
		expect( Autolinker.matcher.Hashtag.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Mention ).toEqual( jasmine.any( Function ) );  // constructor function
		expect( Autolinker.matcher.Mention.name ).toBe( 'MentionMatcher' );  // function name
		expect( Autolinker.matcher.Mention.prototype.parseMatches ).toEqual( jasmine.any( Function ) );

		expect( Autolinker.matcher.Phone ).toEqual( jasmine.any( Function ) );  // constructor function