@native-systems/utility 1.1.1 → 1.2.0
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 +83 -29
- package/dist/index.d.ts +20 -0
- package/dist/index.esm.js +90 -30
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -296,7 +296,7 @@ function _call_super$1(_this, derived, args) {
|
|
|
296
296
|
: derived.apply(_this, args)
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
|
-
function _class_call_check$
|
|
299
|
+
function _class_call_check$4(instance, Constructor) {
|
|
300
300
|
if (!(instance instanceof Constructor)) {
|
|
301
301
|
throw new TypeError('Cannot call a class as a function');
|
|
302
302
|
}
|
|
@@ -316,7 +316,7 @@ function _construct$1(Parent, args, Class) {
|
|
|
316
316
|
}
|
|
317
317
|
return _construct$1.apply(null, arguments);
|
|
318
318
|
}
|
|
319
|
-
function _define_property$
|
|
319
|
+
function _define_property$3(obj, key, value) {
|
|
320
320
|
if (key in obj) {
|
|
321
321
|
Object.defineProperty(obj, key, {
|
|
322
322
|
value: value,
|
|
@@ -417,10 +417,10 @@ function _is_native_reflect_construct$1() {
|
|
|
417
417
|
var NativeException = /*#__PURE__*/ (function (Error1) {
|
|
418
418
|
_inherits$1(NativeException, Error1);
|
|
419
419
|
function NativeException(code, message) {
|
|
420
|
-
_class_call_check$
|
|
420
|
+
_class_call_check$4(this, NativeException);
|
|
421
421
|
var _this;
|
|
422
422
|
(_this = _call_super$1(this, NativeException, [message])),
|
|
423
|
-
_define_property$
|
|
423
|
+
_define_property$3(_this, 'code', void 0);
|
|
424
424
|
_this.name = 'NativeError';
|
|
425
425
|
_this.code = code;
|
|
426
426
|
return _this;
|
|
@@ -449,7 +449,7 @@ function _call_super(_this, derived, args) {
|
|
|
449
449
|
: derived.apply(_this, args)
|
|
450
450
|
);
|
|
451
451
|
}
|
|
452
|
-
function _class_call_check$
|
|
452
|
+
function _class_call_check$3(instance, Constructor) {
|
|
453
453
|
if (!(instance instanceof Constructor)) {
|
|
454
454
|
throw new TypeError('Cannot call a class as a function');
|
|
455
455
|
}
|
|
@@ -469,7 +469,7 @@ function _construct(Parent, args, Class) {
|
|
|
469
469
|
}
|
|
470
470
|
return _construct.apply(null, arguments);
|
|
471
471
|
}
|
|
472
|
-
function _defineProperties$
|
|
472
|
+
function _defineProperties$3(target, props) {
|
|
473
473
|
for (var i = 0; i < props.length; i++) {
|
|
474
474
|
var descriptor = props[i];
|
|
475
475
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -478,11 +478,11 @@ function _defineProperties$2(target, props) {
|
|
|
478
478
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
function _create_class$
|
|
482
|
-
if (protoProps) _defineProperties$
|
|
481
|
+
function _create_class$3(Constructor, protoProps, staticProps) {
|
|
482
|
+
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
483
483
|
return Constructor;
|
|
484
484
|
}
|
|
485
|
-
function _define_property$
|
|
485
|
+
function _define_property$2(obj, key, value) {
|
|
486
486
|
if (key in obj) {
|
|
487
487
|
Object.defineProperty(obj, key, {
|
|
488
488
|
value: value,
|
|
@@ -579,17 +579,17 @@ function _is_native_reflect_construct() {
|
|
|
579
579
|
var PgException = /*#__PURE__*/ (function (Error1) {
|
|
580
580
|
_inherits(PgException, Error1);
|
|
581
581
|
function PgException(err, message, specific) {
|
|
582
|
-
_class_call_check$
|
|
582
|
+
_class_call_check$3(this, PgException);
|
|
583
583
|
var _this;
|
|
584
584
|
(_this = _call_super(this, PgException, [message])),
|
|
585
|
-
_define_property$
|
|
586
|
-
_define_property$
|
|
585
|
+
_define_property$2(_this, 'err', void 0),
|
|
586
|
+
_define_property$2(_this, 'specific', void 0);
|
|
587
587
|
_this.name = 'PgError';
|
|
588
588
|
_this.err = err;
|
|
589
589
|
_this.specific = specific;
|
|
590
590
|
return _this;
|
|
591
591
|
}
|
|
592
|
-
_create_class$
|
|
592
|
+
_create_class$3(PgException, [
|
|
593
593
|
{
|
|
594
594
|
key: 'getStatus',
|
|
595
595
|
value: function getStatus() {
|
|
@@ -616,12 +616,12 @@ var PgException = /*#__PURE__*/ (function (Error1) {
|
|
|
616
616
|
return PgException;
|
|
617
617
|
})(_wrap_native_super(Error));
|
|
618
618
|
|
|
619
|
-
function _class_call_check$
|
|
619
|
+
function _class_call_check$2(instance, Constructor) {
|
|
620
620
|
if (!(instance instanceof Constructor)) {
|
|
621
621
|
throw new TypeError('Cannot call a class as a function');
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
function _defineProperties$
|
|
624
|
+
function _defineProperties$2(target, props) {
|
|
625
625
|
for (var i = 0; i < props.length; i++) {
|
|
626
626
|
var descriptor = props[i];
|
|
627
627
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -630,11 +630,11 @@ function _defineProperties$1(target, props) {
|
|
|
630
630
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
function _create_class$
|
|
634
|
-
if (protoProps) _defineProperties$
|
|
633
|
+
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
634
|
+
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
635
635
|
return Constructor;
|
|
636
636
|
}
|
|
637
|
-
function _define_property(obj, key, value) {
|
|
637
|
+
function _define_property$1(obj, key, value) {
|
|
638
638
|
if (key in obj) {
|
|
639
639
|
Object.defineProperty(obj, key, {
|
|
640
640
|
value: value,
|
|
@@ -662,10 +662,10 @@ var NO_OP = function (_message) {
|
|
|
662
662
|
};
|
|
663
663
|
var ConsoleLogger = /*#__PURE__*/ (function () {
|
|
664
664
|
function ConsoleLogger(options) {
|
|
665
|
-
_class_call_check$
|
|
666
|
-
_define_property(this, 'log', void 0);
|
|
667
|
-
_define_property(this, 'warn', void 0);
|
|
668
|
-
_define_property(this, 'error', void 0);
|
|
665
|
+
_class_call_check$2(this, ConsoleLogger);
|
|
666
|
+
_define_property$1(this, 'log', void 0);
|
|
667
|
+
_define_property$1(this, 'warn', void 0);
|
|
668
|
+
_define_property$1(this, 'error', void 0);
|
|
669
669
|
var level = (options || {}).level;
|
|
670
670
|
this.error = console.error.bind(console);
|
|
671
671
|
this.warn = NO_OP;
|
|
@@ -680,7 +680,7 @@ var ConsoleLogger = /*#__PURE__*/ (function () {
|
|
|
680
680
|
break;
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
_create_class$
|
|
683
|
+
_create_class$2(ConsoleLogger, [
|
|
684
684
|
{
|
|
685
685
|
key: 'disable',
|
|
686
686
|
value: function disable() {
|
|
@@ -716,12 +716,12 @@ var logger = new ConsoleLogger({
|
|
|
716
716
|
level: LOG_LEVEL,
|
|
717
717
|
});
|
|
718
718
|
|
|
719
|
-
function _class_call_check(instance, Constructor) {
|
|
719
|
+
function _class_call_check$1(instance, Constructor) {
|
|
720
720
|
if (!(instance instanceof Constructor)) {
|
|
721
721
|
throw new TypeError('Cannot call a class as a function');
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function _defineProperties(target, props) {
|
|
724
|
+
function _defineProperties$1(target, props) {
|
|
725
725
|
for (var i = 0; i < props.length; i++) {
|
|
726
726
|
var descriptor = props[i];
|
|
727
727
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -730,15 +730,15 @@ function _defineProperties(target, props) {
|
|
|
730
730
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
734
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
733
|
+
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
734
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
735
735
|
return Constructor;
|
|
736
736
|
}
|
|
737
737
|
var HttpHandler = /*#__PURE__*/ (function () {
|
|
738
738
|
function HttpHandler() {
|
|
739
|
-
_class_call_check(this, HttpHandler);
|
|
739
|
+
_class_call_check$1(this, HttpHandler);
|
|
740
740
|
}
|
|
741
|
-
_create_class(HttpHandler, null, [
|
|
741
|
+
_create_class$1(HttpHandler, null, [
|
|
742
742
|
{
|
|
743
743
|
key: 'response',
|
|
744
744
|
value: function response(response) {
|
|
@@ -782,6 +782,60 @@ var HttpHandler = /*#__PURE__*/ (function () {
|
|
|
782
782
|
return HttpHandler;
|
|
783
783
|
})();
|
|
784
784
|
|
|
785
|
+
function _class_call_check(instance, Constructor) {
|
|
786
|
+
if (!(instance instanceof Constructor)) {
|
|
787
|
+
throw new TypeError('Cannot call a class as a function');
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
function _defineProperties(target, props) {
|
|
791
|
+
for (var i = 0; i < props.length; i++) {
|
|
792
|
+
var descriptor = props[i];
|
|
793
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
794
|
+
descriptor.configurable = true;
|
|
795
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
796
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
800
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
801
|
+
return Constructor;
|
|
802
|
+
}
|
|
803
|
+
function _define_property(obj, key, value) {
|
|
804
|
+
if (key in obj) {
|
|
805
|
+
Object.defineProperty(obj, key, {
|
|
806
|
+
value: value,
|
|
807
|
+
enumerable: true,
|
|
808
|
+
configurable: true,
|
|
809
|
+
writable: true,
|
|
810
|
+
});
|
|
811
|
+
} else {
|
|
812
|
+
obj[key] = value;
|
|
813
|
+
}
|
|
814
|
+
return obj;
|
|
815
|
+
}
|
|
816
|
+
var CookieHelper = /*#__PURE__*/ (function () {
|
|
817
|
+
function CookieHelper() {
|
|
818
|
+
_class_call_check(this, CookieHelper);
|
|
819
|
+
}
|
|
820
|
+
_create_class(CookieHelper, null, [
|
|
821
|
+
{
|
|
822
|
+
key: 'isProduction',
|
|
823
|
+
value: function isProduction() {
|
|
824
|
+
return process.env.NODE_ENV === 'production';
|
|
825
|
+
},
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
key: 'getCookieName',
|
|
829
|
+
value: function getCookieName(name) {
|
|
830
|
+
return this.isProduction() ? this.cookieSecurePrefix + name : name;
|
|
831
|
+
},
|
|
832
|
+
},
|
|
833
|
+
]);
|
|
834
|
+
return CookieHelper;
|
|
835
|
+
})();
|
|
836
|
+
_define_property(CookieHelper, 'cookieSecurePrefix', '__Secure-');
|
|
837
|
+
|
|
838
|
+
exports.CookieHelper = CookieHelper;
|
|
785
839
|
exports.HttpHandler = HttpHandler;
|
|
786
840
|
exports.NativeException = NativeException;
|
|
787
841
|
exports.PgException = PgException;
|
package/dist/index.d.ts
CHANGED
|
@@ -702,3 +702,23 @@ declare module "@native-systems/utility" {
|
|
|
702
702
|
}
|
|
703
703
|
export { HttpHandler };
|
|
704
704
|
}
|
|
705
|
+
|
|
706
|
+
declare module "@native-systems/utility" {
|
|
707
|
+
/**
|
|
708
|
+
* Class with functions to determine if cookies should have the __Secure prefix applied or not.
|
|
709
|
+
* This is determined based on if the project is running in production or not, as __Secure cookies doesn't work in
|
|
710
|
+
* a dev environment.
|
|
711
|
+
*/
|
|
712
|
+
class CookieHelper {
|
|
713
|
+
private static readonly cookieSecurePrefix;
|
|
714
|
+
private static isProduction;
|
|
715
|
+
/**
|
|
716
|
+
* Returns the cookie name with either the secure prefix or as it was provided, based on the mode the project runs in.
|
|
717
|
+
* If the project is in production, return with __Secure- prefix otherwise return as it is.
|
|
718
|
+
* @param name {string} The base name of the cookie without any additional prefix.
|
|
719
|
+
* @returns {string} The potentially altered cookie name.
|
|
720
|
+
*/
|
|
721
|
+
static getCookieName(name: string): string;
|
|
722
|
+
}
|
|
723
|
+
export { CookieHelper };
|
|
724
|
+
}
|
package/dist/index.esm.js
CHANGED
|
@@ -294,7 +294,7 @@ function _call_super$1(_this, derived, args) {
|
|
|
294
294
|
: derived.apply(_this, args)
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
function _class_call_check$
|
|
297
|
+
function _class_call_check$4(instance, Constructor) {
|
|
298
298
|
if (!(instance instanceof Constructor)) {
|
|
299
299
|
throw new TypeError('Cannot call a class as a function');
|
|
300
300
|
}
|
|
@@ -314,7 +314,7 @@ function _construct$1(Parent, args, Class) {
|
|
|
314
314
|
}
|
|
315
315
|
return _construct$1.apply(null, arguments);
|
|
316
316
|
}
|
|
317
|
-
function _define_property$
|
|
317
|
+
function _define_property$3(obj, key, value) {
|
|
318
318
|
if (key in obj) {
|
|
319
319
|
Object.defineProperty(obj, key, {
|
|
320
320
|
value: value,
|
|
@@ -415,10 +415,10 @@ function _is_native_reflect_construct$1() {
|
|
|
415
415
|
var NativeException = /*#__PURE__*/ (function (Error1) {
|
|
416
416
|
_inherits$1(NativeException, Error1);
|
|
417
417
|
function NativeException(code, message) {
|
|
418
|
-
_class_call_check$
|
|
418
|
+
_class_call_check$4(this, NativeException);
|
|
419
419
|
var _this;
|
|
420
420
|
(_this = _call_super$1(this, NativeException, [message])),
|
|
421
|
-
_define_property$
|
|
421
|
+
_define_property$3(_this, 'code', void 0);
|
|
422
422
|
_this.name = 'NativeError';
|
|
423
423
|
_this.code = code;
|
|
424
424
|
return _this;
|
|
@@ -447,7 +447,7 @@ function _call_super(_this, derived, args) {
|
|
|
447
447
|
: derived.apply(_this, args)
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
|
-
function _class_call_check$
|
|
450
|
+
function _class_call_check$3(instance, Constructor) {
|
|
451
451
|
if (!(instance instanceof Constructor)) {
|
|
452
452
|
throw new TypeError('Cannot call a class as a function');
|
|
453
453
|
}
|
|
@@ -467,7 +467,7 @@ function _construct(Parent, args, Class) {
|
|
|
467
467
|
}
|
|
468
468
|
return _construct.apply(null, arguments);
|
|
469
469
|
}
|
|
470
|
-
function _defineProperties$
|
|
470
|
+
function _defineProperties$3(target, props) {
|
|
471
471
|
for (var i = 0; i < props.length; i++) {
|
|
472
472
|
var descriptor = props[i];
|
|
473
473
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -476,11 +476,11 @@ function _defineProperties$2(target, props) {
|
|
|
476
476
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
function _create_class$
|
|
480
|
-
if (protoProps) _defineProperties$
|
|
479
|
+
function _create_class$3(Constructor, protoProps, staticProps) {
|
|
480
|
+
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
481
481
|
return Constructor;
|
|
482
482
|
}
|
|
483
|
-
function _define_property$
|
|
483
|
+
function _define_property$2(obj, key, value) {
|
|
484
484
|
if (key in obj) {
|
|
485
485
|
Object.defineProperty(obj, key, {
|
|
486
486
|
value: value,
|
|
@@ -577,17 +577,17 @@ function _is_native_reflect_construct() {
|
|
|
577
577
|
var PgException = /*#__PURE__*/ (function (Error1) {
|
|
578
578
|
_inherits(PgException, Error1);
|
|
579
579
|
function PgException(err, message, specific) {
|
|
580
|
-
_class_call_check$
|
|
580
|
+
_class_call_check$3(this, PgException);
|
|
581
581
|
var _this;
|
|
582
582
|
(_this = _call_super(this, PgException, [message])),
|
|
583
|
-
_define_property$
|
|
584
|
-
_define_property$
|
|
583
|
+
_define_property$2(_this, 'err', void 0),
|
|
584
|
+
_define_property$2(_this, 'specific', void 0);
|
|
585
585
|
_this.name = 'PgError';
|
|
586
586
|
_this.err = err;
|
|
587
587
|
_this.specific = specific;
|
|
588
588
|
return _this;
|
|
589
589
|
}
|
|
590
|
-
_create_class$
|
|
590
|
+
_create_class$3(PgException, [
|
|
591
591
|
{
|
|
592
592
|
key: 'getStatus',
|
|
593
593
|
value: function getStatus() {
|
|
@@ -614,12 +614,12 @@ var PgException = /*#__PURE__*/ (function (Error1) {
|
|
|
614
614
|
return PgException;
|
|
615
615
|
})(_wrap_native_super(Error));
|
|
616
616
|
|
|
617
|
-
function _class_call_check$
|
|
617
|
+
function _class_call_check$2(instance, Constructor) {
|
|
618
618
|
if (!(instance instanceof Constructor)) {
|
|
619
619
|
throw new TypeError('Cannot call a class as a function');
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
function _defineProperties$
|
|
622
|
+
function _defineProperties$2(target, props) {
|
|
623
623
|
for (var i = 0; i < props.length; i++) {
|
|
624
624
|
var descriptor = props[i];
|
|
625
625
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -628,11 +628,11 @@ function _defineProperties$1(target, props) {
|
|
|
628
628
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
function _create_class$
|
|
632
|
-
if (protoProps) _defineProperties$
|
|
631
|
+
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
632
|
+
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
633
633
|
return Constructor;
|
|
634
634
|
}
|
|
635
|
-
function _define_property(obj, key, value) {
|
|
635
|
+
function _define_property$1(obj, key, value) {
|
|
636
636
|
if (key in obj) {
|
|
637
637
|
Object.defineProperty(obj, key, {
|
|
638
638
|
value: value,
|
|
@@ -660,10 +660,10 @@ var NO_OP = function (_message) {
|
|
|
660
660
|
};
|
|
661
661
|
var ConsoleLogger = /*#__PURE__*/ (function () {
|
|
662
662
|
function ConsoleLogger(options) {
|
|
663
|
-
_class_call_check$
|
|
664
|
-
_define_property(this, 'log', void 0);
|
|
665
|
-
_define_property(this, 'warn', void 0);
|
|
666
|
-
_define_property(this, 'error', void 0);
|
|
663
|
+
_class_call_check$2(this, ConsoleLogger);
|
|
664
|
+
_define_property$1(this, 'log', void 0);
|
|
665
|
+
_define_property$1(this, 'warn', void 0);
|
|
666
|
+
_define_property$1(this, 'error', void 0);
|
|
667
667
|
var level = (options || {}).level;
|
|
668
668
|
this.error = console.error.bind(console);
|
|
669
669
|
this.warn = NO_OP;
|
|
@@ -678,7 +678,7 @@ var ConsoleLogger = /*#__PURE__*/ (function () {
|
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
_create_class$
|
|
681
|
+
_create_class$2(ConsoleLogger, [
|
|
682
682
|
{
|
|
683
683
|
key: 'disable',
|
|
684
684
|
value: function disable() {
|
|
@@ -714,12 +714,12 @@ var logger = new ConsoleLogger({
|
|
|
714
714
|
level: LOG_LEVEL,
|
|
715
715
|
});
|
|
716
716
|
|
|
717
|
-
function _class_call_check(instance, Constructor) {
|
|
717
|
+
function _class_call_check$1(instance, Constructor) {
|
|
718
718
|
if (!(instance instanceof Constructor)) {
|
|
719
719
|
throw new TypeError('Cannot call a class as a function');
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
function _defineProperties(target, props) {
|
|
722
|
+
function _defineProperties$1(target, props) {
|
|
723
723
|
for (var i = 0; i < props.length; i++) {
|
|
724
724
|
var descriptor = props[i];
|
|
725
725
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -728,15 +728,15 @@ function _defineProperties(target, props) {
|
|
|
728
728
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
732
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
731
|
+
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
732
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
733
733
|
return Constructor;
|
|
734
734
|
}
|
|
735
735
|
var HttpHandler = /*#__PURE__*/ (function () {
|
|
736
736
|
function HttpHandler() {
|
|
737
|
-
_class_call_check(this, HttpHandler);
|
|
737
|
+
_class_call_check$1(this, HttpHandler);
|
|
738
738
|
}
|
|
739
|
-
_create_class(HttpHandler, null, [
|
|
739
|
+
_create_class$1(HttpHandler, null, [
|
|
740
740
|
{
|
|
741
741
|
key: 'response',
|
|
742
742
|
value: function response(response) {
|
|
@@ -780,4 +780,64 @@ var HttpHandler = /*#__PURE__*/ (function () {
|
|
|
780
780
|
return HttpHandler;
|
|
781
781
|
})();
|
|
782
782
|
|
|
783
|
-
|
|
783
|
+
function _class_call_check(instance, Constructor) {
|
|
784
|
+
if (!(instance instanceof Constructor)) {
|
|
785
|
+
throw new TypeError('Cannot call a class as a function');
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
function _defineProperties(target, props) {
|
|
789
|
+
for (var i = 0; i < props.length; i++) {
|
|
790
|
+
var descriptor = props[i];
|
|
791
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
792
|
+
descriptor.configurable = true;
|
|
793
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
794
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
798
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
799
|
+
return Constructor;
|
|
800
|
+
}
|
|
801
|
+
function _define_property(obj, key, value) {
|
|
802
|
+
if (key in obj) {
|
|
803
|
+
Object.defineProperty(obj, key, {
|
|
804
|
+
value: value,
|
|
805
|
+
enumerable: true,
|
|
806
|
+
configurable: true,
|
|
807
|
+
writable: true,
|
|
808
|
+
});
|
|
809
|
+
} else {
|
|
810
|
+
obj[key] = value;
|
|
811
|
+
}
|
|
812
|
+
return obj;
|
|
813
|
+
}
|
|
814
|
+
var CookieHelper = /*#__PURE__*/ (function () {
|
|
815
|
+
function CookieHelper() {
|
|
816
|
+
_class_call_check(this, CookieHelper);
|
|
817
|
+
}
|
|
818
|
+
_create_class(CookieHelper, null, [
|
|
819
|
+
{
|
|
820
|
+
key: 'isProduction',
|
|
821
|
+
value: function isProduction() {
|
|
822
|
+
return process.env.NODE_ENV === 'production';
|
|
823
|
+
},
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
key: 'getCookieName',
|
|
827
|
+
value: function getCookieName(name) {
|
|
828
|
+
return this.isProduction() ? this.cookieSecurePrefix + name : name;
|
|
829
|
+
},
|
|
830
|
+
},
|
|
831
|
+
]);
|
|
832
|
+
return CookieHelper;
|
|
833
|
+
})();
|
|
834
|
+
_define_property(CookieHelper, 'cookieSecurePrefix', '__Secure-');
|
|
835
|
+
|
|
836
|
+
export {
|
|
837
|
+
CookieHelper,
|
|
838
|
+
HttpHandler,
|
|
839
|
+
NativeException,
|
|
840
|
+
PgException,
|
|
841
|
+
PostgresError,
|
|
842
|
+
logger,
|
|
843
|
+
};
|