@financial-times/dotcom-ui-flags 11.2.1 → 12.0.0

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.
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { TFlagsData } from '../types';
3
- declare type TFlagsEmbedProps = {
2
+ type TFlagsEmbedProps = {
4
3
  flags?: TFlagsData;
5
4
  };
6
5
  declare function FlagsEmbed({ flags }: TFlagsEmbedProps): import("react").JSX.Element;
@@ -9,7 +9,7 @@ exports.loadFlags = loadFlags_1.default;
9
9
  const Flags_1 = __importDefault(require("./Flags"));
10
10
  exports.Flags = Flags_1.default;
11
11
  const init = () => {
12
- const flagsData = loadFlags_1.default();
12
+ const flagsData = (0, loadFlags_1.default)();
13
13
  return new Flags_1.default(flagsData);
14
14
  };
15
15
  exports.init = init;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = loadFlags;
3
4
  const dotcom_ui_data_embed_1 = require("@financial-times/dotcom-ui-data-embed");
4
5
  const constants_1 = require("../constants");
5
6
  function loadFlags() {
6
- return dotcom_ui_data_embed_1.loadDataEmbed(constants_1.SCRIPT_ELEMENT_ID);
7
+ return (0, dotcom_ui_data_embed_1.loadDataEmbed)(constants_1.SCRIPT_ELEMENT_ID);
7
8
  }
8
- exports.default = loadFlags;
@@ -1,5 +1,5 @@
1
1
  import { TFlagsData } from '../types';
2
- declare type TFlagsEmbedProps = {
2
+ type TFlagsEmbedProps = {
3
3
  flags?: TFlagsData;
4
4
  };
5
5
  declare function FlagsEmbed({ flags }: TFlagsEmbedProps): any;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlagsEmbed = void 0;
3
+ exports.FlagsEmbed = FlagsEmbed;
4
4
  const dotcom_ui_data_embed_1 = require("@financial-times/dotcom-ui-data-embed");
5
5
  const server_1 = require("../server");
6
6
  const constants_1 = require("../constants");
7
7
  function FlagsEmbed({ flags }) {
8
- return dotcom_ui_data_embed_1.DataEmbed({ id: constants_1.SCRIPT_ELEMENT_ID, data: server_1.formatFlagsJSON(flags) });
8
+ return (0, dotcom_ui_data_embed_1.DataEmbed)({ id: constants_1.SCRIPT_ELEMENT_ID, data: (0, server_1.formatFlagsJSON)(flags) });
9
9
  }
10
- exports.FlagsEmbed = FlagsEmbed;
11
10
  FlagsEmbed.defaultProps = {
12
11
  flags: {}
13
12
  };
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = formatFlagsJSON;
3
4
  function formatFlagsJSON(flags = {}) {
4
5
  const output = {};
5
6
  Object.keys(flags).forEach((key) => {
@@ -10,4 +11,3 @@ function formatFlagsJSON(flags = {}) {
10
11
  });
11
12
  return output;
12
13
  }
13
- exports.default = formatFlagsJSON;