@svta/common-media-library
Version:
A common library for media playback in JavaScript
28 lines • 1.01 kB
JavaScript
import { serializeItem } from './serializeItem.js';
import { serializeParams } from './serializeParams.js';
// 4.1.1.1. Serializing an Inner List
//
// Given an array of (member_value, parameters) tuples as inner_list,
// and parameters as list_parameters, return an ASCII string suitable
// for use in a HTTP field value.
//
// 1. Let output be the string "(".
//
// 2. For each (member_value, parameters) of inner_list:
//
// 1. Append the result of running Serializing an Item
// (Section 4.1.3) with (member_value, parameters) to output.
//
// 2. If more values remain in inner_list, append a single SP to
// output.
//
// 3. Append ")" to output.
//
// 4. Append the result of running Serializing Parameters
// (Section 4.1.1.2) with list_parameters to output.
//
// 5. Return output.
export function serializeInnerList(value) {
return `(${value.value.map(serializeItem).join(' ')})${serializeParams(value.params)}`;
}
//# sourceMappingURL=serializeInnerList.js.map