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

ckeditor / ckeditor5-inspector / 549

pending completion
549

push

travis-ci-com

web-flow
Bump webpack from 5.75.0 to 5.76.0

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

521 of 560 branches covered (93.04%)

Branch coverage included in aggregate %.

1123 of 1165 relevant lines covered (96.39%)

113.25 hits per line

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

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

6
import Logger from './logger';
7

8
let unnamedEditorCount = 0;
1✔
9

10
export function normalizeArguments( args ) {
11
        const normalized = {
42✔
12
                editors: {},
13
                options: {}
14
        };
15

16
        // Deprecated // attach( 'name', editor );
17
        if ( typeof args[ 0 ] === 'string' ) {
42✔
18
                Logger.warn(
1✔
19
                        `[CKEditorInspector] The CKEditorInspector.attach( '${ args[ 0 ] }', editor ) syntax has been deprecated ` +
20
                        'and will be removed in the near future. To pass a name of an editor instance, use ' +
21
                        `CKEditorInspector.attach( { '${ args[ 0 ] }': editor } ) instead. ` +
22
                        'Learn more in https://github.com/ckeditor/ckeditor5-inspector/blob/master/README.md.'
23
                );
24

25
                normalized.editors[ args[ 0 ] ] = args[ 1 ];
1✔
26
        } else {
27
                // attach( editor );
28
                if ( isEditorInstance( args[ 0 ] ) ) {
41✔
29
                        normalized.editors[ getNextEditorName() ] = args[ 0 ];
10✔
30
                }
31
                // attach( { foo: editor1, bar: editor2, ... } );
32
                else {
33
                        for ( const name in args[ 0 ] ) {
31✔
34
                                normalized.editors[ name ] = args[ 0 ][ name ];
33✔
35
                        }
36
                }
37

38
                // attach( ..., { options } );
39
                normalized.options = args[ 1 ] || normalized.options;
41✔
40
        }
41

42
        return normalized;
42✔
43
}
44

45
function getNextEditorName() {
46
        return `editor-${ ++unnamedEditorCount }`;
10✔
47
}
48

49
export function getFirstEditor( editors ) {
50
        return [ ...editors ][ 0 ][ 1 ];
×
51
}
52

53
export function getFirstEditorName( editors ) {
54
        return [ ...editors ][ 0 ][ 0 ] || '';
37!
55
}
56

57
function isEditorInstance( arg ) {
58
        // Quack! 🦆
59
        return !!arg.model && !!arg.editing;
41✔
60
}
61

62
export function compareArrays( a, b ) {
63
        const minLen = Math.min( a.length, b.length );
532✔
64

65
        for ( let i = 0; i < minLen; i++ ) {
532✔
66
                if ( a[ i ] != b[ i ] ) {
410✔
67
                        // The arrays are different.
68
                        return i;
14✔
69
                }
70
        }
71

72
        // Both arrays were same at all points.
73
        if ( a.length == b.length ) {
518!
74
                // If their length is also same, they are the same.
75
                return 'same';
×
76
        } else if ( a.length < b.length ) {
518!
77
                // Compared array is shorter so it is a prefix of the other array.
78
                return 'prefix';
518✔
79
        } else {
80
                // Compared array is longer so it is an extension of the other array.
81
                return 'extension';
×
82
        }
83
}
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