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.
23 lines (22 loc) • 762 B
JavaScript
;
export 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();
}
export const dgPath = (...segments) => '/' + segments.map(s => encodeURIComponent(String(s))).join('/');
//# sourceMappingURL=url.js.map