Skip to content

Commit ae623d1

Browse files
committed
Add more 'Import Buffer' code as per PR #1559 of Sławomir Osoba
1 parent f189de2 commit ae623d1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/thin/protocol/capabilities.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
'use strict';
2828

29-
const Buffer = require("buffer").Buffer;
29+
const { Buffer } = require('buffer');
3030
const constants = require("./constants.js");
3131
const errors = require('../../errors');
3232

lib/thin/protocol/encryptDecrypt.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
22

33
//-----------------------------------------------------------------------------
44
//
@@ -26,7 +26,7 @@
2626

2727
'use strict';
2828

29-
const Buffer = require('buffer').Buffer;
29+
const { Buffer } = require('buffer');
3030
const crypto = require('crypto');
3131

3232
let algorithm = 'aes-256-cbc';

lib/thin/statement.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
'use strict';
2828

29-
const buffer = require('buffer').Buffer;
29+
const { Buffer } = require('buffer');
3030
const constants = require('../constants');
3131
const thinUtil = require("./util.js");
3232

@@ -202,7 +202,7 @@ class Statement {
202202
//---------------------------------------------------------------------------
203203
_prepare(sql) {
204204
this.sql = sql;
205-
this.sqlBytes = buffer.from(this.sql, 'utf8');
205+
this.sqlBytes = Buffer.from(this.sql, 'utf8');
206206
this.sqlLength = this.sqlBytes.length;
207207
// replace literals with a specific literal
208208
sql = sql.replace(CONSTANT_STRING_PATTERN, "'S'");

0 commit comments

Comments
 (0)