@magic-xpa/utils 4.1000.0-dev4100.36 → 4.1000.0-dev4100.360
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/esm2020/src/Base64.mjs +30 -31
- package/esm2020/src/InternalInterface.mjs +5 -4
- package/esm2020/src/Logger.mjs +5 -5
- package/esm2020/src/UtilImeJpn.mjs +4 -4
- package/fesm2015/magic-xpa-utils.mjs +40 -40
- package/fesm2015/magic-xpa-utils.mjs.map +1 -1
- package/fesm2020/magic-xpa-utils.mjs +40 -40
- package/fesm2020/magic-xpa-utils.mjs.map +1 -1
- package/package.json +4 -4
- package/src/Base64.d.ts +3 -7
- package/src/InternalInterface.d.ts +1 -0
- package/magic-xpa-utils.d.ts +0 -2
|
@@ -1462,16 +1462,11 @@ class Misc {
|
|
|
1462
1462
|
}
|
|
1463
1463
|
|
|
1464
1464
|
class Base64 {
|
|
1465
|
-
static encode(
|
|
1466
|
-
if (arguments.length ===
|
|
1467
|
-
return Base64.
|
|
1468
|
-
else if (arguments.length === 3)
|
|
1469
|
-
return Base64.encode_1(strOrData, encodingOrIsUseEnvCharset, encoding);
|
|
1465
|
+
static encode(str, isUseEnvCharset, encoding) {
|
|
1466
|
+
if (arguments.length === 1)
|
|
1467
|
+
return Base64.encode_1(str, false, null);
|
|
1470
1468
|
else
|
|
1471
|
-
return Base64.
|
|
1472
|
-
}
|
|
1473
|
-
static encode_0(str, encoding) {
|
|
1474
|
-
return Base64.encode(str, false, encoding);
|
|
1469
|
+
return Base64.encode_1(str, isUseEnvCharset, encoding);
|
|
1475
1470
|
}
|
|
1476
1471
|
static encode_1(str, isUseEnvCharset, encoding) {
|
|
1477
1472
|
let result;
|
|
@@ -1484,10 +1479,15 @@ class Base64 {
|
|
|
1484
1479
|
}
|
|
1485
1480
|
else {
|
|
1486
1481
|
try {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1482
|
+
if (isUseEnvCharset === false) {
|
|
1483
|
+
result = btoa(str);
|
|
1484
|
+
}
|
|
1485
|
+
else {
|
|
1486
|
+
let instance = ISO_8859_1_Encoding.ISO_8859_1;
|
|
1487
|
+
let encoding2 = isUseEnvCharset ? encoding : instance;
|
|
1488
|
+
let ba = Base64.encodeBytes(encoding2.GetBytes(str));
|
|
1489
|
+
result = instance.GetString(ba, 0, ba.length);
|
|
1490
|
+
}
|
|
1491
1491
|
}
|
|
1492
1492
|
catch (ex) {
|
|
1493
1493
|
throw new ApplicationException(ex.Message);
|
|
@@ -1496,7 +1496,7 @@ class Base64 {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
return result;
|
|
1498
1498
|
}
|
|
1499
|
-
static
|
|
1499
|
+
static encodeBytes(data) {
|
|
1500
1500
|
if (data === null)
|
|
1501
1501
|
return null;
|
|
1502
1502
|
let dest = new Uint8Array(Math.floor((data.length + 2) / 3) * 4);
|
|
@@ -1525,16 +1525,10 @@ class Base64 {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
return dest;
|
|
1527
1527
|
}
|
|
1528
|
-
static decode(
|
|
1529
|
-
if (arguments.length === 1
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
return Base64.decode_1(strOrData, encoding);
|
|
1533
|
-
else
|
|
1534
|
-
return Base64.decode_2(strOrData);
|
|
1535
|
-
}
|
|
1536
|
-
static decode_0(str) {
|
|
1537
|
-
return Base64.decode(str, null);
|
|
1528
|
+
static decode(str, encoding) {
|
|
1529
|
+
if (arguments.length === 1)
|
|
1530
|
+
encoding = null;
|
|
1531
|
+
return Base64.decode_1(str, encoding);
|
|
1538
1532
|
}
|
|
1539
1533
|
static decode_1(str, encoding) {
|
|
1540
1534
|
let result;
|
|
@@ -1547,10 +1541,15 @@ class Base64 {
|
|
|
1547
1541
|
}
|
|
1548
1542
|
else {
|
|
1549
1543
|
try {
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1544
|
+
if (encoding === null || encoding === undefined) {
|
|
1545
|
+
result = atob(str);
|
|
1546
|
+
}
|
|
1547
|
+
else {
|
|
1548
|
+
let instance = ISO_8859_1_Encoding.ISO_8859_1;
|
|
1549
|
+
let array = Base64.decodeBytes(instance.GetBytes(str));
|
|
1550
|
+
let encoding2 = (encoding !== null) ? encoding : instance;
|
|
1551
|
+
result = encoding2.GetString(array, 0, array.length);
|
|
1552
|
+
}
|
|
1554
1553
|
}
|
|
1555
1554
|
catch (ex) {
|
|
1556
1555
|
throw new ApplicationException(ex.Message);
|
|
@@ -1559,7 +1558,7 @@ class Base64 {
|
|
|
1559
1558
|
}
|
|
1560
1559
|
return result;
|
|
1561
1560
|
}
|
|
1562
|
-
static
|
|
1561
|
+
static decodeBytes(data) {
|
|
1563
1562
|
if (data === null)
|
|
1564
1563
|
return null;
|
|
1565
1564
|
let tail = data.length;
|
|
@@ -1598,7 +1597,7 @@ class Base64 {
|
|
|
1598
1597
|
return new Uint8Array(0);
|
|
1599
1598
|
try {
|
|
1600
1599
|
let instance = ISO_8859_1_Encoding.ISO_8859_1;
|
|
1601
|
-
return Base64.
|
|
1600
|
+
return Base64.decodeBytes(instance.GetBytes(str));
|
|
1602
1601
|
}
|
|
1603
1602
|
catch (ex) {
|
|
1604
1603
|
throw new ApplicationException(ex.Message);
|
|
@@ -3875,11 +3874,11 @@ var NotifyCollectionChangedAction;
|
|
|
3875
3874
|
})(NotifyCollectionChangedAction || (NotifyCollectionChangedAction = {}));
|
|
3876
3875
|
|
|
3877
3876
|
class InternalInterface {
|
|
3878
|
-
constructor() {
|
|
3879
|
-
}
|
|
3880
3877
|
static BuiltinEvent(eventCode) {
|
|
3881
3878
|
return eventCode >= 1000 || eventCode === InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT;
|
|
3882
3879
|
}
|
|
3880
|
+
constructor() {
|
|
3881
|
+
}
|
|
3883
3882
|
}
|
|
3884
3883
|
InternalInterface.MG_ACT_NONE = 0;
|
|
3885
3884
|
InternalInterface.MG_ACT_CHAR = 1;
|
|
@@ -4181,7 +4180,8 @@ InternalInterface.MG_ACT_CRELINE_ABOVE = 634;
|
|
|
4181
4180
|
InternalInterface.MG_ACT_CONTEXT_TERMINATION = 635;
|
|
4182
4181
|
InternalInterface.MG_ACT_CONTEXT_TIMEOUT_RESET = 636;
|
|
4183
4182
|
InternalInterface.MG_ACT_CONTEXT_REMOVE = 647;
|
|
4184
|
-
InternalInterface.
|
|
4183
|
+
InternalInterface.MG_ACT_DUMP_ENVIRONMENT = 653;
|
|
4184
|
+
InternalInterface.MG_ACT_TOT_CNT = 654;
|
|
4185
4185
|
InternalInterface.MG_ACT_TASK_PREFIX = 1001;
|
|
4186
4186
|
InternalInterface.MG_ACT_TASK_SUFFIX = 1002;
|
|
4187
4187
|
InternalInterface.MG_ACT_REC_PREFIX = 1003;
|
|
@@ -4262,10 +4262,6 @@ var LogType;
|
|
|
4262
4262
|
LogType[LogType["error"] = 3] = "error";
|
|
4263
4263
|
})(LogType || (LogType = {}));
|
|
4264
4264
|
class Logger {
|
|
4265
|
-
constructor() {
|
|
4266
|
-
this.LogLevel = 0;
|
|
4267
|
-
this.ShouldBeep = false;
|
|
4268
|
-
}
|
|
4269
4265
|
static set Instance(value) {
|
|
4270
4266
|
Logger.instance = value;
|
|
4271
4267
|
}
|
|
@@ -4461,6 +4457,10 @@ class Logger {
|
|
|
4461
4457
|
}
|
|
4462
4458
|
Flush() {
|
|
4463
4459
|
}
|
|
4460
|
+
constructor() {
|
|
4461
|
+
this.LogLevel = 0;
|
|
4462
|
+
this.ShouldBeep = false;
|
|
4463
|
+
}
|
|
4464
4464
|
}
|
|
4465
4465
|
Logger.instance = null;
|
|
4466
4466
|
|
|
@@ -5067,13 +5067,13 @@ UtilDateJpn.StartDayOfGengo = [
|
|
|
5067
5067
|
];
|
|
5068
5068
|
|
|
5069
5069
|
class UtilImeJpn {
|
|
5070
|
+
isValid(imeMode) {
|
|
5071
|
+
return (0 <= imeMode && imeMode <= 9) || imeMode === 15 || imeMode === 10;
|
|
5072
|
+
}
|
|
5070
5073
|
constructor() {
|
|
5071
5074
|
this.ImeAutoOff = false;
|
|
5072
5075
|
this.StrImeRead = null;
|
|
5073
5076
|
}
|
|
5074
|
-
isValid(imeMode) {
|
|
5075
|
-
return (0 <= imeMode && imeMode <= 9) || imeMode === 15 || imeMode === 10;
|
|
5076
|
-
}
|
|
5077
5077
|
}
|
|
5078
5078
|
UtilImeJpn.IME_ZEN_HIRAGANA_ROMAN = 1;
|
|
5079
5079
|
UtilImeJpn.IME_FORCE_OFF = 15;
|