Skip to content

Commit

Permalink
lint: conform array-foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Feb 12, 2024
1 parent 5b93205 commit 86a7ce9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/telemetry/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const tryFlushSlogSender = async (
await Promise.resolve(slogSender?.forceFlush?.()).catch(err => {
log?.('Failed to flush slog sender', err);
if (err.errors) {
err.errors.forEach(error => {
for (const error of err.errors) {
log?.('nested error:', error);
});
}
}
if (env.SLOGSENDER_FAIL_ON_ERROR) {
throw err;
Expand Down Expand Up @@ -70,12 +70,12 @@ export const getResourceAttributes = ({
}
if (OTEL_RESOURCE_ATTRIBUTES) {
// Allow overriding resource attributes.
OTEL_RESOURCE_ATTRIBUTES.split(',').forEach(kv => {
for (const kv of OTEL_RESOURCE_ATTRIBUTES.split(',')) {
const match = kv.match(/^([^=]*)=(.*)$/);
if (match) {
resourceAttributes[match[1]] = match[2];
}
});
}
}
return resourceAttributes;
};
Expand Down
6 changes: 3 additions & 3 deletions packages/telemetry/src/slog-to-otel.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const serializeInto = (value, prefix, target = {}, depth = 3) => {
} else {
const proto = Object.getPrototypeOf(value);
if (proto == null || proto === Object.prototype) {
Object.entries(value).forEach(([key, nested]) =>
serializeInto(nested, `${prefix}.${key}`, target, depth),
);
for (const [key, nested] of Object.entries(value)) {
serializeInto(nested, `${prefix}.${key}`, target, depth);
}
return target;
}
}
Expand Down

0 comments on commit 86a7ce9

Please sign in to comment.