Home Reference Source Repository

src/features/FileFeature.js

  1. import { Feature } from "./Feature.js";
  2.  
  3. /**
  4. * The File API feature.
  5. */
  6.  
  7. export class FileFeature extends Feature {
  8.  
  9. /**
  10. * Constructs a new File feature.
  11. */
  12.  
  13. constructor() {
  14.  
  15. super("File");
  16.  
  17. /**
  18. * Indicates whether the File API is supported.
  19. *
  20. * @type {Boolean}
  21. */
  22.  
  23. this.supported = (
  24. this.root.File !== undefined &&
  25. this.root.FileReader !== undefined &&
  26. this.root.FileList !== undefined &&
  27. this.root.Blob !== undefined
  28. );
  29.  
  30. }
  31.  
  32. }