Преглед изворни кода

Changed: Rename `env.mac` to `env.isMac`.

Maciej Gołaszewski пре 8 година
родитељ
комит
85cd89e5ae

+ 2 - 2
packages/ckeditor5-utils/src/env.js

@@ -21,9 +21,9 @@ const env = {
 	 * Indicates that application is running on Macintosh.
 	 *
 	 * @static
-	 * @member {Boolean} module:utils/env~env#mac
+	 * @member {Boolean} module:utils/env~env#isMac
 	 */
-	mac: isMac( userAgent )
+	isMac: isMac( userAgent )
 };
 
 export default env;

+ 1 - 1
packages/ckeditor5-utils/src/keyboard.js

@@ -108,7 +108,7 @@ export function parseKeystroke( keystroke ) {
  * @returns {String} Keystroke text specific for the environment.
  */
 export function getEnvKeystrokeText( keystroke ) {
-	if ( !env.mac ) {
+	if ( !env.isMac ) {
 		return keystroke;
 	}
 

+ 3 - 3
packages/ckeditor5-utils/tests/env.js

@@ -13,13 +13,13 @@ describe( 'Env', () => {
 		expect( env ).to.be.an( 'object' );
 	} );
 
-	describe( 'mac', () => {
+	describe( 'isMac', () => {
 		it( 'is a boolean', () => {
-			expect( env.mac ).to.be.a( 'boolean' );
+			expect( env.isMac ).to.be.a( 'boolean' );
 		} );
 	} );
 
-	describe( 'isMac', () => {
+	describe( 'isMac()', () => {
 		it( 'returns true for macintosh UA strings', () => {
 			expect( isMac( 'macintosh' ) ).to.be.true;
 			expect( isMac( 'foo macintosh bar' ) ).to.be.true;

+ 4 - 4
packages/ckeditor5-utils/tests/keyboard.js

@@ -103,15 +103,15 @@ describe( 'Keyboard', () => {
 	} );
 
 	describe( 'getEnvKeystrokeText', () => {
-		const initialEnvMac = env.mac;
+		const initialEnvMac = env.isMac;
 
 		afterEach( () => {
-			env.mac = initialEnvMac;
+			env.isMac = initialEnvMac;
 		} );
 
 		describe( 'on Macintosh', () => {
 			beforeEach( () => {
-				env.mac = true;
+				env.isMac = true;
 			} );
 
 			it( 'replaces CTRL with ⌘', () => {
@@ -147,7 +147,7 @@ describe( 'Keyboard', () => {
 
 		describe( 'on non–Macintosh', () => {
 			beforeEach( () => {
-				env.mac = false;
+				env.isMac = false;
 			} );
 
 			it( 'does not touch anything', () => {