Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/eslint-plugin-react/lib/util/isDestructuredFromPragmaImport.js

    rd565449 r0c6b92a  
    11'use strict';
    22
     3const astUtil = require('./ast');
    34const pragmaUtil = require('./pragma');
    45const variableUtil = require('./variable');
     
    2324        if (
    2425          latestDef.node.init.type === 'MemberExpression'
    25               && latestDef.node.init.object.type === 'Identifier'
    26               && latestDef.node.init.object.name === pragma
     26          && latestDef.node.init.object.type === 'Identifier'
     27          && latestDef.node.init.object.name === pragma
    2728        ) {
    2829          return true;
     
    3132        if (
    3233          latestDef.node.init.type === 'Identifier'
    33               && latestDef.node.init.name === pragma
     34          && latestDef.node.init.name === pragma
    3435        ) {
    3536          return true;
     
    4041
    4142        // get "require('react')" from: "{variable} = require('react')"
    42         if (latestDef.node.init.type === 'CallExpression') {
     43        if (astUtil.isCallExpression(latestDef.node.init)) {
    4344          requireExpression = latestDef.node.init;
    4445        }
     
    4647        if (
    4748          !requireExpression
    48               && latestDef.node.init.type === 'MemberExpression'
    49               && latestDef.node.init.object.type === 'CallExpression'
     49          && latestDef.node.init.type === 'MemberExpression'
     50          && astUtil.isCallExpression(latestDef.node.init.object)
    5051        ) {
    5152          requireExpression = latestDef.node.init.object;
     
    5556        if (
    5657          requireExpression
    57               && requireExpression.callee
    58               && requireExpression.callee.name === 'require'
    59               && requireExpression.arguments[0]
    60               && requireExpression.arguments[0].value === pragma.toLocaleLowerCase()
     58          && requireExpression.callee
     59          && requireExpression.callee.name === 'require'
     60          && requireExpression.arguments[0]
     61          && requireExpression.arguments[0].value === pragma.toLocaleLowerCase()
    6162        ) {
    6263          return true;
     
    6970      if (
    7071        latestDef.parent
    71             && latestDef.parent.type === 'ImportDeclaration'
    72             && latestDef.parent.source.value === pragma.toLocaleLowerCase()
     72        && latestDef.parent.type === 'ImportDeclaration'
     73        && latestDef.parent.source.value === pragma.toLocaleLowerCase()
    7374      ) {
    7475        return true;
Note: See TracChangeset for help on using the changeset viewer.