Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed typo validateSequnce > validateSequence (closes #518) #520

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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