How to use the @ts-common/iterator.some 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
return suppressionItems.filter(s =>
      it.some(it.isArray(s.from) ? s.from : [s.from], from =>
        isSubPath(urlReversed, splitPathAndReverse(from))
      )
    )
github Azure / oav / lib / validators / suppressions.ts View on Github external
return suppressionItems.filter(s =>
    it.some(it.isArray(s.from) ? s.from : [s.from], from =>
      isSubPath(urlReversed, splitPathAndReverse(from))
    )
  )
github Azure / oav / lib / commands / validate-spec.ts View on Github external
await cliSuppressExceptions(async () => {
    log.debug(argv.toString())
    const specPath = argv.specPath
    const vOptions: validate.Options = {
      consoleLogLevel: argv.logLevel,
      logFilepath: argv.f,
      pretty: argv.p
    }
    if (specPath.match(/.*composite.*/gi) !== null) {
      const result = await validate.validateCompositeSpec(specPath, vOptions)
      return iterator.some(result, v => !v.validityStatus) ? 1 : 0
    } else {
      const result = await validate.validateSpec(specPath, vOptions)
      return result.validityStatus ? 0 : 1
    }
  })
}
github Azure / oav / lib / validators / suppressions.ts View on Github external
export function existSuppression(
  specPath: string,
  suppression: amd.Suppression,
  id: string
): boolean {
  if (suppression.directive !== undefined) {
    const suppressionArray = getSuppressionArray(specPath, suppression.directive)
    return it.some(suppressionArray, s => s.suppress === id)
  }
  return false
}