@bigbinary/neeto-playwright-commons 1.3.1 → 1.3.2

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/index.js CHANGED
@@ -8,7 +8,7 @@ import require$$0$3 from 'stream';
8
8
  import require$$0$4 from 'events';
9
9
  import { mergeDeepLeft, mergeAll } from 'ramda';
10
10
  import dayjs from 'dayjs';
11
- import require$$0$5 from 'i18next';
11
+ import { createI18nFixture } from 'playwright-i18next-fixture';
12
12
  import require$$3 from 'crypto';
13
13
 
14
14
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -6951,86 +6951,7 @@ const generateStagingData = (product = "invoice") => {
6951
6951
  };
6952
6952
  };
6953
6953
 
6954
- var __create = Object.create;
6955
- var __defProp = Object.defineProperty;
6956
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6957
- var __getOwnPropNames = Object.getOwnPropertyNames;
6958
- var __getProtoOf = Object.getPrototypeOf;
6959
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6960
- var __export = (target, all) => {
6961
- for (var name in all)
6962
- __defProp(target, name, { get: all[name], enumerable: true });
6963
- };
6964
- var __copyProps = (to, from, except, desc) => {
6965
- if (from && typeof from === "object" || typeof from === "function") {
6966
- for (let key of __getOwnPropNames(from))
6967
- if (!__hasOwnProp.call(to, key) && key !== except)
6968
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
6969
- }
6970
- return to;
6971
- };
6972
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
6973
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
6974
- mod
6975
- ));
6976
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
6977
-
6978
- // src/index.ts
6979
- var src_exports = {};
6980
- __export(src_exports, {
6981
- createI18nFixture: () => createI18nFixture,
6982
- getI18nInstance: () => getI18nInstance,
6983
- initI18n: () => initI18n
6984
- });
6985
- var dist = __toCommonJS(src_exports);
6986
-
6987
- // src/i18n.ts
6988
- var import_i18next = __toESM(require$$0$5);
6989
- var storedI18n;
6990
- async function initI18n({
6991
- plugins,
6992
- options,
6993
- cache
6994
- }) {
6995
- if (!cache || !storedI18n || !storedI18n.isInitialized) {
6996
- const i18n2 = plugins.reduce(
6997
- (i18n3, plugin) => i18n3 = i18n3.use(plugin),
6998
- import_i18next.default.createInstance()
6999
- );
7000
- await i18n2.init(options);
7001
- storedI18n = i18n2;
7002
- }
7003
- return storedI18n;
7004
- }
7005
- function getI18nInstance() {
7006
- if (!storedI18n) {
7007
- throw new Error("No i18n instance initialized");
7008
- }
7009
- return storedI18n;
7010
- }
7011
-
7012
- // src/fixture.ts
7013
- var createI18nFixture = ({
7014
- plugins = [],
7015
- options = {},
7016
- cache = true,
7017
- auto = true
7018
- }) => {
7019
- return {
7020
- i18n: [
7021
- async ({}, use) => {
7022
- const i18nInitialized = await initI18n({ plugins, options, cache });
7023
- await use(i18nInitialized);
7024
- },
7025
- { auto }
7026
- ],
7027
- t: async ({ i18n: i18n2 }, use) => {
7028
- await use(i18n2.t);
7029
- }
7030
- };
7031
- };
7032
-
7033
- const i18nFixture = dist.createI18nFixture({
6954
+ const i18nFixture = createI18nFixture({
7034
6955
  // i18n configuration options
7035
6956
  options: {
7036
6957
  debug: false,