@intlify/core-base 9.3.0-beta.10 → 9.3.0-beta.11

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core-base v9.3.0-beta.10
2
+ * core-base v9.3.0-beta.11
3
3
  * (c) 2022 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -12,51 +12,51 @@ var shared = require('@intlify/shared');
12
12
  var devtoolsIf = require('@intlify/devtools-if');
13
13
 
14
14
  const pathStateMachine = [];
15
- pathStateMachine[0 /* BEFORE_PATH */] = {
16
- ["w" /* WORKSPACE */]: [0 /* BEFORE_PATH */],
17
- ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
18
- ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
19
- ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
15
+ pathStateMachine[0 /* States.BEFORE_PATH */] = {
16
+ ["w" /* PathCharTypes.WORKSPACE */]: [0 /* States.BEFORE_PATH */],
17
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
18
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],
19
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]
20
20
  };
21
- pathStateMachine[1 /* IN_PATH */] = {
22
- ["w" /* WORKSPACE */]: [1 /* IN_PATH */],
23
- ["." /* DOT */]: [2 /* BEFORE_IDENT */],
24
- ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
25
- ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
21
+ pathStateMachine[1 /* States.IN_PATH */] = {
22
+ ["w" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */],
23
+ ["." /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */],
24
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],
25
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]
26
26
  };
27
- pathStateMachine[2 /* BEFORE_IDENT */] = {
28
- ["w" /* WORKSPACE */]: [2 /* BEFORE_IDENT */],
29
- ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
30
- ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */]
27
+ pathStateMachine[2 /* States.BEFORE_IDENT */] = {
28
+ ["w" /* PathCharTypes.WORKSPACE */]: [2 /* States.BEFORE_IDENT */],
29
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
30
+ ["0" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */]
31
31
  };
32
- pathStateMachine[3 /* IN_IDENT */] = {
33
- ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
34
- ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */],
35
- ["w" /* WORKSPACE */]: [1 /* IN_PATH */, 1 /* PUSH */],
36
- ["." /* DOT */]: [2 /* BEFORE_IDENT */, 1 /* PUSH */],
37
- ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */, 1 /* PUSH */],
38
- ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */, 1 /* PUSH */]
32
+ pathStateMachine[3 /* States.IN_IDENT */] = {
33
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
34
+ ["0" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
35
+ ["w" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */, 1 /* Actions.PUSH */],
36
+ ["." /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */, 1 /* Actions.PUSH */],
37
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */, 1 /* Actions.PUSH */],
38
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */, 1 /* Actions.PUSH */]
39
39
  };
