@chrryai/waffles 1.1.82 → 1.1.84
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/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +20 -182
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -182
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -1,191 +1,10 @@
|
|
|
1
|
+
import * as dotenv from 'dotenv';
|
|
1
2
|
import { expect } from '@playwright/test';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import process2 from 'process';
|
|
4
5
|
import { faker } from '@faker-js/faker';
|
|
5
6
|
|
|
6
|
-
var __create = Object.create;
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
13
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
14
|
-
}) : x)(function(x) {
|
|
15
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
16
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
-
});
|
|
18
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
19
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
|
-
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(from))
|
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
-
}
|
|
27
|
-
return to;
|
|
28
|
-
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
|
|
38
|
-
// ../../node_modules/dotenv/package.json
|
|
39
|
-
var require_package = __commonJS({
|
|
40
|
-
"../../node_modules/dotenv/package.json"(exports, module) {
|
|
41
|
-
module.exports = {
|
|
42
|
-
name: "dotenv",
|
|
43
|
-
version: "16.0.3",
|
|
44
|
-
description: "Loads environment variables from .env file",
|
|
45
|
-
main: "lib/main.js",
|
|
46
|
-
types: "lib/main.d.ts",
|
|
47
|
-
exports: {
|
|
48
|
-
".": {
|
|
49
|
-
require: "./lib/main.js",
|
|
50
|
-
types: "./lib/main.d.ts",
|
|
51
|
-
default: "./lib/main.js"
|
|
52
|
-
},
|
|
53
|
-
"./config": "./config.js",
|
|
54
|
-
"./config.js": "./config.js",
|
|
55
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
56
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
57
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
58
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
59
|
-
"./package.json": "./package.json"
|
|
60
|
-
},
|
|
61
|
-
scripts: {
|
|
62
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
63
|
-
lint: "standard",
|
|
64
|
-
"lint-readme": "standard-markdown",
|
|
65
|
-
pretest: "npm run lint && npm run dts-check",
|
|
66
|
-
test: "tap tests/*.js --100 -Rspec",
|
|
67
|
-
prerelease: "npm test",
|
|
68
|
-
release: "standard-version"
|
|
69
|
-
},
|
|
70
|
-
repository: {
|
|
71
|
-
type: "git",
|
|
72
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
73
|
-
},
|
|
74
|
-
keywords: [
|
|
75
|
-
"dotenv",
|
|
76
|
-
"env",
|
|
77
|
-
".env",
|
|
78
|
-
"environment",
|
|
79
|
-
"variables",
|
|
80
|
-
"config",
|
|
81
|
-
"settings"
|
|
82
|
-
],
|
|
83
|
-
readmeFilename: "README.md",
|
|
84
|
-
license: "BSD-2-Clause",
|
|
85
|
-
devDependencies: {
|
|
86
|
-
"@types/node": "^17.0.9",
|
|
87
|
-
decache: "^4.6.1",
|
|
88
|
-
dtslint: "^3.7.0",
|
|
89
|
-
sinon: "^12.0.1",
|
|
90
|
-
standard: "^16.0.4",
|
|
91
|
-
"standard-markdown": "^7.1.0",
|
|
92
|
-
"standard-version": "^9.3.2",
|
|
93
|
-
tap: "^15.1.6",
|
|
94
|
-
tar: "^6.1.11",
|
|
95
|
-
typescript: "^4.5.4"
|
|
96
|
-
},
|
|
97
|
-
engines: {
|
|
98
|
-
node: ">=12"
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// ../../node_modules/dotenv/lib/main.js
|
|
105
|
-
var require_main = __commonJS({
|
|
106
|
-
"../../node_modules/dotenv/lib/main.js"(exports, module) {
|
|
107
|
-
var fs = __require("fs");
|
|
108
|
-
var path2 = __require("path");
|
|
109
|
-
var os = __require("os");
|
|
110
|
-
var packageJson = require_package();
|
|
111
|
-
var version = packageJson.version;
|
|
112
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
113
|
-
function parse(src) {
|
|
114
|
-
const obj = {};
|
|
115
|
-
let lines = src.toString();
|
|
116
|
-
lines = lines.replace(/\r\n?/mg, "\n");
|
|
117
|
-
let match;
|
|
118
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
119
|
-
const key = match[1];
|
|
120
|
-
let value = match[2] || "";
|
|
121
|
-
value = value.trim();
|
|
122
|
-
const maybeQuote = value[0];
|
|
123
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
124
|
-
if (maybeQuote === '"') {
|
|
125
|
-
value = value.replace(/\\n/g, "\n");
|
|
126
|
-
value = value.replace(/\\r/g, "\r");
|
|
127
|
-
}
|
|
128
|
-
obj[key] = value;
|
|
129
|
-
}
|
|
130
|
-
return obj;
|
|
131
|
-
}
|
|
132
|
-
function _log(message) {
|
|
133
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
134
|
-
}
|
|
135
|
-
function _resolveHome(envPath) {
|
|
136
|
-
return envPath[0] === "~" ? path2.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
137
|
-
}
|
|
138
|
-
function config2(options) {
|
|
139
|
-
let dotenvPath = path2.resolve(process.cwd(), ".env");
|
|
140
|
-
let encoding = "utf8";
|
|
141
|
-
const debug = Boolean(options && options.debug);
|
|
142
|
-
const override = Boolean(options && options.override);
|
|
143
|
-
if (options) {
|
|
144
|
-
if (options.path != null) {
|
|
145
|
-
dotenvPath = _resolveHome(options.path);
|
|
146
|
-
}
|
|
147
|
-
if (options.encoding != null) {
|
|
148
|
-
encoding = options.encoding;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
try {
|
|
152
|
-
const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }));
|
|
153
|
-
Object.keys(parsed).forEach(function(key) {
|
|
154
|
-
if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
|
|
155
|
-
process.env[key] = parsed[key];
|
|
156
|
-
} else {
|
|
157
|
-
if (override === true) {
|
|
158
|
-
process.env[key] = parsed[key];
|
|
159
|
-
}
|
|
160
|
-
if (debug) {
|
|
161
|
-
if (override === true) {
|
|
162
|
-
_log(`"${key}" is already defined in \`process.env\` and WAS overwritten`);
|
|
163
|
-
} else {
|
|
164
|
-
_log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
return { parsed };
|
|
170
|
-
} catch (e) {
|
|
171
|
-
if (debug) {
|
|
172
|
-
_log(`Failed to load ${dotenvPath} ${e.message}`);
|
|
173
|
-
}
|
|
174
|
-
return { error: e };
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
var DotenvModule = {
|
|
178
|
-
config: config2,
|
|
179
|
-
parse
|
|
180
|
-
};
|
|
181
|
-
module.exports.config = DotenvModule.config;
|
|
182
|
-
module.exports.parse = DotenvModule.parse;
|
|
183
|
-
module.exports = DotenvModule;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
7
|
// src/utils.ts
|
|
188
|
-
var dotenv = __toESM(require_main());
|
|
189
8
|
var TEST_GUEST_FINGERPRINTS = ["052b1051-35e9-4264-97ac-2f0f67761869"];
|
|
190
9
|
var TEST_MEMBER_FINGERPRINTS = [
|
|
191
10
|
"0493b6d8-80d6-477c-addd-b6b8ccd73e82",
|