ga4-export-fixer 0.1.3-dev.3 → 0.1.3-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils.js +4 -3
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -198,7 +198,7 @@ const mergeSQLConfigurations = (defaultConfig, inputConfig = {}) => {
|
|
|
198
198
|
/**
|
|
199
199
|
* Checks if a given object is a Dataform table reference object.
|
|
200
200
|
*
|
|
201
|
-
* A Dataform table reference object is expected to have the properties: 'name', and '
|
|
201
|
+
* A Dataform table reference object is expected to have the properties: 'name', and 'dataset'.
|
|
202
202
|
*
|
|
203
203
|
* @param {Object} obj - The object to check.
|
|
204
204
|
* @returns {boolean} True if the object is a Dataform table reference, false otherwise.
|
|
@@ -207,7 +207,8 @@ const isDataformTableReferenceObject = (obj) => {
|
|
|
207
207
|
return obj &&
|
|
208
208
|
typeof obj === 'object' &&
|
|
209
209
|
Object.hasOwn(obj, 'name') &&
|
|
210
|
-
|
|
210
|
+
// Dataform transforms the schema key to dataset key when using ctx.ref()
|
|
211
|
+
(Object.hasOwn(obj, 'dataset') || Object.hasOwn(obj, 'schema'));
|
|
211
212
|
};
|
|
212
213
|
|
|
213
214
|
|
|
@@ -215,7 +216,7 @@ const isDataformTableReferenceObject = (obj) => {
|
|
|
215
216
|
* Sets the Dataform context for a configuration object.
|
|
216
217
|
*
|
|
217
218
|
* This function updates the provided config object by resolving the `sourceTable` property. If the `sourceTable`
|
|
218
|
-
* is a Dataform table reference object (with 'name', and '
|
|
219
|
+
* is a Dataform table reference object (with 'name', and 'dataset' properties), it uses `ctx.ref()` to
|
|
219
220
|
* obtain the correct reference. Otherwise, it checks if `sourceTable` is a string in the format '`project.dataset.table`'.
|
|
220
221
|
* If not, it throws an error. Finally, it sets the `self` and `incremental` properties on the config using
|
|
221
222
|
* `ctx.self()` and `ctx.incremental()`, respectively.
|