Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #223 from ckeditor/t/222
Browse files Browse the repository at this point in the history
Other: Renamed `env.mac` to `env.isMac`. Closes #222.

BREAKING CHANGE: Renamed `env.mac` to `env.isMac`.
  • Loading branch information
Reinmar committed Feb 7, 2018
2 parents 1823196 + 61282fe commit dc6b226
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/env.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/keyboard.js
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/env.js
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions tests/keyboard.js
Expand Up @@ -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 ⌘', () => {
Expand Down Expand Up @@ -147,7 +147,7 @@ describe( 'Keyboard', () => {

describe( 'on non–Macintosh', () => {
beforeEach( () => {
env.mac = false;
env.isMac = false;
} );

it( 'does not touch anything', () => {
Expand Down

0 comments on commit dc6b226

Please sign in to comment.