From 789475e2e2ea1fed8705dbc26e5bce8e54b23722 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 11 Oct 2023 10:58:27 +0200 Subject: [PATCH] fix(ember): Avoid pulling in utils at build time It seems some have an issue because of this, and maybe this is overkill anyhow. So I just inline a minimal version of this into the build file here instead, let's see if that fixes it. --- packages/ember/index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/ember/index.js b/packages/ember/index.js index d2db76846bfa..96e79bccf704 100644 --- a/packages/ember/index.js +++ b/packages/ember/index.js @@ -2,8 +2,6 @@ const fs = require('fs'); const crypto = require('crypto'); -const { dropUndefinedKeys } = require('@sentry/utils'); - function readSnippet(fileName) { return fs.readFileSync(`${__dirname}/vendor/${fileName}`, 'utf8'); } @@ -103,3 +101,15 @@ function isScalar(val) { function isPlainObject(obj) { return typeof obj === 'object' && obj.constructor === Object && obj.toString() === '[object Object]'; } + +function dropUndefinedKeys(obj) { + const newObj = {}; + + for (const key in obj) { + if (obj[key] !== undefined) { + newObj[key] = obj[key]; + } + } + + return newObj; +}