git ssb

0+

cel-desktop / ssb-pkg



Tree: e9d9dec1d00ff365112ca0f981bbda15e3682528

Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / 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