How to use the ibm-cloud-sdk-core.contentType.fromHeader function in ibm-cloud-sdk-core

To help you get started, we’ve selected a few ibm-cloud-sdk-core 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 watson-developer-cloud / node-sdk / lib / recognize-stream.ts View on Github external
static getContentType(buffer: Buffer): string {
    // the substr really shouldn't be necessary, but there's a bug somewhere that can cause buffer.slice(0,4) to return
    // the entire contents of the buffer, so it's a failsafe to catch that
    return contentType.fromHeader(buffer);
  }