@xyd-js/host 0.1.0-build.158

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.
@@ -0,0 +1,692 @@
1
+ var GrowthbookProvider = (function (exports, webSdk, growthbook) {
2
+ 'use strict';
3
+
4
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
+
6
+ function getDefaultExportFromCjs (x) {
7
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
8
+ }
9
+
10
+ var lodash_isempty = {exports: {}};
11
+
12
+ /**
13
+ * lodash (Custom Build) <https://lodash.com/>
14
+ * Build: `lodash modularize exports="npm" -o ./`
15
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
16
+ * Released under MIT license <https://lodash.com/license>
17
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
18
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
19
+ */
20
+ lodash_isempty.exports;
21
+
22
+ var hasRequiredLodash_isempty;
23
+
24
+ function requireLodash_isempty () {
25
+ if (hasRequiredLodash_isempty) return lodash_isempty.exports;
26
+ hasRequiredLodash_isempty = 1;
27
+ (function (module, exports) {
28
+ /** Used as references for various `Number` constants. */
29
+ var MAX_SAFE_INTEGER = 9007199254740991;
30
+
31
+ /** `Object#toString` result references. */
32
+ var argsTag = '[object Arguments]',
33
+ funcTag = '[object Function]',
34
+ genTag = '[object GeneratorFunction]',
35
+ mapTag = '[object Map]',
36
+ objectTag = '[object Object]',
37
+ promiseTag = '[object Promise]',
38
+ setTag = '[object Set]',
39
+ weakMapTag = '[object WeakMap]';
40
+
41
+ var dataViewTag = '[object DataView]';
42
+
43
+ /**
44
+ * Used to match `RegExp`
45
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
46
+ */
47
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
48
+
49
+ /** Used to detect host constructors (Safari). */
50
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
51
+
52
+ /** Detect free variable `global` from Node.js. */
53
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
54
+
55
+ /** Detect free variable `self`. */
56
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
57
+
58
+ /** Used as a reference to the global object. */
59
+ var root = freeGlobal || freeSelf || Function('return this')();
60
+
61
+ /** Detect free variable `exports`. */
62
+ var freeExports = exports && !exports.nodeType && exports;
63
+
64
+ /** Detect free variable `module`. */
65
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
66
+
67
+ /** Detect the popular CommonJS extension `module.exports`. */
68
+ var moduleExports = freeModule && freeModule.exports === freeExports;
69
+
70
+ /**
71
+ * Gets the value at `key` of `object`.
72
+ *
73
+ * @private
74
+ * @param {Object} [object] The object to query.
75
+ * @param {string} key The key of the property to get.
76
+ * @returns {*} Returns the property value.
77
+ */
78
+ function getValue(object, key) {
79
+ return object == null ? undefined : object[key];
80
+ }
81
+
82
+ /**
83
+ * Checks if `value` is a host object in IE < 9.
84
+ *
85
+ * @private
86
+ * @param {*} value The value to check.
87
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
88
+ */
89
+ function isHostObject(value) {
90
+ // Many host objects are `Object` objects that can coerce to strings
91
+ // despite having improperly defined `toString` methods.
92
+ var result = false;
93
+ if (value != null && typeof value.toString != 'function') {
94
+ try {
95
+ result = !!(value + '');
96
+ } catch (e) {}
97
+ }
98
+ return result;
99
+ }
100
+
101
+ /**
102
+ * Creates a unary function that invokes `func` with its argument transformed.
103
+ *
104
+ * @private
105
+ * @param {Function} func The function to wrap.
106
+ * @param {Function} transform The argument transform.
107
+ * @returns {Function} Returns the new function.
108
+ */
109
+ function overArg(func, transform) {
110
+ return function(arg) {
111
+ return func(transform(arg));
112
+ };
113
+ }
114
+
115
+ /** Used for built-in method references. */
116
+ var funcProto = Function.prototype,
117
+ objectProto = Object.prototype;
118
+
119
+ /** Used to detect overreaching core-js shims. */
120
+ var coreJsData = root['__core-js_shared__'];
121
+
122
+ /** Used to detect methods masquerading as native. */
123
+ var maskSrcKey = (function() {
124
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
125
+ return uid ? ('Symbol(src)_1.' + uid) : '';
126
+ }());
127
+
128
+ /** Used to resolve the decompiled source of functions. */
129
+ var funcToString = funcProto.toString;
130
+
131
+ /** Used to check objects for own properties. */
132
+ var hasOwnProperty = objectProto.hasOwnProperty;
133
+
134
+ /**
135
+ * Used to resolve the
136
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
137
+ * of values.
138
+ */
139
+ var objectToString = objectProto.toString;
140
+
141
+ /** Used to detect if a method is native. */
142
+ var reIsNative = RegExp('^' +
143
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
144
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
145
+ );
146
+
147
+ /** Built-in value references. */
148
+ var Buffer = moduleExports ? root.Buffer : undefined,
149
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
150
+
151
+ /* Built-in method references for those with the same name as other `lodash` methods. */
152
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
153
+ nativeKeys = overArg(Object.keys, Object);
154
+
155
+ /* Built-in method references that are verified to be native. */
156
+ var DataView = getNative(root, 'DataView'),
157
+ Map = getNative(root, 'Map'),
158
+ Promise = getNative(root, 'Promise'),
159
+ Set = getNative(root, 'Set'),
160
+ WeakMap = getNative(root, 'WeakMap');
161
+
162
+ /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
163
+ var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
164
+
165
+ /** Used to detect maps, sets, and weakmaps. */
166
+ var dataViewCtorString = toSource(DataView),
167
+ mapCtorString = toSource(Map),
168
+ promiseCtorString = toSource(Promise),
169
+ setCtorString = toSource(Set),
170
+ weakMapCtorString = toSource(WeakMap);
171
+
172
+ /**
173
+ * The base implementation of `getTag`.
174
+ *
175
+ * @private
176
+ * @param {*} value The value to query.
177
+ * @returns {string} Returns the `toStringTag`.
178
+ */
179
+ function baseGetTag(value) {
180
+ return objectToString.call(value);
181
+ }
182
+
183
+ /**
184
+ * The base implementation of `_.isNative` without bad shim checks.
185
+ *
186
+ * @private
187
+ * @param {*} value The value to check.
188
+ * @returns {boolean} Returns `true` if `value` is a native function,
189
+ * else `false`.
190
+ */
191
+ function baseIsNative(value) {
192
+ if (!isObject(value) || isMasked(value)) {
193
+ return false;
194
+ }
195
+ var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
196
+ return pattern.test(toSource(value));
197
+ }
198
+
199
+ /**
200
+ * Gets the native function at `key` of `object`.
201
+ *
202
+ * @private
203
+ * @param {Object} object The object to query.
204
+ * @param {string} key The key of the method to get.
205
+ * @returns {*} Returns the function if it's native, else `undefined`.
206
+ */
207
+ function getNative(object, key) {
208
+ var value = getValue(object, key);
209
+ return baseIsNative(value) ? value : undefined;
210
+ }
211
+
212
+ /**
213
+ * Gets the `toStringTag` of `value`.
214
+ *
215
+ * @private
216
+ * @param {*} value The value to query.
217
+ * @returns {string} Returns the `toStringTag`.
218
+ */
219
+ var getTag = baseGetTag;
220
+
221
+ // Fallback for data views, maps, sets, and weak maps in IE 11,
222
+ // for data views in Edge < 14, and promises in Node.js.
223
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
224
+ (Map && getTag(new Map) != mapTag) ||
225
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
226
+ (Set && getTag(new Set) != setTag) ||
227
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
228
+ getTag = function(value) {
229
+ var result = objectToString.call(value),
230
+ Ctor = result == objectTag ? value.constructor : undefined,
231
+ ctorString = Ctor ? toSource(Ctor) : undefined;
232
+
233
+ if (ctorString) {
234
+ switch (ctorString) {
235
+ case dataViewCtorString: return dataViewTag;
236
+ case mapCtorString: return mapTag;
237
+ case promiseCtorString: return promiseTag;
238
+ case setCtorString: return setTag;
239
+ case weakMapCtorString: return weakMapTag;
240
+ }
241
+ }
242
+ return result;
243
+ };
244
+ }
245
+
246
+ /**
247
+ * Checks if `func` has its source masked.
248
+ *
249
+ * @private
250
+ * @param {Function} func The function to check.
251
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
252
+ */
253
+ function isMasked(func) {
254
+ return !!maskSrcKey && (maskSrcKey in func);
255
+ }
256
+
257
+ /**
258
+ * Checks if `value` is likely a prototype object.
259
+ *
260
+ * @private
261
+ * @param {*} value The value to check.
262
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
263
+ */
264
+ function isPrototype(value) {
265
+ var Ctor = value && value.constructor,
266
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
267
+
268
+ return value === proto;
269
+ }
270
+
271
+ /**
272
+ * Converts `func` to its source code.
273
+ *
274
+ * @private
275
+ * @param {Function} func The function to process.
276
+ * @returns {string} Returns the source code.
277
+ */
278
+ function toSource(func) {
279
+ if (func != null) {
280
+ try {
281
+ return funcToString.call(func);
282
+ } catch (e) {}
283
+ try {
284
+ return (func + '');
285
+ } catch (e) {}
286
+ }
287
+ return '';
288
+ }
289
+
290
+ /**
291
+ * Checks if `value` is likely an `arguments` object.
292
+ *
293
+ * @static
294
+ * @memberOf _
295
+ * @since 0.1.0
296
+ * @category Lang
297
+ * @param {*} value The value to check.
298
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
299
+ * else `false`.
300
+ * @example
301
+ *
302
+ * _.isArguments(function() { return arguments; }());
303
+ * // => true
304
+ *
305
+ * _.isArguments([1, 2, 3]);
306
+ * // => false
307
+ */
308
+ function isArguments(value) {
309
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
310
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
311
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
312
+ }
313
+
314
+ /**
315
+ * Checks if `value` is classified as an `Array` object.
316
+ *
317
+ * @static
318
+ * @memberOf _
319
+ * @since 0.1.0
320
+ * @category Lang
321
+ * @param {*} value The value to check.
322
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
323
+ * @example
324
+ *
325
+ * _.isArray([1, 2, 3]);
326
+ * // => true
327
+ *
328
+ * _.isArray(document.body.children);
329
+ * // => false
330
+ *
331
+ * _.isArray('abc');
332
+ * // => false
333
+ *
334
+ * _.isArray(_.noop);
335
+ * // => false
336
+ */
337
+ var isArray = Array.isArray;
338
+
339
+ /**
340
+ * Checks if `value` is array-like. A value is considered array-like if it's
341
+ * not a function and has a `value.length` that's an integer greater than or
342
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
343
+ *
344
+ * @static
345
+ * @memberOf _
346
+ * @since 4.0.0
347
+ * @category Lang
348
+ * @param {*} value The value to check.
349
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
350
+ * @example
351
+ *
352
+ * _.isArrayLike([1, 2, 3]);
353
+ * // => true
354
+ *
355
+ * _.isArrayLike(document.body.children);
356
+ * // => true
357
+ *
358
+ * _.isArrayLike('abc');
359
+ * // => true
360
+ *
361
+ * _.isArrayLike(_.noop);
362
+ * // => false
363
+ */
364
+ function isArrayLike(value) {
365
+ return value != null && isLength(value.length) && !isFunction(value);
366
+ }
367
+
368
+ /**
369
+ * This method is like `_.isArrayLike` except that it also checks if `value`
370
+ * is an object.
371
+ *
372
+ * @static
373
+ * @memberOf _
374
+ * @since 4.0.0
375
+ * @category Lang
376
+ * @param {*} value The value to check.
377
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
378
+ * else `false`.
379
+ * @example
380
+ *
381
+ * _.isArrayLikeObject([1, 2, 3]);
382
+ * // => true
383
+ *
384
+ * _.isArrayLikeObject(document.body.children);
385
+ * // => true
386
+ *
387
+ * _.isArrayLikeObject('abc');
388
+ * // => false
389
+ *
390
+ * _.isArrayLikeObject(_.noop);
391
+ * // => false
392
+ */
393
+ function isArrayLikeObject(value) {
394
+ return isObjectLike(value) && isArrayLike(value);
395
+ }
396
+
397
+ /**
398
+ * Checks if `value` is a buffer.
399
+ *
400
+ * @static
401
+ * @memberOf _
402
+ * @since 4.3.0
403
+ * @category Lang
404
+ * @param {*} value The value to check.
405
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
406
+ * @example
407
+ *
408
+ * _.isBuffer(new Buffer(2));
409
+ * // => true
410
+ *
411
+ * _.isBuffer(new Uint8Array(2));
412
+ * // => false
413
+ */
414
+ var isBuffer = nativeIsBuffer || stubFalse;
415
+
416
+ /**
417
+ * Checks if `value` is an empty object, collection, map, or set.
418
+ *
419
+ * Objects are considered empty if they have no own enumerable string keyed
420
+ * properties.
421
+ *
422
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
423
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
424
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
425
+ *
426
+ * @static
427
+ * @memberOf _
428
+ * @since 0.1.0
429
+ * @category Lang
430
+ * @param {*} value The value to check.
431
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
432
+ * @example
433
+ *
434
+ * _.isEmpty(null);
435
+ * // => true
436
+ *
437
+ * _.isEmpty(true);
438
+ * // => true
439
+ *
440
+ * _.isEmpty(1);
441
+ * // => true
442
+ *
443
+ * _.isEmpty([1, 2, 3]);
444
+ * // => false
445
+ *
446
+ * _.isEmpty({ 'a': 1 });
447
+ * // => false
448
+ */
449
+ function isEmpty(value) {
450
+ if (isArrayLike(value) &&
451
+ (isArray(value) || typeof value == 'string' ||
452
+ typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {
453
+ return !value.length;
454
+ }
455
+ var tag = getTag(value);
456
+ if (tag == mapTag || tag == setTag) {
457
+ return !value.size;
458
+ }
459
+ if (nonEnumShadows || isPrototype(value)) {
460
+ return !nativeKeys(value).length;
461
+ }
462
+ for (var key in value) {
463
+ if (hasOwnProperty.call(value, key)) {
464
+ return false;
465
+ }
466
+ }
467
+ return true;
468
+ }
469
+
470
+ /**
471
+ * Checks if `value` is classified as a `Function` object.
472
+ *
473
+ * @static
474
+ * @memberOf _
475
+ * @since 0.1.0
476
+ * @category Lang
477
+ * @param {*} value The value to check.
478
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
479
+ * @example
480
+ *
481
+ * _.isFunction(_);
482
+ * // => true
483
+ *
484
+ * _.isFunction(/abc/);
485
+ * // => false
486
+ */
487
+ function isFunction(value) {
488
+ // The use of `Object#toString` avoids issues with the `typeof` operator
489
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
490
+ var tag = isObject(value) ? objectToString.call(value) : '';
491
+ return tag == funcTag || tag == genTag;
492
+ }
493
+
494
+ /**
495
+ * Checks if `value` is a valid array-like length.
496
+ *
497
+ * **Note:** This method is loosely based on
498
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
499
+ *
500
+ * @static
501
+ * @memberOf _
502
+ * @since 4.0.0
503
+ * @category Lang
504
+ * @param {*} value The value to check.
505
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
506
+ * @example
507
+ *
508
+ * _.isLength(3);
509
+ * // => true
510
+ *
511
+ * _.isLength(Number.MIN_VALUE);
512
+ * // => false
513
+ *
514
+ * _.isLength(Infinity);
515
+ * // => false
516
+ *
517
+ * _.isLength('3');
518
+ * // => false
519
+ */
520
+ function isLength(value) {
521
+ return typeof value == 'number' &&
522
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
523
+ }
524
+
525
+ /**
526
+ * Checks if `value` is the
527
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
528
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
529
+ *
530
+ * @static
531
+ * @memberOf _
532
+ * @since 0.1.0
533
+ * @category Lang
534
+ * @param {*} value The value to check.
535
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
536
+ * @example
537
+ *
538
+ * _.isObject({});
539
+ * // => true
540
+ *
541
+ * _.isObject([1, 2, 3]);
542
+ * // => true
543
+ *
544
+ * _.isObject(_.noop);
545
+ * // => true
546
+ *
547
+ * _.isObject(null);
548
+ * // => false
549
+ */
550
+ function isObject(value) {
551
+ var type = typeof value;
552
+ return !!value && (type == 'object' || type == 'function');
553
+ }
554
+
555
+ /**
556
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
557
+ * and has a `typeof` result of "object".
558
+ *
559
+ * @static
560
+ * @memberOf _
561
+ * @since 4.0.0
562
+ * @category Lang
563
+ * @param {*} value The value to check.
564
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
565
+ * @example
566
+ *
567
+ * _.isObjectLike({});
568
+ * // => true
569
+ *
570
+ * _.isObjectLike([1, 2, 3]);
571
+ * // => true
572
+ *
573
+ * _.isObjectLike(_.noop);
574
+ * // => false
575
+ *
576
+ * _.isObjectLike(null);
577
+ * // => false
578
+ */
579
+ function isObjectLike(value) {
580
+ return !!value && typeof value == 'object';
581
+ }
582
+
583
+ /**
584
+ * This method returns `false`.
585
+ *
586
+ * @static
587
+ * @memberOf _
588
+ * @since 4.13.0
589
+ * @category Util
590
+ * @returns {boolean} Returns `false`.
591
+ * @example
592
+ *
593
+ * _.times(2, _.stubFalse);
594
+ * // => [false, false]
595
+ */
596
+ function stubFalse() {
597
+ return false;
598
+ }
599
+
600
+ module.exports = isEmpty;
601
+ } (lodash_isempty, lodash_isempty.exports));
602
+ return lodash_isempty.exports;
603
+ }
604
+
605
+ var lodash_isemptyExports = requireLodash_isempty();
606
+ var isEmpty = /*@__PURE__*/getDefaultExportFromCjs(lodash_isemptyExports);
607
+
608
+ const FEATURE_RESULT_ERRORS = ["unknownFeature", "cyclicPrerequisite"];
609
+ function translateError(errorKind) {
610
+ switch (errorKind) {
611
+ case "unknownFeature":
612
+ return webSdk.ErrorCode.FLAG_NOT_FOUND;
613
+ case "cyclicPrerequisite":
614
+ return webSdk.ErrorCode.PARSE_ERROR;
615
+ default:
616
+ return webSdk.ErrorCode.GENERAL;
617
+ }
618
+ }
619
+ function translateResult(result, defaultValue) {
620
+ var _a;
621
+ if (result.value !== null && typeof result.value !== typeof defaultValue) {
622
+ throw new webSdk.TypeMismatchError(`Expected flag type ${typeof defaultValue} but got ${typeof result.value}`);
623
+ }
624
+ const resolution = {
625
+ value: result.value === null ? defaultValue : result.value,
626
+ reason: result.source,
627
+ variant: (_a = result.experimentResult) == null ? void 0 : _a.key
628
+ };
629
+ if (FEATURE_RESULT_ERRORS.includes(result.source)) {
630
+ resolution.errorCode = translateError(result.source);
631
+ }
632
+ return resolution;
633
+ }
634
+
635
+ class GrowthbookClientProvider {
636
+ constructor(growthbookContext, initOptions) {
637
+ this.metadata = {
638
+ name: GrowthbookClientProvider.name
639
+ };
640
+ this.runsOn = "client";
641
+ this.events = new webSdk.OpenFeatureEventEmitter();
642
+ this.context = growthbookContext;
643
+ this._initOptions = initOptions;
644
+ }
645
+ get client() {
646
+ if (!this._client) {
647
+ throw new webSdk.GeneralError("Provider is not initialized");
648
+ }
649
+ return this._client;
650
+ }
651
+ // the global context is passed to the initialization function
652
+ async initialize(evalContext) {
653
+ this._client = new growthbook.GrowthBook(this.context);
654
+ if (!isEmpty(evalContext)) {
655
+ await this.client.setAttributes(evalContext);
656
+ }
657
+ await this.client.init(this._initOptions);
658
+ const setPayload = this._client.setPayload.bind(this._client);
659
+ this._client.setPayload = async (...args) => {
660
+ await setPayload(...args);
661
+ this.events.emit(webSdk.ProviderEvents.ConfigurationChanged);
662
+ };
663
+ }
664
+ async onClose() {
665
+ return this.client.destroy();
666
+ }
667
+ async onContextChange(oldContext, newContext) {
668
+ await this.client.setAttributes(newContext);
669
+ }
670
+ resolveBooleanEvaluation(flagKey, defaultValue) {
671
+ const res = this.client.evalFeature(flagKey);
672
+ return translateResult(res, defaultValue);
673
+ }
674
+ resolveStringEvaluation(flagKey, defaultValue) {
675
+ const res = this.client.evalFeature(flagKey);
676
+ return translateResult(res, defaultValue);
677
+ }
678
+ resolveNumberEvaluation(flagKey, defaultValue) {
679
+ const res = this.client.evalFeature(flagKey);
680
+ return translateResult(res, defaultValue);
681
+ }
682
+ resolveObjectEvaluation(flagKey, defaultValue) {
683
+ const res = this.client.evalFeature(flagKey);
684
+ return translateResult(res, defaultValue);
685
+ }
686
+ }
687
+
688
+ exports.GrowthbookClientProvider = GrowthbookClientProvider;
689
+
690
+ return exports;
691
+
692
+ })({}, OpenFeature, growthbook);