40
- pathStateMachine[4 /* IN_SUB_PATH */] = {
41
- ["'" /* SINGLE_QUOTE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */],
42
- ["\"" /* DOUBLE_QUOTE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */],
43
- ["[" /* LEFT_BRACKET */]: [
44
- 4 /* IN_SUB_PATH */,
45
- 2 /* INC_SUB_PATH_DEPTH */
40
+ pathStateMachine[4 /* States.IN_SUB_PATH */] = {
41
+ ["'" /* PathCharTypes.SINGLE_QUOTE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */],
42
+ ["\"" /* PathCharTypes.DOUBLE_QUOTE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */],
43
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [
44
+ 4 /* States.IN_SUB_PATH */,
45
+ 2 /* Actions.INC_SUB_PATH_DEPTH */
46
46
  ],
47
- ["]" /* RIGHT_BRACKET */]: [1 /* IN_PATH */, 3 /* PUSH_SUB_PATH */],
48
- ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
49
- ["l" /* ELSE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */]
47
+ ["]" /* PathCharTypes.RIGHT_BRACKET */]: [1 /* States.IN_PATH */, 3 /* Actions.PUSH_SUB_PATH */],
48
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
49
+ ["l" /* PathCharTypes.ELSE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */]
50
50
  };
51
- pathStateMachine[5 /* IN_SINGLE_QUOTE */] = {
52
- ["'" /* SINGLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
53
- ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
54
- ["l" /* ELSE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */]
51
+ pathStateMachine[5 /* States.IN_SINGLE_QUOTE */] = {
52
+ ["'" /* PathCharTypes.SINGLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],
53
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
54
+ ["l" /* PathCharTypes.ELSE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */]
55
55
  };
56
- pathStateMachine[6 /* IN_DOUBLE_QUOTE */] = {
57
- ["\"" /* DOUBLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
58
- ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
59
- ["l" /* ELSE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */]
56
+ pathStateMachine[6 /* States.IN_DOUBLE_QUOTE */] = {
57
+ ["\"" /* PathCharTypes.DOUBLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],
58
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
59
+ ["l" /* PathCharTypes.ELSE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */]
60
60
  };
61
61
  /**
62
62
  * Check if an expression is a literal value.
@@ -78,7 +78,7 @@ function stripQuotes(str) {
78
78
  */
79
79
  function getPathCharType(ch) {
80
80
  if (ch === undefined || ch === null) {
81
- return "o" /* END_OF_FAIL */;
81
+ return "o" /* PathCharTypes.END_OF_FAIL */;
82
82
  }
83
83
  const code = ch.charCodeAt(0);
84
84
  switch (code) {
@@ -91,7 +91,7 @@ function getPathCharType(ch) {
91
91
  case 0x5f: // _
92
92
  case 0x24: // $
93
93
  case 0x2d: // -
94
- return "i" /* IDENT */;
94
+ return "i" /* PathCharTypes.IDENT */;
95
95
  case 0x09: // Tab (HT)
96
96
  case 0x0a: // Newline (LF)
97
97
  case 0x0d: // Return (CR)
@@ -99,9 +99,9 @@ function getPathCharType(ch) {
99
99
  case 0xfeff: // Byte Order Mark (BOM)
100
100
  case 0x2028: // Line Separator (LS)
101
101
  case 0x2029: // Paragraph Separator (PS)
102
- return "w" /* WORKSPACE */;
102
+ return "w" /* PathCharTypes.WORKSPACE */;
103
103
  }
104
- return "i" /* IDENT */;
104
+ return "i" /* PathCharTypes.IDENT */;
105
105
  }
106
106
  /**
107
107
  * Format a subPath, return its plain form if it is
@@ -116,7 +116,7 @@ function formatSubPath(path) {
116
116
  }
117
117
  return isLiteral(trimmed)
118
118
  ? stripQuotes(trimmed)
119
- : "*" /* ASTARISK */ + trimmed;
119
+ : "*" /* PathCharTypes.ASTARISK */ + trimmed;
120
120
  }
121
121
  /**
122
122
  * Parse a string path into an array of segments
@@ -124,7 +124,7 @@ function formatSubPath(path) {
124
124
  function parse(path) {
125
125
  const keys = [];
126
126
  let index = -1;
127
- let mode = 0 /* BEFORE_PATH */;
127
+ let mode = 0 /* States.BEFORE_PATH */;
128
128
  let subPathDepth = 0;
129
129
  let c;
130
130
  let key; // eslint-disable-line
@@ -134,7 +134,7 @@ function parse(path) {
134
134
  let action;
135
135
  let typeMap;
136
136
  const actions = [];
137
- actions[0 /* APPEND */] = () => {
137
+ actions[0 /* Actions.APPEND */] = () => {
138
138
  if (key === undefined) {
139
139
  key = newChar;
140
140
  }
@@ -142,21 +142,21 @@ function parse(path) {
142
142
  key += newChar;
143
143
  }
144
144
  };
145
- actions[1 /* PUSH */] = () => {
145
+ actions[1 /* Actions.PUSH */] = () => {
146
146
  if (key !== undefined) {
147
147
  keys.push(key);
148
148
  key = undefined;
149
149
  }
150
150
  };
151
- actions[2 /* INC_SUB_PATH_DEPTH */] = () => {
152
- actions[0 /* APPEND */]();
151
+ actions[2 /* Actions.INC_SUB_PATH_DEPTH */] = () => {
152
+ actions[0 /* Actions.APPEND */]();
153
153
  subPathDepth++;
154
154
  };
155
- actions[3 /* PUSH_SUB_PATH */] = () => {
155
+ actions[3 /* Actions.PUSH_SUB_PATH */] = () => {
156
156
  if (subPathDepth > 0) {
157
157
  subPathDepth--;
158
- mode = 4 /* IN_SUB_PATH */;
159
- actions[0 /* APPEND */]();
158
+ mode = 4 /* States.IN_SUB_PATH */;
159
+ actions[0 /* Actions.APPEND */]();
160
160
  }
161
161
  else {
162
162
  subPathDepth = 0;
@@ -168,19 +168,19 @@ function parse(path) {
168
168
  return false;
169
169
  }
170
170
  else {
171
- actions[1 /* PUSH */]();
171
+ actions[1 /* Actions.PUSH */]();
172
172
  }
173
173
  }
174
174
  };
175
175
  function maybeUnescapeQuote() {
176
176
  const nextChar = path[index + 1];
177
- if ((mode === 5 /* IN_SINGLE_QUOTE */ &&
178
- nextChar === "'" /* SINGLE_QUOTE */) ||
179
- (mode === 6 /* IN_DOUBLE_QUOTE */ &&
180
- nextChar === "\"" /* DOUBLE_QUOTE */)) {
177
+ if ((mode === 5 /* States.IN_SINGLE_QUOTE */ &&
178
+ nextChar === "'" /* PathCharTypes.SINGLE_QUOTE */) ||
179
+ (mode === 6 /* States.IN_DOUBLE_QUOTE */ &&
180
+ nextChar === "\"" /* PathCharTypes.DOUBLE_QUOTE */)) {
181
181
  index++;
182
182
  newChar = '\\' + nextChar;
183
- actions[0 /* APPEND */]();
183
+ actions[0 /* Actions.APPEND */]();
184
184
  return true;
185
185
  }
186
186
  }
@@ -192,9 +192,9 @@ function parse(path) {
192
192
  }
193
193
  type = getPathCharType(c);
194
194
  typeMap = pathStateMachine[mode];
195
- transition = typeMap[type] || typeMap["l" /* ELSE */] || 8 /* ERROR */;
195
+ transition = typeMap[type] || typeMap["l" /* PathCharTypes.ELSE */] || 8 /* States.ERROR */;
196
196
  // check parse error
197
- if (transition === 8 /* ERROR */) {
197
+ if (transition === 8 /* States.ERROR */) {
198
198
  return;
199
199
  }
200
200
  mode = transition[0];
@@ -208,7 +208,7 @@ function parse(path) {
208
208
  }
209
209
  }
210
210
  // check parse finish
211
- if (mode === 7 /* AFTER_PATH */) {
211
+ if (mode === 7 /* States.AFTER_PATH */) {
212
212
  return keys;
213
213
  }
214
214
  }
@@ -392,14 +392,14 @@ function createMessageContext(options = {}) {
392
392
  return modifier ? _modifier(modifier)(msg, type) : msg;
393
393
  };
394
394
  const ctx = {
395
- ["list" /* LIST */]: list,
396
- ["named" /* NAMED */]: named,
397
- ["plural" /* PLURAL */]: plural,
398
- ["linked" /* LINKED */]: linked,
399
- ["message" /* MESSAGE */]: message,
400
- ["type" /* TYPE */]: type,
401
- ["interpolate" /* INTERPOLATE */]: interpolate,
402
- ["normalize" /* NORMALIZE */]: normalize
395
+ ["list" /* HelperNameMap.LIST */]: list,
396
+ ["named" /* HelperNameMap.NAMED */]: named,
397
+ ["plural" /* HelperNameMap.PLURAL */]: plural,
398
+ ["linked" /* HelperNameMap.LINKED */]: linked,
399
+ ["message" /* HelperNameMap.MESSAGE */]: message,
400
+ ["type" /* HelperNameMap.TYPE */]: type,
401
+ ["interpolate" /* HelperNameMap.INTERPOLATE */]: interpolate,
402
+ ["normalize" /* HelperNameMap.NORMALIZE */]: normalize
403
403
  };
404
404
  return ctx;
405
405
  }
@@ -569,7 +569,7 @@ function appendItemToChain(chain, target, blocks) {
569
569
  * Intlify core-base version
570
570
  * @internal
571
571
  */
572
- const VERSION = '9.3.0-beta.10';
572
+ const VERSION = '9.3.0-beta.11';
573
573
  const NOT_REOSLVED = -1;
574
574
  const DEFAULT_LOCALE = 'en-US';
575
575
  const MISSING_RESOLVE_VALUE = '';
@@ -629,7 +629,7 @@ function registerLocaleFallbacker(fallbacker) {
629
629
  _fallbacker = fallbacker;
630
630
  }
631
631
  // Additional Meta for Intlify DevTools
632
- let _additionalMeta = null;
632
+ let _additionalMeta = null;
633
633
  const setAdditionalMeta = (meta) => {
634
634
  _additionalMeta = meta;
635
635
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlify/core-base",
3
- "version": "9.3.0-beta.10",
3
+ "version": "9.3.0-beta.11",
4
4
  "description": "@intlify/core-base",
5
5
  "keywords": [
6
6
  "core",
@@ -33,10 +33,10 @@
33
33
  "jsdelivr": "dist/core-base.global.js",
34
34
  "types": "dist/core-base.d.ts",
35
35
  "dependencies": {
36
- "@intlify/devtools-if": "9.3.0-beta.10",
37
- "@intlify/message-compiler": "9.3.0-beta.10",
38
- "@intlify/shared": "9.3.0-beta.10",
39
- "@intlify/vue-devtools": "9.3.0-beta.10"
36
+ "@intlify/devtools-if": "9.3.0-beta.11",
37
+ "@intlify/message-compiler": "9.3.0-beta.11",
38
+ "@intlify/shared": "9.3.0-beta.11",
39
+ "@intlify/vue-devtools": "9.3.0-beta.11"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">= 14"