From 4b681dd31a85622a77b7a258e86b2f57741eb4be Mon Sep 17 00:00:00 2001 From: singuerinc Date: Mon, 25 Feb 2019 22:26:42 +0100 Subject: [PATCH] docs: _utils jsdocs --- src/_utils.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/_utils.js b/src/_utils.js index 59c5a01..73da457 100644 --- a/src/_utils.js +++ b/src/_utils.js @@ -1,12 +1,15 @@ +/** + * @param {string} str + */ export function _partsSpecial(str) { - const cleaned = str.replace( - /^[\s]*([CMEDGPNATFSHMORW]{1,5})[^A-Z0-9]*([0-9]{4})[\s]*$/i, - "$1,$2" - ); + const cleaned = str.replace(/^[\s]*([CMEDGPNATFSHMORW]{1,5})[\W]*([0-9]{4})[\s]*$/i, "$1,$2"); return cleaned.split(","); } +/** + * @param {string} str + */ export function _partsOld(str) { const cleaned = str.replace( /^[\s]*([A-Z]{1,3})[^A-Z0-9]*([0-9]{4})[^A-Z0-9]*([A-Z]{2})[\s]*$/i, @@ -16,6 +19,9 @@ export function _partsOld(str) { return cleaned.split(","); } +/** + * @param {string} str + */ export function _partsNew(str) { const cleaned = str.replace( /^[\s]*([0-9]{4})[^A-Z0-9]*([BCDFGHJKLMNPRSTVWXYZ]{3})[\s]*$/i,