@vyng/truecaller-node
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -10,18 +10,18 @@ // lib/fetchPublicKey.js | ||
const internalFetchPublicKeys = (url = publicKeyUrl) => ( | ||
request({ | ||
const internalFetchPublicKeys = async (url = publicKeyUrl) => { | ||
const { body } = await request({ | ||
url, | ||
method: 'GET', | ||
json: true, | ||
}).then(({ body }) => { | ||
if (!body || !Array.isArray(body) || body.length === 0) { | ||
throw Error(`Invalid public key received from ${url}`); | ||
} | ||
}); | ||
return body.map(({ key }) => ( | ||
pemtools(Buffer.from(key, 'base64'), 'PUBLIC KEY').pem | ||
)); | ||
}) | ||
); | ||
if (!Array.isArray(body) || body.length === 0) { | ||
throw Error(`Invalid public key received from ${url}`); | ||
} | ||
return body.map(({ key }) => ( | ||
pemtools(Buffer.from(key, 'base64'), 'PUBLIC KEY').pem | ||
)); | ||
}; | ||
module.exports = moize.default( | ||
@@ -28,0 +28,0 @@ internalFetchPublicKeys, |
@@ -18,2 +18,3 @@ // lib/index.js | ||
signatureAlgorithm = '', | ||
...others | ||
}, | ||
@@ -48,3 +49,4 @@ { | ||
return { | ||
profile, | ||
...profile, | ||
...others, | ||
payload, | ||
@@ -51,0 +53,0 @@ signature, |
{ | ||
"name": "@vyng/truecaller-node", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Node Truecaller profile verification", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67408
82