Skip to content

Commit bde73cd

Browse files
author
Swapnil Nagar
committed
Removing Log Statements
1 parent 3e98a8b commit bde73cd

File tree

8 files changed

+9
-39
lines changed

8 files changed

+9
-39
lines changed

src/addBindingName.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export function addBindingName<T extends { type: string; name?: string }>(
1616
binding: T,
1717
suffix: string
1818
): T & { name: string } {
19-
console.log('addBindingName: binding', JSON.stringify(binding));
2019
if (!binding.name) {
2120
let bindingType = binding.type;
2221
if (!bindingType.toLowerCase().endsWith(suffix.toLowerCase())) {

src/converters/fromRpcTypedData.ts

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,23 @@ export function fromRpcTypedData(data: RpcTypedData | null | undefined): unknown
1010
if (!data) {
1111
return undefined;
1212
} else if (isDefined(data.string)) {
13-
const result = tryJsonParse(data.string);
14-
return result;
13+
return tryJsonParse(data.string);
1514
} else if (isDefined(data.json)) {
16-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
17-
const result = JSON.parse(data.json);
18-
return result;
15+
return JSON.parse(data.json);
1916
} else if (isDefined(data.bytes)) {
20-
const result = Buffer.from(data.bytes);
21-
return result;
17+
return Buffer.from(data.bytes);
2218
} else if (isDefined(data.stream)) {
23-
const result = Buffer.from(data.stream);
24-
return result;
19+
return Buffer.from(data.stream);
2520
} else if (isDefined(data.http)) {
26-
const result = new HttpRequest(data.http);
27-
return result;
21+
return new HttpRequest(data.http);
2822
} else if (isDefined(data.int)) {
29-
console.log('Condition: data.int - returning:', data.int);
3023
return data.int;
3124
} else if (isDefined(data.double)) {
32-
console.log('Condition: data.double - returning:', data.double);
3325
return data.double;
3426
} else if (data.collectionBytes && isDefined(data.collectionBytes.bytes)) {
35-
const result = data.collectionBytes.bytes.map((d) => Buffer.from(d));
36-
return result;
27+
return data.collectionBytes.bytes.map((d) => Buffer.from(d));
3728
} else if (data.collectionString && isDefined(data.collectionString.string)) {
38-
const result = data.collectionString.string.map(tryJsonParse);
39-
return result;
29+
return data.collectionString.string.map(tryJsonParse);
4030
} else if (data.collectionDouble && isDefined(data.collectionDouble.double)) {
4131
return data.collectionDouble.double;
4232
} else if (data.collectionSint64 && isDefined(data.collectionSint64.sint64)) {
@@ -51,9 +41,7 @@ export function fromRpcTypedData(data: RpcTypedData | null | undefined): unknown
5141

5242
function tryJsonParse(data: string): unknown {
5343
try {
54-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
55-
const parsed = JSON.parse(data);
56-
return parsed;
44+
return JSON.parse(data);
5745
} catch {
5846
return data;
5947
}

src/converters/toRpcTypedData.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// Copyright (c) .NET Foundation. All rights reserved.
5-
// Licensed under the MIT License.
6-
74
import { RpcTypedData } from '@azure/functions-core';
85

96
export function toRpcTypedData(data: unknown): RpcTypedData | null | undefined {
@@ -26,7 +23,6 @@ export function toRpcTypedData(data: unknown): RpcTypedData | null | undefined {
2623
return { double: data };
2724
}
2825
} else {
29-
const jsonString = JSON.stringify(data);
30-
return { json: jsonString };
26+
return { json: JSON.stringify(data) };
3127
}
3228
}

src/deferred-binding/connectionDetails.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export function parseConnectionDetails(jsonBuffer: Buffer | null | undefined): B
4242
throw new Error('Connection details content is null or undefined');
4343
}
4444
const parsedObject: unknown = JSON.parse(jsonBuffer.toString());
45-
console.log('Parsed object:', parsedObject);
4645

4746
if (isBlobConnectionDetails(parsedObject)) {
4847
return parsedObject;

src/deferred-binding/storage-blob/azureStorageBlobClientFactory.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,15 @@ export class AzureStorageBlobClientFactory {
6464
if (!clientId) {
6565
throw new Error(`Environment variable ${connectionName}__clientId is not defined.`);
6666
}
67-
console.log(`Using user-assigned managed identity with client ID: ${clientId.substring(0, 8)}...`);
6867
return new ManagedIdentityUserStrategy(connectionUrl, clientId);
6968
}
7069

7170
// Next, check for system-assigned managed identity
7271
if (isSystemBasedManagedIdentity(connectionName)) {
73-
console.log('Using system-assigned managed identity for connection');
7472
return new ManagedIdentitySystemStrategy(connectionUrl);
7573
}
7674

7775
// Default to connection string
78-
console.log('Using connection string authentication');
7976
return new ConnectionStringStrategy(connectionUrl);
8077
}
8178
}

src/trigger.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export function timer(options: TimerTriggerOptions): TimerTrigger {
5050
}
5151

5252
export function storageBlob(options: StorageBlobTriggerOptions): StorageBlobTrigger {
53-
console.log('storageBlob', options);
5453
return addTriggerBindingName({
5554
...options,
5655
type: 'blobTrigger',
@@ -132,6 +131,5 @@ export function generic(options: GenericTriggerOptions): FunctionTrigger {
132131
}
133132

134133
function addTriggerBindingName<T extends { type: string; name?: string }>(binding: T): T & { name: string } {
135-
console.log('addTriggerBindingName', binding);
136134
return addBindingName(binding, 'Trigger');
137135
}

test/converters/fromRpcTypedData.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ describe('modelBindingData scenario', () => {
117117
let mockBlobClient: any;
118118

119119
beforeEach(() => {
120-
// Suppress console.log output during tests
121-
console.log = () => {};
122-
123120
// Create mock blob client for testing
124121
mockBlobClient = {
125122
blobClient: { url: 'https://test.blob.core.windows.net/container/blob' },

test/converters/toCoreFunctionMetadata.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ describe('toCoreFunctionMetadata deferred binding tests', () => {
240240
return: output.http({}),
241241
});
242242

243-
console.log('Blob trigger result: 3 : ', result);
244-
245243
expect(result).to.deep.equal({
246244
name: 'blobFunction',
247245
bindings: {
@@ -276,8 +274,6 @@ describe('toCoreFunctionMetadata deferred binding tests', () => {
276274
],
277275
});
278276

279-
console.log('Blob trigger result: 4 : ', result);
280-
281277
expect(result).to.deep.equal({
282278
name: 'funcName',
283279
bindings: {

0 commit comments

Comments
 (0)