@@ -13,7 +13,6 @@ const isStringLiteral = ast.isStringLiteral;
1313const isArrayExpr = ast . isArrayExpr ;
1414const isObjectExpr = ast . isObjectExpr ;
1515const isFunctionExpr = ast . isFunctionExpr ;
16- const isStringLiteralArray = ast . isStringLiteralArray ;
1716
1817const COMMON_JS_PARAMS = [ "require" , "exports" , "module" ] ;
1918
@@ -217,26 +216,6 @@ function isRequireCall(node) {
217216 isRequireIdentifier ( node . callee ) ;
218217}
219218
220- /**
221- * Determine if supplied `node` represents a `require` call with statically
222- * defined dependencies. That is, only string literals.
223- *
224- * The single-argument form of `require` is used inside Simplified CommonJS
225- * Wrapper definitions. The multiple-argument form of `require` can be used
226- * anywhere, and will contain at least a dependency array and a callback
227- * function, but may also contain an additional "errback" function as well.
228- * Here, we only need to check the first argument to determine if the dependency
229- * list is static.
230- *
231- * @public
232- * @param {ASTNode } node - CallExpression node to test
233- * @returns {Boolean } true if represents static `require` call
234- */
235- function isStaticRequire ( node ) {
236- const args = node . arguments ;
237- return isStringLiteral ( args [ 0 ] ) || isArrayExpr ( args [ 0 ] ) && isStringLiteralArray ( args [ 0 ] ) ;
238- }
239-
240219/**
241220 * Determine if supplied `node` represents a valid `require` format.
242221 *
@@ -351,26 +330,21 @@ function getAmdCallback(node) {
351330//------------------------------------------------------------------------------
352331
353332module . exports = {
354-
355- // `define` related predicates
356- isDefineCall : isDefineCall ,
357- isAmdDefine : isAmdDefine ,
358- isObjectDefine : isObjectDefine ,
359- isFunctionDefine : isFunctionDefine ,
360- isCommonJsWrapper : isCommonJsWrapper ,
361- isNamedDefine : isNamedDefine ,
362- isInsideModuleDef : isInsideModuleDef ,
363- isValidDefine : isValidDefine ,
364-
365- // `require` related predicates
366- isRequireIdentifier : isRequireIdentifier ,
367- isRequireCall : isRequireCall ,
368- isStaticRequire : isStaticRequire ,
369- isValidRequire : isValidRequire ,
370- isAmdRequire : isAmdRequire ,
333+ isDefineCall,
334+ isAmdDefine,
335+ isObjectDefine,
336+ isFunctionDefine,
337+ isCommonJsWrapper,
338+ isNamedDefine,
339+ isInsideModuleDef,
340+ isValidDefine,
341+ isRequireIdentifier,
342+ isRequireCall,
343+ isValidRequire,
344+ isAmdRequire,
371345
372346 // general utilities
373- getDependencyNodes : getDependencyNodes ,
374- getDependencyStringNodes : getDependencyStringNodes ,
375- getAmdCallback : getAmdCallback
347+ getDependencyNodes,
348+ getDependencyStringNodes,
349+ getAmdCallback
376350} ;
0 commit comments