@carbonorm/carbonreact 3.0.6 → 3.0.7
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/README.md +5 -0
- package/dist/hoc/setCookies.d.ts +2 -0
- package/dist/index.cjs.js +22 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +22 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/hoc/setCookies.tsx +34 -0
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -8,3 +8,8 @@ The Carbon Node is currently under development and is not yet ready for use.
|
|
|
8
8
|
|
|
9
9
|
## Links
|
|
10
10
|
https://saturncloud.io/blog/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies-in-npm-packagejson-file/
|
|
11
|
+
|
|
12
|
+
## @notes
|
|
13
|
+
https://fontawesome.com/v4/icons/
|
|
14
|
+
|
|
15
|
+
|
package/dist/index.cjs.js
CHANGED
|
@@ -4185,6 +4185,27 @@ function ScrollIntoViewDirective(el) {
|
|
|
4185
4185
|
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'auto', block: 'nearest' });
|
|
4186
4186
|
}
|
|
4187
4187
|
|
|
4188
|
+
function setCookies(cookies, req) {
|
|
4189
|
+
if (req === void 0) { req = undefined; }
|
|
4190
|
+
console.log("Setting cookies", cookies);
|
|
4191
|
+
cookies.map(function (cookie) {
|
|
4192
|
+
var newCookie = cookie
|
|
4193
|
+
.replace("HttpOnly", "")
|
|
4194
|
+
.replace("secure", "");
|
|
4195
|
+
if (document === undefined || document === null) {
|
|
4196
|
+
var getStackTrace_1 = function () {
|
|
4197
|
+
var obj = {};
|
|
4198
|
+
Error.captureStackTrace(obj, getStackTrace_1);
|
|
4199
|
+
return obj.stack;
|
|
4200
|
+
};
|
|
4201
|
+
console.error(req);
|
|
4202
|
+
console.log('Testing error, document not defined', req);
|
|
4203
|
+
throw new Error("Document is undefined while trying to set cookie: (" + newCookie + ") in axiosInterceptors.tsx after (" + JSON.stringify([req === null || req === void 0 ? void 0 : req.config, req === null || req === void 0 ? void 0 : req.data], undefined, 4) + ") Please make sure all requests are wrapped in an act() from import {act} from '@testing-library/react'; (" + JSON.stringify(getStackTrace_1(), undefined, 4) + ")");
|
|
4204
|
+
}
|
|
4205
|
+
document.cookie = newCookie;
|
|
4206
|
+
});
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4188
4209
|
// @link https://www.benmvp.com/blog/mocking-window-location-methods-jest-jsdom/
|
|
4189
4210
|
function setUrl(host, https) {
|
|
4190
4211
|
if (host === void 0) { host = 'www.example.com'; }
|
|
@@ -4450,6 +4471,7 @@ exports.photos = photos;
|
|
|
4450
4471
|
exports.range = range;
|
|
4451
4472
|
exports.reports = reports;
|
|
4452
4473
|
exports.scrollIntoView = ScrollIntoViewDirective;
|
|
4474
|
+
exports.setCookies = setCookies;
|
|
4453
4475
|
exports.setUrl = setUrl;
|
|
4454
4476
|
exports.toDataURL = toDataURL;
|
|
4455
4477
|
exports.updateRestfulObjectArrays = updateRestfulObjectArrays;
|