export function serializeKeyToString()

in src/NoSqlProviderUtils.ts [145:161]


export function serializeKeyToString(key: KeyType, keyPath: KeyPathType): string {
    if (isCompoundKeyPath(keyPath)) {
        if (isArray(key)) {
            return map(key, k => serializeValueToOrderableString(k)).join(keypathJoinerString);
        } else {
            throw new Error('serializeKeyToString called with a compound keypath (' + JSON.stringify(keyPath) +
                ') but a non-compound key (' + JSON.stringify(key) + ')');
        }
    } else {
        if (isArray(key)) {
            throw new Error('serializeKeyToString called with a non-compound keypath (' + JSON.stringify(keyPath) +
                ') but a compound key (' + JSON.stringify(key) + ')');
        } else {
            return serializeValueToOrderableString(key);
        }
    }
}