Skip to content

Commit

Permalink
fix: fixed typo validateSequnce > validateSequence (closes #518) (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism authored Oct 5, 2023
1 parent be90069 commit 8766ab9
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion imap-core/lib/commands/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
return callback(new Error('Invalid mailbox argument for ' + cmd));
}

if (!imapTools.validateSequnce(range)) {
if (!imapTools.validateSequence(range)) {
return callback(new Error('Invalid sequence set for ' + cmd));
}

Expand Down
2 changes: 1 addition & 1 deletion imap-core/lib/commands/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {

let isUid = (command.command || '').toString().toUpperCase() === 'UID FETCH' ? true : false;
let range = (command.attributes[0] && command.attributes[0].value) || '';
if (!imapTools.validateSequnce(range)) {
if (!imapTools.validateSequence(range)) {
return callback(new Error('Invalid sequence set for ' + command.command));
}
let messages = imapTools.getMessageRange(this.selected.uidList, range, isUid);
Expand Down
2 changes: 1 addition & 1 deletion imap-core/lib/commands/move.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
return callback(new Error('Invalid mailbox argument for ' + cmd));
}

if (!imapTools.validateSequnce(range)) {
if (!imapTools.validateSequence(range)) {
return callback(new Error('Invalid sequence set for ' + cmd));
}

Expand Down
4 changes: 2 additions & 2 deletions imap-core/lib/commands/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function parseQueryTerms(terms, uidList) {

if (!termType) {
// try if it is a sequence set
if (imapTools.validateSequnce(term)) {
if (imapTools.validateSequence(term)) {
// resolve sequence list to an array of UID values
curTerm = ['uid', imapTools.getMessageRange(uidList, term, false)];
} else {
Expand All @@ -179,7 +179,7 @@ function parseQueryTerms(terms, uidList) {
if (termType[i] === 'expression') {
curTerm.push(getTerm(level + 1));
} else if (termType[i] === 'sequence') {
if (!imapTools.validateSequnce(terms[pos])) {
if (!imapTools.validateSequence(terms[pos])) {
throw new Error('Invalid sequence set for ' + term.toUpperCase());
}
// resolve sequence list to an array of UID values
Expand Down
2 changes: 1 addition & 1 deletion imap-core/lib/commands/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = {
silent = true;
}

if (!imapTools.validateSequnce(range)) {
if (!imapTools.validateSequence(range)) {
return callback(new Error('Invalid sequence set for STORE'));
}

Expand Down
2 changes: 1 addition & 1 deletion imap-core/lib/commands/uid-expunge.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
}

let range = (command.attributes[0] && command.attributes[0].value) || '';
if (!imapTools.validateSequnce(range)) {
if (!imapTools.validateSequence(range)) {
return callback(new Error('Invalid sequence set for UID EXPUNGE'));
}
let messages = imapTools.getMessageRange(this.selected.uidList, range, true);
Expand Down
2 changes: 1 addition & 1 deletion imap-core/lib/commands/uid-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = {
silent = true;
}

if (!imapTools.validateSequnce(range)) {
if (!imapTools.validateSequence(range)) {
return callback(new Error('Invalid sequence set for UID STORE'));
}

Expand Down
2 changes: 1 addition & 1 deletion imap-core/lib/imap-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ module.exports.searchMapping = {
* @param {range} range Sequence range, eg "1,2,3:7"
* @returns {Boolean} True if the string looks like a sequence range
*/
module.exports.validateSequnce = function (range) {
module.exports.validateSequence = function (range) {
return !!(range.length && /^(\d+|\*)(:\d+|:\*)?(,(\d+|\*)(:\d+|:\*)?)*$/.test(range));
};

Expand Down

0 comments on commit 8766ab9

Please sign in to comment.