MCPcopy Create free account
hub / github.com/openai/openai-node / encoder

Function encoder

tests/qs/stringify.test.ts:1955–1963  ·  view source on GitHub ↗
(str, defaultEncoder, charset, type)

Source from the content-addressed store, hash-verified

1953 test('allows for encoding keys and values differently', function () {
1954 // @ts-expect-error
1955 var encoder = function (str, defaultEncoder, charset, type) {
1956 if (type === 'key') {
1957 return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase();
1958 }
1959 if (type === 'value') {
1960 return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase();
1961 }
1962 throw 'this should never happen! type: ' + type;
1963 };
1964
1965 // st.deepEqual(stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');
1966 expect(stringify({ KeY: 'vAlUe' }, { encoder: encoder })).toBe('key=VALUE');

Callers 1

inner_stringifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected