isSupported.js 853 B

123456789101112131415161718192021222324
  1. /*
  2. Copyright 2018 Google LLC
  3. Use of this source code is governed by an MIT-style
  4. license that can be found in the LICENSE file or at
  5. https://opensource.org/licenses/MIT.
  6. */
  7. import { canConstructReadableStream } from 'workbox-core/_private/canConstructReadableStream.js';
  8. import './_version.js';
  9. /**
  10. * This is a utility method that determines whether the current browser supports
  11. * the features required to create streamed responses. Currently, it checks if
  12. * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
  13. * can be created.
  14. *
  15. * @return {boolean} `true`, if the current browser meets the requirements for
  16. * streaming responses, and `false` otherwise.
  17. *
  18. * @memberof module:workbox-streams
  19. */
  20. function isSupported() {
  21. return canConstructReadableStream();
  22. }
  23. export { isSupported };