@rjsf/utils 6.6.1
“Utility functions for @rjsf/core”
Env references outside npm diagnostic helpersJavaScript-family source file under lib
SHA-2560304075ed5508051fe00eea6a0549a5564fdf2b15ccb1c45f579bd229f482999
MaleculeO(As)H(Db)
Evidence
10:27… dataURL, name) {
11 return dataURL.replace(';base64', `;name=${encodeURIComponent(name)};base64`);
12}
13/** Returns a promise that will read the file from the browser and return it as the result of the promise.
14 …
1import get from 'lodash-es/get.js';
2import uniqueId from 'lodash-es/uniqueId.js';
3/** Returns an object of test IDs that can only be used in test mode. If the function is called in a test environment
4 * (`NODE_ENV === 'test'`, this is set by vitest) then a Proxy object will be returned. If a key within the returned
5 * object …
5:76… hat value, otherwise it will create that key
6 * with a generated `uuid` value and return the generated ID. If it is called outside of a test environment, the
7 * function will return an empty object, therefore returning `undefined` for any property within the object and
8 * excluding the prop from the rendered output of the compon …
9:28… adapted from the following blog post: https://www.matthewsessions.com/blog/react-test-id/
10 * To use …
15:86… he test IDs out of your rendered
16 * output.
17 */
18export default function getTestIds() {
19 // For some reason, even though process.env contains the value of `test` for NODE_ENV, accessing it directly returns
20 // 'development'. Using `get()` does, in fact, return test so sticking with it.
21 // Use globalThis to access process without requiring @types/node (TS6 compatibility).
22 if (get(globalThis, 'process.env.NODE_ENV') !== 'test') {
23 return {};
24 }
25 const ids = new Map();
26 return new Proxy({}, {
27 get(_obj, prop) {
28 if (!ids.has(prop)) {
⋯4 lines
33 });
34}
35//# sourceMappingURL=getTestIds.js.map
No evidence locations were recorded for this file. Raw result