• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ckeditor / ckeditor5-inspector / fee0cd5f-6a1e-4e49-96d2-1297d718d15a

25 Mar 2024 03:02PM CUT coverage: 95.42%. First build
fee0cd5f-6a1e-4e49-96d2-1297d718d15a

push

circleci

przemyslaw-zan
Bumped dependencies.

522 of 560 branches covered (93.21%)

Branch coverage included in aggregate %.

1124 of 1165 relevant lines covered (96.48%)

113.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/commands/data/utils.js
1
/**
2
 * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md.
4
 */
5

6
import {
7
        stringify,
8
        stringifyPropertyList
9
} from '../../components/utils';
10

11
export function getEditorCommandDefinition( { editors, currentEditorName }, currentCommandName ) {
12
        if ( !currentCommandName ) {
11✔
13
                return null;
2✔
14
        }
15

16
        const command = editors.get( currentEditorName ).commands.get( currentCommandName );
9✔
17

18
        return {
9✔
19
                currentCommandName,
20
                type: 'Command',
21
                url: 'https://ckeditor.com/docs/ckeditor5/latest/api/module_core_command-Command.html',
22
                properties: stringifyPropertyList( {
23
                        isEnabled: {
24
                                value: command.isEnabled
25
                        },
26
                        value: {
27
                                value: command.value
28
                        }
29
                } ),
30
                command
31
        };
32
}
33

34
export function getCommandsTreeDefinition( { editors, currentEditorName } ) {
35
        const editor = editors.get( currentEditorName );
27✔
36

37
        if ( !editor ) {
27!
38
                return [];
×
39
        }
40

41
        const list = [];
27✔
42

43
        for ( const [ name, command ] of editors.get( currentEditorName ).commands ) {
27✔
44
                const attributes = [];
131✔
45

46
                if ( command.value !== undefined ) {
131✔
47
                        attributes.push( [ 'value', stringify( command.value, false ) ] );
25✔
48
                }
49

50
                list.push( {
131✔
51
                        name,
52
                        type: 'element',
53
                        children: [],
54
                        node: name,
55
                        attributes,
56

57
                        presentation: {
58
                                isEmpty: true,
59
                                cssClass: [
60
                                        'ck-inspector-tree-node_tagless',
61
                                        command.isEnabled ? '' : 'ck-inspector-tree-node_disabled'
131!
62
                                ].join( ' ' )
63
                        }
64
                } );
65
        }
66

67
        return list.sort( ( a, b ) => a.name > b.name ? 1 : -1 );
156✔
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc