Skip to content

Commit

Permalink
docs: _utils jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
singuerinc committed Feb 25, 2019
1 parent b0a41de commit 4b681dd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/_utils.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 4b681dd

Please sign in to comment.