11import { isBigNumber , isComplex , isFraction , isMatrix , isUnit } from '../../utils/is.js'
22import { isFactory , stripOptionalNotation } from '../../utils/factory.js'
33import { hasOwnProperty , lazy } from '../../utils/object.js'
4- import { contains } from '../../utils/array.js'
54import { ArgumentsError } from '../../error/ArgumentsError.js'
65
76export function importFactory ( typed , load , math , importedFactories ) {
@@ -235,7 +234,7 @@ export function importFactory (typed, load, math, importedFactories) {
235234 * @private
236235 */
237236 function _importFactory ( factory , options , name = factory . fn ) {
238- if ( contains ( name , '.' ) ) {
237+ if ( name . includes ( '.' ) ) {
239238 throw new Error ( 'Factory name should not contain a nested path. ' +
240239 'Name: ' + JSON . stringify ( name ) )
241240 }
@@ -253,7 +252,7 @@ export function importFactory (typed, load, math, importedFactories) {
253252 factory . dependencies
254253 . map ( stripOptionalNotation )
255254 . forEach ( dependency => {
256- if ( contains ( dependency , '.' ) ) {
255+ if ( dependency . includes ( '.' ) ) {
257256 throw new Error ( 'Factory dependency should not contain a nested path. ' +
258257 'Name: ' + JSON . stringify ( dependency ) )
259258 }
@@ -353,7 +352,7 @@ export function importFactory (typed, load, math, importedFactories) {
353352 }
354353
355354 function factoryAllowedInExpressions ( factory ) {
356- return factory . fn . indexOf ( '.' ) === - 1 && // FIXME: make checking on path redundant, check on meta data instead
355+ return ! factory . fn . includes ( '.' ) && // FIXME: make checking on path redundant, check on meta data instead
357356 ! hasOwnProperty ( unsafe , factory . fn ) &&
358357 ( ! factory . meta || ! factory . meta . isClass )
359358 }
0 commit comments