@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.cjs.js +2 -82
- package/index.cjs.js.map +1 -1
- package/index.js +2 -81
- package/index.js.map +1 -1
- package/package.json +2 -1
package/index.cjs.js
CHANGED
|
@@ -11,7 +11,7 @@ var require$$0$2 = require('stream');
|
|
|
11
11
|
var require$$0$4 = require('events');
|
|
12
12
|
var ramda = require('ramda');
|
|
13
13
|
var dayjs = require('dayjs');
|
|
14
|
-
var
|
|
14
|
+
var playwrightI18nextFixture = require('playwright-i18next-fixture');
|
|
15
15
|
var require$$3 = require('crypto');
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -42,7 +42,6 @@ var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
|
42
42
|
var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
43
43
|
var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
|
|
44
44
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
45
|
-
var require$$0__default$5 = /*#__PURE__*/_interopDefaultLegacy(require$$0$5);
|
|
46
45
|
var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);
|
|
47
46
|
|
|
48
47
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -6985,86 +6984,7 @@ const generateStagingData = (product = "invoice") => {
|
|
|
6985
6984
|
};
|
|
6986
6985
|
};
|
|
6987
6986
|
|
|
6988
|
-
|
|
6989
|
-
var __defProp = Object.defineProperty;
|
|
6990
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6991
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6992
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6993
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6994
|
-
var __export = (target, all) => {
|
|
6995
|
-
for (var name in all)
|
|
6996
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6997
|
-
};
|
|
6998
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6999
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7000
|
-
for (let key of __getOwnPropNames(from))
|
|
7001
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
7002
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
7003
|
-
}
|
|
7004
|
-
return to;
|
|
7005
|
-
};
|
|
7006
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
7007
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
7008
|
-
mod
|
|
7009
|
-
));
|
|
7010
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
7011
|
-
|
|
7012
|
-
// src/index.ts
|
|
7013
|
-
var src_exports = {};
|
|
7014
|
-
__export(src_exports, {
|
|
7015
|
-
createI18nFixture: () => createI18nFixture,
|
|
7016
|
-
getI18nInstance: () => getI18nInstance,
|
|
7017
|
-
initI18n: () => initI18n
|
|
7018
|
-
});
|
|
7019
|
-
var dist = __toCommonJS(src_exports);
|
|
7020
|
-
|
|
7021
|
-
// src/i18n.ts
|
|
7022
|
-
var import_i18next = __toESM(require$$0__default$5["default"]);
|
|
7023
|
-
var storedI18n;
|
|
7024
|
-
async function initI18n({
|
|
7025
|
-
plugins,
|
|
7026
|
-
options,
|
|
7027
|
-
cache
|
|
7028
|
-
}) {
|
|
7029
|
-
if (!cache || !storedI18n || !storedI18n.isInitialized) {
|
|
7030
|
-
const i18n2 = plugins.reduce(
|
|
7031
|
-
(i18n3, plugin) => i18n3 = i18n3.use(plugin),
|
|
7032
|
-
import_i18next.default.createInstance()
|
|
7033
|
-
);
|
|
7034
|
-
await i18n2.init(options);
|
|
7035
|
-
storedI18n = i18n2;
|
|
7036
|
-
}
|
|
7037
|
-
return storedI18n;
|
|
7038
|
-
}
|
|
7039
|
-
function getI18nInstance() {
|
|
7040
|
-
if (!storedI18n) {
|
|
7041
|
-
throw new Error("No i18n instance initialized");
|
|
7042
|
-
}
|
|
7043
|
-
return storedI18n;
|
|
7044
|
-
}
|
|
7045
|
-
|
|
7046
|
-
// src/fixture.ts
|
|
7047
|
-
var createI18nFixture = ({
|
|
7048
|
-
plugins = [],
|
|
7049
|
-
options = {},
|
|
7050
|
-
cache = true,
|
|
7051
|
-
auto = true
|
|
7052
|
-
}) => {
|
|
7053
|
-
return {
|
|
7054
|
-
i18n: [
|
|
7055
|
-
async ({}, use) => {
|
|
7056
|
-
const i18nInitialized = await initI18n({ plugins, options, cache });
|
|
7057
|
-
await use(i18nInitialized);
|
|
7058
|
-
},
|
|
7059
|
-
{ auto }
|
|
7060
|
-
],
|
|
7061
|
-
t: async ({ i18n: i18n2 }, use) => {
|
|
7062
|
-
await use(i18n2.t);
|
|
7063
|
-
}
|
|
7064
|
-
};
|
|
7065
|
-
};
|
|
7066
|
-
|
|
7067
|
-
const i18nFixture = dist.createI18nFixture({
|
|
6987
|
+
const i18nFixture = playwrightI18nextFixture.createI18nFixture({
|
|
7068
6988
|
// i18n configuration options
|
|
7069
6989
|
options: {
|
|
7070
6990
|
debug: false,
|