posthog-js
Version:
Posthog-js allows you to automatically capture usage and send events to PostHog.
53 lines • 3.1 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostHogFeatureFlags = exports.QuotaLimitedResource = exports.parseFlagsResponse = exports.filterActiveFeatureFlags = exports.FeatureFlagError = void 0;
var feature_flags_1 = require("@posthog/browser-common/feature-flags");
var feature_flags_config_1 = require("./feature-flags-config");
var extension_tokens_1 = require("./extension-tokens");
var feature_flags_2 = require("@posthog/browser-common/feature-flags");
Object.defineProperty(exports, "FeatureFlagError", { enumerable: true, get: function () { return feature_flags_2.FeatureFlagError; } });
Object.defineProperty(exports, "filterActiveFeatureFlags", { enumerable: true, get: function () { return feature_flags_2.filterActiveFeatureFlags; } });
Object.defineProperty(exports, "parseFlagsResponse", { enumerable: true, get: function () { return feature_flags_2.parseFlagsResponse; } });
Object.defineProperty(exports, "QuotaLimitedResource", { enumerable: true, get: function () { return feature_flags_2.QuotaLimitedResource; } });
/** Legacy constructor and configuration mapping for the shared flags extension. */
var PostHogFeatureFlags = /** @class */ (function (_super) {
__extends(PostHogFeatureFlags, _super);
function PostHogFeatureFlags(instance) {
var _this = this;
var mutableConfigSource = new feature_flags_config_1.MutableFeatureFlagsConfigSource(instance.config, instance._shouldDisableFlags());
_this = _super.call(this, mutableConfigSource) || this;
_this.name = extension_tokens_1.FeatureFlagsExtension;
_this._instance = instance;
_this._mutableConfigSource = mutableConfigSource;
return _this;
}
Object.defineProperty(PostHogFeatureFlags.prototype, "_crossTabPersistence", {
get: function () {
return this._instance.persistence;
},
enumerable: false,
configurable: true
});
PostHogFeatureFlags.prototype.updateConfig = function (config, remoteRequestsDisabled) {
this._mutableConfigSource.update(config, remoteRequestsDisabled);
this._onConfigUpdated();
};
return PostHogFeatureFlags;
}(feature_flags_1.PostHogFeatureFlags));
exports.PostHogFeatureFlags = PostHogFeatureFlags;
//# sourceMappingURL=posthog-featureflags.js.map