@placeos/ts-client 4.2.4 → 4.2.5
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/http/functions.ts +1 -3
- package/src/http/mock.ts +3 -0
package/package.json
CHANGED
package/src/http/functions.ts
CHANGED
|
@@ -272,9 +272,7 @@ export function request(
|
|
|
272
272
|
): Observable<HttpResponse> {
|
|
273
273
|
if (is_mock()) {
|
|
274
274
|
const request_obs = mock_handler(method, url, options?.body);
|
|
275
|
-
if (request_obs)
|
|
276
|
-
return request_obs;
|
|
277
|
-
}
|
|
275
|
+
if (request_obs) return request_obs;
|
|
278
276
|
}
|
|
279
277
|
options.headers = options.headers || {};
|
|
280
278
|
if (!options.headers['Content-Type'] && !options.headers['content-type']) {
|
package/src/http/mock.ts
CHANGED
|
@@ -92,6 +92,9 @@ export function mockRequest(
|
|
|
92
92
|
body?: any,
|
|
93
93
|
handler_map: HashMap<MockHttpRequestHandler> = _handlers,
|
|
94
94
|
): Observable<HashMap | string | void> | null {
|
|
95
|
+
if (window.debug) {
|
|
96
|
+
console.log('Resolving request:', method, url, body);
|
|
97
|
+
}
|
|
95
98
|
const handler = findRequestHandler(method, url, handler_map);
|
|
96
99
|
if (handler) {
|
|
97
100
|
const request = processRequest(url, handler, body);
|