babel-plugin-transform-for-in

1.0.3 • Public • Published

Start

  // .babelrc
  {
    "plugins":["babel-plugin-transform-for-in"]
  }

Example

  • in
for (var id in this.infoDict) {
  var info = this.infoDict[id]

  if (info.kind !== kind) {
    continue
  }

  var _s = info.pathArr.join('.')

  if (_s.indexOf(s) === 0) {
    if (!includingEqual && _s === s) {
      continue
    }

    res.push(info)
    continue
  }
  • out
for (var id in this.infoDict) {
  if (Object.hasOwnProperty.call(this.infoDict, id)) {
    var info = this.infoDict[id]

    if (info.kind !== kind) {
      continue
    } // 检查是否以 dataPath 开头


    var _s = info.pathArr.join('.')

    if (_s.indexOf(s) === 0) {
      if (!includingEqual && _s === s) {
        continue
      }

      res.push(info)
      continue
    }
  }
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i babel-plugin-transform-for-in

      Weekly Downloads

      1

      Version

      1.0.3

      License

      MIT

      Unpacked Size

      3.32 kB

      Total Files

      6

      Last publish

      Collaborators

      • q1797793818