-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededlet's do it
Description
Description
This codemod should migrate tls.SecurePair to tls.TLSSocket. It's useful to migrate code that uses the deprecated tls.SecurePair class which has been removed.
It should handle both constructor usage and method calls on SecurePair instances.
It should support both tls.SecurePair direct usage and destructured imports from tls module.
Example
Case 1
Before:
const tls = require('node:tls');
// Using tls.SecurePair constructor
const pair = new tls.SecurePair();
const cleartext = pair.cleartext;
const encrypted = pair.encrypted;
// Direct import
const { SecurePair } = require('node:tls');
const pair2 = new SecurePair();After:
const tls = require('node:tls');
// Using tls.TLSSocket instead
const socket = new tls.TLSSocket(socket);
// Note: Direct migration may require additional context-specific changes
// as SecurePair and TLSSocket have different APIs
// Direct import
const { TLSSocket } = require('node:tls');
const socket2 = new TLSSocket(socket);Case 2
Before:
import tls from 'node:tls';
// Using tls.SecurePair constructor
const pair = new tls.SecurePair();
const cleartext = pair.cleartext;
const encrypted = pair.encrypted;
// Direct import
import { SecurePair } from 'node:tls';
const pair2 = new SecurePair();After:
import tls from 'node:tls';
// Using tls.TLSSocket instead
const socket = new tls.TLSSocket(socket);
// Note: Direct migration may require additional context-specific changes
// as SecurePair and TLSSocket have different APIs
// Direct import
import { TLSSocket } from 'node:tls';
const socket2 = new TLSSocket(socket);REFS
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededlet's do it
Type
Projects
Status
🔖 Todo