Parcourir la source

Correct import statement.

Mateusz Samsel il y a 6 ans
Parent
commit
bbbbb5aea2

+ 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 regExpFeatureDetection from '@ckeditor/ckeditor5-utils/src/featuredetection/regexp';
+import env from '@ckeditor/ckeditor5-utils/src/env';
 
 /**
  * The word count plugin.
@@ -238,7 +238,7 @@ export default class WordCount extends Plugin {
 		// {M} - A character intended to be combined with another character (e.g. accents, umlauts, enclosing boxes, etc.).
 		// {Pd} - Any kind of hyphen or dash.
 		// {Pc} - A punctuation character such as an underscore that connects words.
-		const wordsMatchRegExp = regExpFeatureDetection.isUnicodePropertySupported ?
+		const wordsMatchRegExp = env.features.isRegExpUnicodePropertySupported ?
 			// Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).
 			new RegExp( '[\\p{L}\\p{N}\\p{M}\\p{Pd}\\p{Pc}]+', 'gu' ) :
 			/[_\-a-zA-Z0-9À-ž]+/gu;

+ 5 - 5
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 regExpFeatureDetection from '@ckeditor/ckeditor5-utils/src/featuredetection/regexp';
+import env from '@ckeditor/ckeditor5-utils/src/env';
 
 // Delay related to word-count throttling.
 const DELAY = 255;
@@ -97,7 +97,7 @@ describe( 'WordCount', () => {
 		} );
 
 		it( 'should count international words', function() {
-			if ( !regExpFeatureDetection.isUnicodePropertySupported ) {
+			if ( !env.features.isRegExpUnicodePropertySupported ) {
 				this.skip();
 			}
 
@@ -110,14 +110,14 @@ describe( 'WordCount', () => {
 		} );
 
 		describe( 'ES2018 RegExp Unicode property fallback', () => {
-			const originalPropertiesSupport = regExpFeatureDetection.isUnicodePropertySupported;
+			const originalPropertiesSupport = env.features.isRegExpUnicodePropertySupported;
 
 			before( () => {
-				regExpFeatureDetection.isUnicodePropertySupported = false;
+				env.features.isRegExpUnicodePropertySupported = false;
 			} );
 
 			after( () => {
-				regExpFeatureDetection.isUnicodePropertySupported = originalPropertiesSupport;
+				env.features.isRegExpUnicodePropertySupported = originalPropertiesSupport;
 			} );
 
 			it( 'should use different regexp when unicode properties are not supported', () => {