@konomi-app/kintone-utilities 6.2.0 → 6.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- // src/character-hebon.ts
4
- var hebonMap = {
3
+ // src/character-ime-roman.ts
4
+ var imeRomanMap = {
5
5
  \u3042: "A",
6
6
  \u3044: "I",
7
7
  \u3046: "U",
@@ -13,13 +13,13 @@ var hebonMap = {
13
13
  \u3051: "KE",
14
14
  \u3053: "KO",
15
15
  \u3055: "SA",
16
- \u3057: "SHI",
16
+ \u3057: "SI",
17
17
  \u3059: "SU",
18
18
  \u305B: "SE",
19
19
  \u305D: "SO",
20
20
  \u305F: "TA",
21
- \u3061: "CHI",
22
- \u3064: "TSU",
21
+ \u3061: "TI",
22
+ \u3064: "TU",
23
23
  \u3066: "TE",
24
24
  \u3068: "TO",
25
25
  \u306A: "NA",
@@ -29,7 +29,7 @@ var hebonMap = {
29
29
  \u306E: "NO",
30
30
  \u306F: "HA",
31
31
  \u3072: "HI",
32
- \u3075: "FU",
32
+ \u3075: "HU",
33
33
  \u3078: "HE",
34
34
  \u307B: "HO",
35
35
  \u307E: "MA",
@@ -46,27 +46,23 @@ var hebonMap = {
46
46
  \u308C: "RE",
47
47
  \u308D: "RO",
48
48
  \u308F: "WA",
49
- \u3090: "I",
50
- \u3091: "E",
51
- \u3092: "O",
52
- \u3041: "A",
53
- \u3043: "I",
54
- \u3045: "U",
55
- \u3047: "E",
56
- \u3049: "O",
49
+ \u3090: "WI",
50
+ \u3091: "WE",
51
+ \u3092: "WO",
52
+ \u3093: "NN",
57
53
  \u304C: "GA",
58
54
  \u304E: "GI",
59
55
  \u3050: "GU",
60
56
  \u3052: "GE",
61
57
  \u3054: "GO",
62
58
  \u3056: "ZA",
63
- \u3058: "JI",
59
+ \u3058: "ZI",
64
60
  \u305A: "ZU",
65
61
  \u305C: "ZE",
66
62
  \u305E: "ZO",
67
63
  \u3060: "DA",
68
- \u3062: "JI",
69
- \u3065: "ZU",
64
+ \u3062: "DI",
65
+ \u3065: "DU",
70
66
  \u3067: "DE",
71
67
  \u3069: "DO",
72
68
  \u3070: "BA",
@@ -79,106 +75,25 @@ var hebonMap = {
79
75
  \u3077: "PU",
80
76
  \u307A: "PE",
81
77
  \u307D: "PO",
82
- \u304D\u3083: "KYA",
83
- \u304D\u3085: "KYU",
84
- \u304D\u3087: "KYO",
85
- \u3057\u3083: "SHA",
86
- \u3057\u3085: "SHU",
87
- \u3057\u3087: "SHO",
88
- \u3061\u3083: "CHA",
89
- \u3061\u3085: "CHU",
90
- \u3061\u3087: "CHO",
91
- \u3061\u3047: "CHE",
92
- \u306B\u3083: "NYA",
93
- \u306B\u3085: "NYU",
94
- \u306B\u3087: "NYO",
95
- \u3072\u3083: "HYA",
96
- \u3072\u3085: "HYU",
97
- \u3072\u3087: "HYO",
98
- \u307F\u3083: "MYA",
99
- \u307F\u3085: "MYU",
100
- \u307F\u3087: "MYO",
101
- \u308A\u3083: "RYA",
102
- \u308A\u3085: "RYU",
103
- \u308A\u3087: "RYO",
104
- \u304E\u3083: "GYA",
105
- \u304E\u3085: "GYU",
106
- \u304E\u3087: "GYO",
107
- \u3058\u3083: "JA",
108
- \u3058\u3085: "JU",
109
- \u3058\u3087: "JO",
110
- \u3073\u3083: "BYA",
111
- \u3073\u3085: "BYU",
112
- \u3073\u3087: "BYO",
113
- \u3074\u3083: "PYA",
114
- \u3074\u3085: "PYU",
115
- \u3074\u3087: "PYO"
116
- };
117
- var aaSet = {
118
- AA: true,
119
- EE: true,
120
- II: false,
121
- // I は連続しても省略しない
122
- OO: true,
123
- OU: true,
124
- UU: true
125
- };
126
- var getHebon = (s, index) => {
127
- let h = null;
128
- let c = null;
129
- if (index + 1 < s.length) {
130
- c = s.substring(index, index + 2);
131
- h = hebonMap[c];
132
- }
133
- if (!h && index < s.length) {
134
- c = s.substring(index, index + 1);
135
- h = hebonMap[c];
136
- }
137
- return { c: c ?? "", h: h ?? null };
138
- };
139
- function toHebon(s) {
140
- let hebon = "";
141
- let lastHebon = "";
142
- let i = 0;
143
- while (i < s.length) {
144
- const hr = getHebon(s, i);
145
- if (hr.c === "\u3063") {
146
- const nextHr = getHebon(s, i + 1);
147
- if (nextHr.h !== null) {
148
- if (nextHr.h.startsWith("CH")) {
149
- hr.h = "T";
150
- } else {
151
- hr.h = nextHr.h.substring(0, 1);
152
- }
153
- }
154
- } else if (hr.c === "\u3093") {
155
- const nextHr = getHebon(s, i + 1);
156
- if (nextHr.h !== null && "BMP".indexOf(nextHr.h.charAt(0)) !== -1) {
157
- hr.h = "M";
158
- } else {
159
- hr.h = "N";
160
- }
161
- } else if (hr.c === "\u30FC") {
162
- hr.h = "";
163
- }
164
- if (hr.h !== null) {
165
- if (lastHebon !== null) {
166
- let htest = lastHebon + hr.h;
167
- if (htest.length > 2) {
168
- htest = htest.substring(htest.length - 2);
169
- }
170
- if (aaSet[htest]) {
171
- hr.h = "";
172
- }
173
- }
174
- hebon += hr.h;
175
- } else {
176
- hebon += hr.c;
177
- }
178
- lastHebon = hr.h;
179
- i += hr.c.length;
78
+ \u3094: "VU",
79
+ \u3041: "XA",
80
+ \u3043: "XI",
81
+ \u3045: "XU",
82
+ \u3047: "XE",
83
+ \u3049: "XO",
84
+ \u3063: "XTU",
85
+ \u3083: "XYA",
86
+ \u3085: "XYU",
87
+ \u3087: "XYO",
88
+ \u30FC: ""
89
+ };
90
+ function toIMERoman(s) {
91
+ let result = "";
92
+ for (let i = 0; i < s.length; i++) {
93
+ const mapped = imeRomanMap[s[i]];
94
+ result += mapped !== void 0 ? mapped : s[i];
180
95
  }
181
- return hebon;
96
+ return result;
182
97
  }
183
98
 
184
99
  // src/character-width-conversion.ts
@@ -306,7 +221,7 @@ var getYuruChara = (target, options) => {
306
221
  converted = convertKatakanaToHiragana(converted);
307
222
  }
308
223
  if (!isHebonSensitive) {
309
- converted = toHebon(converted);
224
+ converted = toIMERoman(converted);
310
225
  }
311
226
  if (!isCaseSensitive) {
312
227
  converted = converted.toLowerCase();