git ssb

0+

cel-desktop / ssb-pkg



Tree: 65191f9a9664f013ebe726bb95a1a54b086e1bd5

Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / 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