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

Commit dc6b226

Browse files
authored
Merge pull request #223 from ckeditor/t/222
Other: Renamed `env.mac` to `env.isMac`. Closes #222. BREAKING CHANGE: Renamed `env.mac` to `env.isMac`.
2 parents 1823196 + 61282fe commit dc6b226

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const env = {
2121
* Indicates that application is running on Macintosh.
2222
*
2323
* @static
24-
* @member {Boolean} module:utils/env~env#mac
24+
* @member {Boolean} module:utils/env~env#isMac
2525
*/
26-
mac: isMac( userAgent )
26+
isMac: isMac( userAgent )
2727
};
2828

2929
export default env;

src/keyboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function parseKeystroke( keystroke ) {
108108
* @returns {String} Keystroke text specific for the environment.
109109
*/
110110
export function getEnvKeystrokeText( keystroke ) {
111-
if ( !env.mac ) {
111+
if ( !env.isMac ) {
112112
return keystroke;
113113
}
114114

tests/env.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ describe( 'Env', () => {
1313
expect( env ).to.be.an( 'object' );
1414
} );
1515

16-
describe( 'mac', () => {
16+
describe( 'isMac', () => {
1717
it( 'is a boolean', () => {
18-
expect( env.mac ).to.be.a( 'boolean' );
18+
expect( env.isMac ).to.be.a( 'boolean' );
1919
} );
2020
} );
2121

22-
describe( 'isMac', () => {
22+
describe( 'isMac()', () => {
2323
it( 'returns true for macintosh UA strings', () => {
2424
expect( isMac( 'macintosh' ) ).to.be.true;
2525
expect( isMac( 'foo macintosh bar' ) ).to.be.true;

tests/keyboard.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ describe( 'Keyboard', () => {
103103
} );
104104

105105
describe( 'getEnvKeystrokeText', () => {
106-
const initialEnvMac = env.mac;
106+
const initialEnvMac = env.isMac;
107107

108108
afterEach( () => {
109-
env.mac = initialEnvMac;
109+
env.isMac = initialEnvMac;
110110
} );
111111

112112
describe( 'on Macintosh', () => {
113113
beforeEach( () => {
114-
env.mac = true;
114+
env.isMac = true;
115115
} );
116116

117117
it( 'replaces CTRL with ⌘', () => {
@@ -147,7 +147,7 @@ describe( 'Keyboard', () => {
147147

148148
describe( 'on non–Macintosh', () => {
149149
beforeEach( () => {
150-
env.mac = false;
150+
env.isMac = false;
151151
} );
152152

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

0 commit comments

Comments
 (0)