How to use the @ts-common/iterator.drop function in @ts-common/iterator

To help you get started, we’ve selected a few @ts-common/iterator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / oav / lib / util / jsonUtils.ts View on Github external
const rootInfo = getFilePosition(result)
    // apply suppression
    for (const s of suppressionArray) {
      if (s.where !== undefined) {
        const paths = it.flatMap(it.isArray(s.where) ? s.where : [s.where], where => {
          try {
            return jp.paths(result, where)
          } catch (e) {
            log.error(e)
            // TODO: return the error.
            return []
          }
        })
        for (const p of paths) {
          // drop "$" and apply suppressions.
          setSuppression(getDescendantFilePosition(result, it.drop(p)), s)
        }
      } else {
        setSuppression(rootInfo, s)
      }
    }
    return result
  }