react-native-deepgram
Version:
React Native SDK for Deepgram's AI-powered speech-to-text, real-time transcription, and text intelligence APIs. Supports live audio streaming, file transcription, sentiment analysis, and topic detection for iOS and Android.
29 lines (28 loc) • 898 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildParams = buildParams;
exports.dgPath = void 0;
function buildParams(map) {
const p = new URLSearchParams();
Object.entries(map).forEach(([key, value]) => {
if (value == null) return; // skip undefined/null
if (Array.isArray(value)) {
// multiple values
value.forEach(v => p.append(key, v));
} else if (typeof value === 'boolean') {
if (value) p.append(key, 'true'); // only include true flags
} else {
if (typeof value === 'number') {
p.append(key, String(value)); // convert number to string
} else {
p.append(key, value); // plain string
}
}
});
return p.toString();
}
const dgPath = (...segments) => '/' + segments.map(s => encodeURIComponent(String(s))).join('/');
exports.dgPath = dgPath;
//# sourceMappingURL=url.js.map