mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:53:53 -04:00
Fixed notes.js util to catch null values
This commit is contained in:
@@ -5,6 +5,15 @@
|
||||
* @returns {*}
|
||||
*/
|
||||
module.exports = (string) => {
|
||||
if(string === null) {
|
||||
return {
|
||||
note: null,
|
||||
source: null,
|
||||
auth_type: null,
|
||||
auth_oidc_domain: null
|
||||
};
|
||||
}
|
||||
|
||||
const match = string.match(/^(?:(?<note>.*?)\|\|;;\|\|(?<source>[^|]*)\|\|;;\|\|(?<auth_type>[^|]*)\|\|;;\|\|(?<auth_oidc_domain>[^|]*)|(?<note_only>.+))$/);
|
||||
const { note, source, auth_type, auth_oidc_domain, note_only } = match.groups;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user