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.
32 lines (31 loc) • 822 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
const append = v => {
if (typeof v === 'boolean') {
p.append(key, v ? 'true' : 'false');
} else {
p.append(key, String(v));
}
};
if (Array.isArray(value)) {
value.forEach(v => {
if (v == null) return;
append(v);
});
} else {
append(value);
}
});
return p.toString();
}
const dgPath = (...segments) => '/' + segments.map(s => encodeURIComponent(String(s))).join('/');
exports.dgPath = dgPath;
//# sourceMappingURL=url.js.map