( encoding: string, spec: EncodingSpecificity, i = -1, )
| 63 | } |
| 64 | |
| 65 | function specify( |
| 66 | encoding: string, |
| 67 | spec: EncodingSpecificity, |
| 68 | i = -1, |
| 69 | ): Specificity | undefined { |
| 70 | if (!spec.encoding) { |
| 71 | return; |
| 72 | } |
| 73 | let s = 0; |
| 74 | if (spec.encoding.toLowerCase() === encoding.toLowerCase()) { |
| 75 | s = 1; |
| 76 | } else if (spec.encoding !== "*") { |
| 77 | return; |
| 78 | } |
| 79 | |
| 80 | return { |
| 81 | i, |
| 82 | o: spec.i, |
| 83 | q: spec.q, |
| 84 | s, |
| 85 | }; |
| 86 | } |
| 87 | |
| 88 | function parseAcceptEncoding(accept: string): EncodingSpecificity[] { |
| 89 | const accepts = accept.split(","); |
no outgoing calls
no test coverage detected