mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Cleaned up the tests.
This commit is contained in:
+17
-17
@@ -3,38 +3,38 @@ import {JID} from './index';
|
||||
/*
|
||||
* All return an instance of JID.JID, the new operator is optional.
|
||||
*/
|
||||
let addr = new JID('alice@wonderland.net/rabbithole') // OK
|
||||
addr = new JID('alice', 'wonderland.net', 'rabbithole') // BEST; see section on escaping below
|
||||
let addr = new JID('alice@wonderland.net/rabbithole'); // OK
|
||||
addr = new JID('alice', 'wonderland.net', 'rabbithole'); // BEST; see section on escaping below
|
||||
|
||||
/*
|
||||
* local
|
||||
*/
|
||||
addr.local = 'alice'
|
||||
addr.local // alice
|
||||
addr.local = 'alice';
|
||||
addr.local; // alice
|
||||
// same as
|
||||
addr.setLocal('alice')
|
||||
addr.getLocal() // alice
|
||||
addr.setLocal('alice');
|
||||
addr.getLocal(); // alice
|
||||
|
||||
/*
|
||||
* domain
|
||||
*/
|
||||
addr.domain = 'wonderland.net'
|
||||
addr.domain // wonderland.net
|
||||
addr.domain = 'wonderland.net';
|
||||
addr.domain; // wonderland.net
|
||||
// same as
|
||||
addr.setDomain('wonderland.net')
|
||||
addr.getDomain() // wonderland.net
|
||||
addr.setDomain('wonderland.net');
|
||||
addr.getDomain(); // wonderland.net
|
||||
|
||||
/*
|
||||
* resource
|
||||
*/
|
||||
addr.resource = 'rabbithole'
|
||||
addr.resource // rabbithole
|
||||
addr.resource = 'rabbithole';
|
||||
addr.resource; // rabbithole
|
||||
// same as
|
||||
addr.setResource('rabbithole')
|
||||
addr.getResource() // rabbithole
|
||||
addr.setResource('rabbithole');
|
||||
addr.getResource(); // rabbithole
|
||||
|
||||
addr.toString() // alice@wonderland.net/rabbithole
|
||||
addr.bare() // returns a JID without resource
|
||||
addr.toString(); // alice@wonderland.net/rabbithole
|
||||
addr.bare(); // returns a JID without resource
|
||||
|
||||
let some_jid = new JID('is', 'a', 'test');
|
||||
addr.equals(some_jid) // returns true if the two JIDs are equal, false otherwise
|
||||
addr.equals(some_jid); // returns true if the two JIDs are equal, false otherwise
|
||||
|
||||
Reference in New Issue
Block a user