passkit-generator
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -7,3 +7,3 @@ # Changelog | ||
___ | ||
## 1.6.1 | ||
## 1.6.1 + 1.6.2 | ||
@@ -10,0 +10,0 @@ [ [#baf096c38](/commit/baf096c38067aae0ec459487db865851531f97b2) ] |
{ | ||
"name": "passkit-generator", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "The easiest way to generate custom Apple Wallet passes in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,3 +20,3 @@ const fs = require("fs"); | ||
removeHidden, dateToW3CString, | ||
isValidRGB, parsePEM | ||
isValidRGB | ||
} = require("./utils"); | ||
@@ -222,2 +222,4 @@ | ||
} | ||
throw new Error(err); | ||
} | ||
@@ -775,2 +777,19 @@ } | ||
/** | ||
* Parses the PEM-formatted passed text (certificates) | ||
* | ||
* @function parsePEM | ||
* @params {String} element - Text content of .pem files | ||
* @params {String=} passphrase - passphrase for the key | ||
* @returns {Object} The parsed certificate or key in node forge format | ||
*/ | ||
function parsePEM(pemName, element, passphrase) { | ||
if (pemName === "signerKey" && passphrase) { | ||
return forge.pki.decryptRsaPrivateKey(element, String(passphrase)); | ||
} else { | ||
return forge.pki.certificateFromPem(element); | ||
} | ||
} | ||
/** | ||
* Automatically generates barcodes for all the types given common info | ||
@@ -777,0 +796,0 @@ * |
@@ -5,19 +5,2 @@ const moment = require("moment"); | ||
/** | ||
* Parses the PEM-formatted passed text (certificates) | ||
* | ||
* @function parsePEM | ||
* @params {String} element - Text content of .pem files | ||
* @params {String=} passphrase - passphrase for the key | ||
* @returns {Object} The parsed certificate or key in node forge format | ||
*/ | ||
function parsePEM(pemName, element, passphrase) { | ||
if (pemName === "signerKey" && passphrase) { | ||
return forge.pki.decryptRsaPrivateKey(element, String(passphrase)); | ||
} else { | ||
return forge.pki.certificateFromPem(element); | ||
} | ||
} | ||
/** | ||
* Checks if an rgb value is compliant with CSS-like syntax | ||
@@ -118,4 +101,3 @@ * | ||
dateToW3CString, | ||
isValidRGB, | ||
parsePEM | ||
isValidRGB | ||
}; |
110856