UNPKG

watson-speech

Version:

IBM Watson Speech to Text and Text to Speech SDK for web browsers.

16 lines (13 loc) 437 B
'use strict'; /** * Returns true if the result is missing it's timestamps * @param {Object} data * @return {Boolean} */ module.exports = function noTimestamps(data) { return data.results.some(function(result) { var alt = result.alternatives && result.alternatives[0]; return !!(alt && ((alt.transcript.trim() && !alt.timestamps) || !alt.timestamps.length)); }); }; module.exports.ERROR_NO_TIMESTAMPS = 'NO_TIMESTAMPS';