Merge pull request #310 from eleith/v3.8.1

release: v3.9.0
This commit is contained in:
eleith 2022-04-13 15:48:45 -07:00 committed by GitHub
commit b91cf6c97f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 39 additions and 19 deletions

View File

@ -9,6 +9,12 @@
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-ignore": "allow-with-description"
}
],
"@typescript-eslint/no-explicit-any": [
"error",
{

View File

@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [3.9.0] - [TBD]
### Added
- support `isolatedModules` and `preserveValueImports` compilation scenarios [#305](https://github.com/eleith/emailjs/pull/305)
### Fixed
- support `typescript@3.8.3` [#307](https://github.com/eleith/emailjs/issues/307)
- the types change in `v3.8.0` for `Client#send` & `Client#sendAsync` unintentionally raised the minimum `typescript` requirement. fixing this involved weakening the types for those functions, which may require modifying your code. this change will be reverted for `v4.0.0`.
## [3.8.0] - 2022-03-17
### Added
- support `typescript@4.6`

View File

@ -33,7 +33,15 @@
"smtp-server": "3.10.0",
"ts-node": "10.7.0",
"tslib": "2.3.1",
"typescript": "4.6.2"
"typescript": "3.8.3"
},
"peerDependencies": {
"typescript": ">=3.8.3"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"resolutions": {
"nodemailer": "6.7.2"

View File

@ -280,7 +280,7 @@ const RANGES = [
[0x0a],
[0x0d],
[0x20, 0x3c],
[0x3e, 0x7e], // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
[0x3e, 0x7e],
];
const LOOKUP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
const MAX_CHUNK_LENGTH = 16383; // must be multiple of 3
@ -887,8 +887,7 @@ class MessageStream extends stream.Stream {
const outputData = (attachment, callback) => {
var _a, _b;
outputBase64(attachment.encoded
? (_a = attachment.data) !== null && _a !== void 0 ? _a : ''
: Buffer.from((_b = attachment.data) !== null && _b !== void 0 ? _b : '').toString('base64'), callback);
? (_a = attachment.data) !== null && _a !== void 0 ? _a : '' : Buffer.from((_b = attachment.data) !== null && _b !== void 0 ? _b : '').toString('base64'), callback);
};
/**
* @param {Message} message the message to output

File diff suppressed because one or more lines are too long

View File

@ -276,7 +276,7 @@ const RANGES = [
[0x0a],
[0x0d],
[0x20, 0x3c],
[0x3e, 0x7e], // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
[0x3e, 0x7e],
];
const LOOKUP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
const MAX_CHUNK_LENGTH = 16383; // must be multiple of 3
@ -883,8 +883,7 @@ class MessageStream extends Stream {
const outputData = (attachment, callback) => {
var _a, _b;
outputBase64(attachment.encoded
? (_a = attachment.data) !== null && _a !== void 0 ? _a : ''
: Buffer.from((_b = attachment.data) !== null && _b !== void 0 ? _b : '').toString('base64'), callback);
? (_a = attachment.data) !== null && _a !== void 0 ? _a : '' : Buffer.from((_b = attachment.data) !== null && _b !== void 0 ? _b : '').toString('base64'), callback);
};
/**
* @param {Message} message the message to output

File diff suppressed because one or more lines are too long

View File

@ -49,9 +49,9 @@ export class SMTPClient {
* @param {MessageCallback} callback .
* @returns {void}
*/
public send<T extends Message | MessageHeaders>(
msg: T,
callback: MessageCallback<T>
public send(
msg: Message | MessageHeaders,
callback: MessageCallback<Message | MessageHeaders>
) {
const message =
msg instanceof Message

View File

@ -83,7 +83,7 @@ test('client invokes callback exactly once for invalid connection', async (t) =>
incrementCounter();
}
});
// @ts-expect-error the error event is only accessible from the protected socket property
// @ts-ignore the error event is only accessible from the protected socket property
invalidClient.smtp.sock.once('error', () => {
if (counter === 1) {
resolve();
@ -345,7 +345,7 @@ test('client send can have result awaited when promisified', async (t) => {
};
try {
const message = await sendAsync(new Message(msg));
const message = (await sendAsync(new Message(msg))) as Message;
t.true(message instanceof Message);
t.like(message, {
alternative: null,

View File

@ -13,7 +13,7 @@ import type { MessageHeaders } from '../smtp/message';
// eslint-disable-next-line no-var
var __dirname: string;
// @ts-expect-error compat hack for node 10
// @ts-ignore compat hack for node 10
if (__dirname == null) {
__dirname = join(process.cwd(), 'test');
}

View File

@ -2682,10 +2682,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"
typescript@4.6.2:
version "4.6.2"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4"
integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==
typescript@3.8.3:
version "3.8.3"
resolved "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
uc.micro@^1.0.1:
version "1.0.6"