src/index.js
function getDirective(path) {
    for (let directive of path.node.directives) {
      let dirstr = directive.value.value
      if (dirstr.startsWith('use ')) {
        let uses = dirstr.substr(4).split(',').map((use) => use.trim())
        if (uses.indexOf('extensible') !== -1) {
          return 1
        }
        if (uses.indexOf('!extensible') !== -1) {
          return -1
        }
      }
    }
    return 0
  }
function getDirective(path) {
    for (let directive of path.node.directives) {
      let dirstr = directive.value.value
      if (dirstr.startsWith('use ')) {
        let uses = dirstr.substr(4).split(',').map((use) => use.trim())
        if (uses.indexOf('extensible') !== -1) {
          return 1
        }
        if (uses.indexOf('!extensible') !== -1) {
          return -1
        }
      }
    }
    return 0
  }
function getDirective ( path ) { for ( let directive of path . node . directives ) { let dirstr = directive . value . value if ( dirstr . startsWith ( 'use ' ) ) { let uses = dirstr . substr ( 4 ) . split ( ',' ) . map ( ( use ) => use . trim ( ) ) if ( uses . indexOf ( 'extensible' ) !== - 1 ) { return 1 } if ( uses . indexOf ( '!extensible' ) !== - 1 ) { return - 1 } } } return 0 }
0 - no directive 1 - 'use extensible' directive -1 - 'use !extensible' directive
0 - no directive 1 - use extensible directive - 1 - use !extensible directive