MCPcopy Index your code
hub / github.com/node-apn/node-apn / config

Function config

lib/config.js:16–55  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

14 const prepareCA = dependencies.prepareCA;
15
16 function config(options) {
17 let config = {
18 token: null,
19 cert: "cert.pem",
20 key: "key.pem",
21 ca: null,
22 pfx: null,
23 passphrase: null,
24 production: (process.env.NODE_ENV === "production"),
25 address: null,
26 port: 443,
27 proxy: null,
28 rejectUnauthorized: true,
29 connectionRetryLimit: 10,
30 heartBeat: 60000,
31 };
32
33 validateOptions(options);
34
35 extend(config, options);
36 configureAddress(config);
37
38 if (config.token) {
39 delete config.cert;
40 delete config.key;
41 delete config.pfx;
42
43 extend(config, { token: prepareToken(config.token) });
44 } else {
45 if (config.pfx || config.pfxData) {
46 config.cert = options.cert;
47 config.key = options.key;
48 }
49 extend(config, prepareCertificate(config));
50 }
51
52 extend(config, prepareCA(config));
53
54 return config;
55 }
56
57 function validateOptions(options) {
58 for (var key in options) {

Callers 2

ClientFunction · 0.85
config.jsFile · 0.85

Calls 4

validateOptionsFunction · 0.85
configureAddressFunction · 0.85
prepareTokenFunction · 0.85
prepareCAFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…