backend v4 half

This commit is contained in:
2025-07-18 09:20:40 +02:00
parent aba7a506ad
commit 725516ad6c
4183 changed files with 217684 additions and 75056 deletions
@@ -0,0 +1,29 @@
/**
* This function returns the global object across Node and browsers.
*
* Note: `globalThis` is the standardized approach however it has been added to
* Node.js in version 12. We need to include this snippet until Node 12 EOL.
*/
export function getGlobal() {
if (typeof globalThis !== 'undefined') {
return globalThis;
}
if (typeof global !== 'undefined') {
return global;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Cannot find name 'window'.
if (typeof window !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Cannot find name 'window'.
return window;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Cannot find name 'self'.
if (typeof self !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Cannot find name 'self'.
return self;
}
}
//# sourceMappingURL=get-global.util.js.map
@@ -0,0 +1 @@
{"version":3,"file":"get-global.util.js","sourceRoot":"","sources":["../../../src/utils/get-global.util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,SAAS;IACvB,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO,UAAU,CAAC;KACnB;IAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IAED,6DAA6D;IAC7D,yCAAyC;IACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,6DAA6D;QAC7D,yCAAyC;QACzC,OAAO,MAAM,CAAC;KACf;IAED,6DAA6D;IAC7D,uCAAuC;IACvC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,6DAA6D;QAC7D,uCAAuC;QACvC,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["/**\n * This function returns the global object across Node and browsers.\n *\n * Note: `globalThis` is the standardized approach however it has been added to\n * Node.js in version 12. We need to include this snippet until Node 12 EOL.\n */\nexport function getGlobal() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n\n if (typeof global !== 'undefined') {\n return global;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Cannot find name 'window'.\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Cannot find name 'window'.\n return window;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Cannot find name 'self'.\n if (typeof self !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Cannot find name 'self'.\n return self;\n }\n}\n"]}
@@ -0,0 +1,13 @@
import { getGlobal } from '.';
describe('getGlobal()', () => {
it('should return true if Buffer is present in globalThis', () => {
expect(getGlobal().Buffer).toBe(true);
});
it('should return false if Buffer is not present in globalThis', () => {
const bufferImp = global.Buffer;
delete global.Buffer;
expect(getGlobal().Buffer).toBe(false);
global.Buffer = bufferImp;
});
});
//# sourceMappingURL=get-global.util.spect.js.map
@@ -0,0 +1 @@
{"version":3,"file":"get-global.util.spect.js","sourceRoot":"","sources":["../../../src/utils/get-global.util.spect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE9B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC;QAErB,MAAM,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEvC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { getGlobal } from '.';\n\ndescribe('getGlobal()', () => {\n it('should return true if Buffer is present in globalThis', () => {\n expect(getGlobal().Buffer).toBe(true);\n });\n\n it('should return false if Buffer is not present in globalThis', () => {\n const bufferImp = global.Buffer;\n delete global.Buffer;\n\n expect(getGlobal().Buffer).toBe(false);\n\n global.Buffer = bufferImp;\n });\n});\n"]}
@@ -0,0 +1,3 @@
export * from './get-global.util';
export * from './is-promise.util';
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './get-global.util';\nexport * from './is-promise.util';\n"]}
@@ -0,0 +1,4 @@
export function isPromise(p) {
return p !== null && typeof p === 'object' && typeof p.then === 'function';
}
//# sourceMappingURL=is-promise.util.js.map
@@ -0,0 +1 @@
{"version":3,"file":"is-promise.util.js","sourceRoot":"","sources":["../../../src/utils/is-promise.util.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,CAAM;IACjC,OAAO,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC7E,CAAC","sourcesContent":["export function isPromise<T>(p: any): p is Promise<T> {\n return p !== null && typeof p === 'object' && typeof p.then === 'function';\n}\n"]}