8
0
Quellcode durchsuchen

Correct import statement with new path to feature detection.

Mateusz Samsel vor 6 Jahren
Ursprung
Commit
ae0ed969b7

+ 2 - 2
packages/ckeditor5-word-count/src/wordcount.js

@@ -12,7 +12,7 @@ import { modelElementToPlainText } from './utils';
 import { throttle, isElement } from 'lodash-es';
 import View from '@ckeditor/ckeditor5-ui/src/view';
 import Template from '@ckeditor/ckeditor5-ui/src/template';
-import featureDetection from '@ckeditor/ckeditor5-utils/src/featuredetection';
+import regExpFeatureDetection from '@ckeditor/ckeditor5-utils/src/featuredetection/regexp';
 
 /**
  * The word count plugin.
@@ -232,7 +232,7 @@ export default class WordCount extends Plugin {
 
 		this.characters = txt.replace( /\n/g, '' ).length;
 
-		const wordsMatch = featureDetection.isUnicodePropertySupported ?
+		const wordsMatch = regExpFeatureDetection.isUnicodePropertySupported ?
 			txt.match( new RegExp( '[\\p{L}\\p{N}\\p{M}\\p{Pd}\\p{Pc}]+', 'gu' ) ) :
 			/* istanbul ignore next */
 			txt.match( /[_\-a-zA-Z0-9À-ž]+/gu );

+ 2 - 2
packages/ckeditor5-word-count/tests/wordcount.js

@@ -15,7 +15,7 @@ import { add as addTranslations, _clear as clearTranslations } from '@ckeditor/c
 import Position from '@ckeditor/ckeditor5-engine/src/model/position';
 import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter';
 import TableEditing from '@ckeditor/ckeditor5-table/src/tableediting';
-import featureDetection from '@ckeditor/ckeditor5-utils/src/featuredetection';
+import regExpFeatureDetection from '@ckeditor/ckeditor5-utils/src/featuredetection/regexp';
 
 // Delay related to word-count throttling.
 const DELAY = 255;
@@ -97,7 +97,7 @@ describe( 'WordCount', () => {
 		} );
 
 		it( 'should count international words', function() {
-			if ( !featureDetection.isUnicodePropertySupported ) {
+			if ( !regExpFeatureDetection.isUnicodePropertySupported ) {
 				this.skip();
 			}