git ssb

0+

cel-desktop / ssb-pkg



Tree: ca90b5ca0579ebdcc0635288bce4978e3fb200f5

Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-79-npm / negotiator / negotiator.js

511 bytesRaw
1'use strict';
2
3var Negotiator = require('negotiator');
4var availableMediaTypes = [ 'text/html', 'text/plain', 'application/json' ];
5var request = { headers: { } };
6var negotiator = new Negotiator(request);
7
8var mt1 = negotiator.mediaTypes();
9var mt2 = negotiator.mediaTypes(availableMediaTypes);
10var mt3 = negotiator.mediaType(availableMediaTypes);
11
12if (mt1.join('+') !== '*/*') return;
13if (mt2.join('+') !== 'text/html+text/plain+application/json') return;
14if (mt3 !== 'text/html') return;
15
16console.log('ok');
17

Built with git-ssb-web