@dcloudio/vue-cli-plugin-uni 2.0.0 → 2.0.1-32920211122002

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.
Files changed (269) hide show
  1. package/commands/build.js +64 -33
  2. package/commands/serve.js +12 -17
  3. package/generator.js +6 -2
  4. package/index.js +5 -3
  5. package/lib/chain-webpack.js +8 -1
  6. package/lib/check-update.js +56 -0
  7. package/lib/commands/custom.js +7 -4
  8. package/lib/commands/invoke.js +5 -4
  9. package/lib/configure-webpack.js +35 -5
  10. package/lib/copy-webpack-options.js +60 -20
  11. package/lib/env.js +99 -51
  12. package/lib/error-reporting.js +9 -3
  13. package/lib/mp/index.js +31 -16
  14. package/lib/options.js +6 -3
  15. package/lib/util.js +5 -6
  16. package/package.json +3 -3
  17. package/packages/@vue/component-compiler-utils/MODIFY.md +5 -0
  18. package/packages/@vue/component-compiler-utils/dist/compileStyle.js +11 -0
  19. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/API.md +873 -0
  20. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/CHANGELOG.md +466 -0
  21. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/LICENSE-MIT +22 -0
  22. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/README.md +49 -0
  23. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/index.js +26 -0
  24. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/parser.js +1088 -0
  25. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/processor.js +185 -0
  26. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/attribute.js +468 -0
  27. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/className.js +67 -0
  28. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/combinator.js +35 -0
  29. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/comment.js +35 -0
  30. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/constructors.js +91 -0
  31. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/container.js +392 -0
  32. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/guards.js +54 -0
  33. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/id.js +39 -0
  34. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/index.js +39 -0
  35. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/namespace.js +98 -0
  36. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/nesting.js +36 -0
  37. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/node.js +216 -0
  38. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/pseudo.js +40 -0
  39. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/root.js +60 -0
  40. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/selector.js +35 -0
  41. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/string.js +35 -0
  42. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/tag.js +35 -0
  43. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/types.js +15 -0
  44. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/universal.js +36 -0
  45. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/sortAscending.js +10 -0
  46. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenTypes.js +39 -0
  47. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenize.js +271 -0
  48. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/ensureObject.js +20 -0
  49. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/getProp.js +22 -0
  50. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/index.js +41 -0
  51. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/stripComments.js +21 -0
  52. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/unesc.js +18 -0
  53. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/package.json +76 -0
  54. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts +499 -0
  55. package/packages/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
  56. package/packages/@vue/devtools-api/lib/cjs/api/api.js +2 -0
  57. package/packages/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
  58. package/packages/@vue/devtools-api/lib/cjs/api/app.js +2 -0
  59. package/packages/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
  60. package/packages/@vue/devtools-api/lib/cjs/api/component.js +2 -0
  61. package/packages/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
  62. package/packages/@vue/devtools-api/lib/cjs/api/context.js +2 -0
  63. package/packages/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
  64. package/packages/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
  65. package/packages/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
  66. package/packages/@vue/devtools-api/lib/cjs/api/index.js +18 -0
  67. package/packages/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
  68. package/packages/@vue/devtools-api/lib/cjs/api/util.js +2 -0
  69. package/packages/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
  70. package/packages/@vue/devtools-api/lib/cjs/const.js +4 -0
  71. package/packages/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
  72. package/packages/@vue/devtools-api/lib/cjs/env.js +16 -0
  73. package/packages/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
  74. package/packages/@vue/devtools-api/lib/cjs/index.js +31 -0
  75. package/packages/@vue/devtools-api/lib/esm/api/api.js +0 -0
  76. package/packages/@vue/devtools-api/lib/esm/api/app.js +0 -0
  77. package/packages/@vue/devtools-api/lib/esm/api/component.js +0 -0
  78. package/packages/@vue/devtools-api/lib/esm/api/context.js +0 -0
  79. package/packages/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
  80. package/packages/@vue/devtools-api/lib/esm/api/index.js +6 -0
  81. package/packages/@vue/devtools-api/lib/esm/api/util.js +0 -0
  82. package/packages/@vue/devtools-api/lib/esm/const.js +1 -0
  83. package/packages/@vue/devtools-api/lib/esm/env.js +11 -0
  84. package/packages/@vue/devtools-api/lib/esm/index.js +17 -0
  85. package/packages/@vue/devtools-api/package.json +38 -0
  86. package/packages/app-vue-style-loader/lib/addStylesClient.js +1 -1
  87. package/packages/h5-vue-style-loader/lib/addStylesClient.js +1 -1
  88. package/packages/mp-vue/dist/mp.runtime.esm.js +3 -2
  89. package/packages/mp-vue/package.json +1 -0
  90. package/packages/uni-app/LICENSE +202 -0
  91. package/packages/uni-app/dist/uni-app.cjs.js +165 -0
  92. package/packages/uni-app/dist/uni-app.d.ts +61 -0
  93. package/packages/uni-app/dist/uni-app.es.js +108 -0
  94. package/packages/uni-app/package.json +22 -0
  95. package/packages/uni-cloud/dist/index.js +1 -1
  96. package/packages/uni-stat/dist/uni-stat.cjs.js +961 -0
  97. package/packages/uni-stat/dist/uni-stat.es.js +959 -0
  98. package/packages/uni-stat/lib/uni.plugin.js +68 -0
  99. package/packages/uni-stat/package.json +25 -0
  100. package/packages/vue3/node_modules/.yarn-integrity +27 -0
  101. package/packages/vue3/node_modules/@intlify/core-base/LICENSE +20 -0
  102. package/packages/vue3/node_modules/@intlify/core-base/README.md +7 -0
  103. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.js +989 -0
  104. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.prod.js +735 -0
  105. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.d.ts +576 -0
  106. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.js +2771 -0
  107. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.prod.js +6 -0
  108. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-bundler.js +965 -0
  109. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.js +2814 -0
  110. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.prod.js +6 -0
  111. package/packages/vue3/node_modules/@intlify/core-base/index.js +7 -0
  112. package/packages/vue3/node_modules/@intlify/core-base/package.json +59 -0
  113. package/packages/vue3/node_modules/@intlify/devtools-if/LICENSE +20 -0
  114. package/packages/vue3/node_modules/@intlify/devtools-if/README.md +13 -0
  115. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.js +15 -0
  116. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.prod.js +15 -0
  117. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.d.ts +43 -0
  118. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.esm-bundler.js +11 -0
  119. package/packages/vue3/node_modules/@intlify/devtools-if/index.js +7 -0
  120. package/packages/vue3/node_modules/@intlify/devtools-if/package.json +49 -0
  121. package/packages/vue3/node_modules/@intlify/message-compiler/LICENSE +20 -0
  122. package/packages/vue3/node_modules/@intlify/message-compiler/README.md +7 -0
  123. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.js +1400 -0
  124. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.prod.js +1395 -0
  125. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.d.ts +197 -0
  126. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.js +1348 -0
  127. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.prod.js +6 -0
  128. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js +1329 -0
  129. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.js +1365 -0
  130. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.prod.js +6 -0
  131. package/packages/vue3/node_modules/@intlify/message-compiler/index.js +7 -0
  132. package/packages/vue3/node_modules/@intlify/message-compiler/package.json +56 -0
  133. package/packages/vue3/node_modules/@intlify/message-resolver/LICENSE +20 -0
  134. package/packages/vue3/node_modules/@intlify/message-resolver/README.md +7 -0
  135. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.js +302 -0
  136. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.prod.js +302 -0
  137. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.d.ts +21 -0
  138. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.esm-bundler.js +297 -0
  139. package/packages/vue3/node_modules/@intlify/message-resolver/index.js +7 -0
  140. package/packages/vue3/node_modules/@intlify/message-resolver/package.json +46 -0
  141. package/packages/vue3/node_modules/@intlify/runtime/LICENSE +20 -0
  142. package/packages/vue3/node_modules/@intlify/runtime/README.md +7 -0
  143. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.js +116 -0
  144. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.prod.js +116 -0
  145. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.d.ts +95 -0
  146. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.esm-bundler.js +111 -0
  147. package/packages/vue3/node_modules/@intlify/runtime/index.js +7 -0
  148. package/packages/vue3/node_modules/@intlify/runtime/package.json +51 -0
  149. package/packages/vue3/node_modules/@intlify/shared/LICENSE +20 -0
  150. package/packages/vue3/node_modules/@intlify/shared/README.md +18 -0
  151. package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.js +222 -0
  152. package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.prod.js +209 -0
  153. package/packages/vue3/node_modules/@intlify/shared/dist/shared.d.ts +145 -0
  154. package/packages/vue3/node_modules/@intlify/shared/dist/shared.esm-bundler.js +192 -0
  155. package/packages/vue3/node_modules/@intlify/shared/index.js +7 -0
  156. package/packages/vue3/node_modules/@intlify/shared/package.json +46 -0
  157. package/packages/vue3/node_modules/@intlify/vue-devtools/LICENSE +20 -0
  158. package/packages/vue3/node_modules/@intlify/vue-devtools/README.md +7 -0
  159. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.js +24 -0
  160. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.prod.js +24 -0
  161. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.d.ts +81 -0
  162. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.esm-bundler.js +18 -0
  163. package/packages/vue3/node_modules/@intlify/vue-devtools/index.js +7 -0
  164. package/packages/vue3/node_modules/@intlify/vue-devtools/package.json +51 -0
  165. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
  166. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.js +2 -0
  167. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
  168. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.js +2 -0
  169. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
  170. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.js +2 -0
  171. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
  172. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.js +2 -0
  173. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
  174. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
  175. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
  176. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.js +18 -0
  177. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
  178. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.js +2 -0
  179. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
  180. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.js +4 -0
  181. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
  182. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.js +16 -0
  183. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
  184. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.js +31 -0
  185. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/api.js +0 -0
  186. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/app.js +0 -0
  187. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/component.js +0 -0
  188. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/context.js +0 -0
  189. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
  190. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/index.js +6 -0
  191. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/util.js +0 -0
  192. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/const.js +1 -0
  193. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/env.js +11 -0
  194. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/index.js +17 -0
  195. package/packages/vue3/node_modules/@vue/devtools-api/package.json +38 -0
  196. package/packages/vue3/node_modules/source-map/CHANGELOG.md +301 -0
  197. package/packages/vue3/node_modules/source-map/LICENSE +28 -0
  198. package/packages/vue3/node_modules/source-map/README.md +742 -0
  199. package/packages/vue3/node_modules/source-map/dist/source-map.debug.js +3234 -0
  200. package/packages/vue3/node_modules/source-map/dist/source-map.js +3233 -0
  201. package/packages/vue3/node_modules/source-map/dist/source-map.min.js +2 -0
  202. package/packages/vue3/node_modules/source-map/dist/source-map.min.js.map +1 -0
  203. package/packages/vue3/node_modules/source-map/lib/array-set.js +121 -0
  204. package/packages/vue3/node_modules/source-map/lib/base64-vlq.js +140 -0
  205. package/packages/vue3/node_modules/source-map/lib/base64.js +67 -0
  206. package/packages/vue3/node_modules/source-map/lib/binary-search.js +111 -0
  207. package/packages/vue3/node_modules/source-map/lib/mapping-list.js +79 -0
  208. package/packages/vue3/node_modules/source-map/lib/quick-sort.js +114 -0
  209. package/packages/vue3/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  210. package/packages/vue3/node_modules/source-map/lib/source-map-generator.js +425 -0
  211. package/packages/vue3/node_modules/source-map/lib/source-node.js +413 -0
  212. package/packages/vue3/node_modules/source-map/lib/util.js +488 -0
  213. package/packages/vue3/node_modules/source-map/package.json +73 -0
  214. package/packages/vue3/node_modules/source-map/source-map.d.ts +98 -0
  215. package/packages/vue3/node_modules/source-map/source-map.js +8 -0
  216. package/packages/vue3/node_modules/vue-i18n/LICENSE +20 -0
  217. package/packages/vue3/node_modules/vue-i18n/README.md +74 -0
  218. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.js +1801 -0
  219. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.prod.js +1685 -0
  220. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.d.ts +3302 -0
  221. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.js +5052 -0
  222. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.prod.js +6 -0
  223. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js +2226 -0
  224. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.js +5065 -0
  225. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.prod.js +6 -0
  226. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.js +3724 -0
  227. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.prod.js +6 -0
  228. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js +2224 -0
  229. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.js +3737 -0
  230. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.prod.js +6 -0
  231. package/packages/vue3/node_modules/vue-i18n/index.js +7 -0
  232. package/packages/vue3/node_modules/vue-i18n/package.json +69 -0
  233. package/packages/vue3/node_modules/vue-i18n/vetur/attributes.json +62 -0
  234. package/packages/vue3/node_modules/vue-i18n/vetur/tags.json +14 -0
  235. package/packages/vue3/package.json +15 -0
  236. package/packages/vue3/yarn.lock +79 -0
  237. package/packages/vuex/CHANGELOG.md +604 -0
  238. package/packages/vuex/LICENSE +21 -0
  239. package/packages/vuex/README.md +55 -0
  240. package/packages/vuex/dist/vuex.cjs.js +1474 -0
  241. package/packages/vuex/dist/vuex.esm-browser.js +1472 -0
  242. package/packages/vuex/dist/vuex.esm-browser.prod.js +1307 -0
  243. package/packages/vuex/dist/vuex.esm-bundler.js +1473 -0
  244. package/packages/vuex/dist/vuex.global.js +1499 -0
  245. package/packages/vuex/dist/vuex.global.prod.js +6 -0
  246. package/packages/vuex/dist/vuex.mjs +32 -0
  247. package/packages/vuex/package.json +99 -0
  248. package/packages/vuex/types/helpers.d.ts +86 -0
  249. package/packages/vuex/types/index.d.ts +167 -0
  250. package/packages/vuex/types/logger.d.ts +20 -0
  251. package/packages/vuex/types/vue.d.ts +12 -0
  252. package/packages/vuex3/CHANGELOG.md +356 -0
  253. package/packages/vuex3/LICENSE +21 -0
  254. package/packages/vuex3/README.md +59 -0
  255. package/packages/vuex3/dist/logger.js +155 -0
  256. package/packages/vuex3/dist/vuex.common.js +1244 -0
  257. package/packages/vuex3/dist/vuex.esm.browser.js +1200 -0
  258. package/packages/vuex3/dist/vuex.esm.browser.min.js +6 -0
  259. package/packages/vuex3/dist/vuex.esm.js +1243 -0
  260. package/packages/vuex3/dist/vuex.js +1250 -0
  261. package/packages/vuex3/dist/vuex.min.js +6 -0
  262. package/packages/vuex3/dist/vuex.mjs +26 -0
  263. package/packages/vuex3/package.json +96 -0
  264. package/packages/vuex3/types/helpers.d.ts +86 -0
  265. package/packages/vuex3/types/index.d.ts +164 -0
  266. package/packages/vuex3/types/logger.d.ts +20 -0
  267. package/packages/vuex3/types/vue.d.ts +18 -0
  268. package/packages/webpack-uni-app-loader/plugin/index.js +8 -2
  269. package/packages/webpack-uni-app-loader/view/main.js +12 -0
@@ -0,0 +1,302 @@
1
+ /*!
2
+ * @intlify/message-resolver v9.1.7
3
+ * (c) 2021 kazuya kawaguchi
4
+ * Released under the MIT License.
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ /**
11
+ * Original Utilities
12
+ * written by kazuya kawaguchi
13
+ */
14
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
15
+ function hasOwn(obj, key) {
16
+ return hasOwnProperty.call(obj, key);
17
+ }
18
+ const isObject = (val) => // eslint-disable-line
19
+ val !== null && typeof val === 'object';
20
+
21
+ const pathStateMachine = [];
22
+ pathStateMachine[0 /* BEFORE_PATH */] = {
23
+ ["w" /* WORKSPACE */]: [0 /* BEFORE_PATH */],
24
+ ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
25
+ ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
26
+ ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
27
+ };
28
+ pathStateMachine[1 /* IN_PATH */] = {
29
+ ["w" /* WORKSPACE */]: [1 /* IN_PATH */],
30
+ ["." /* DOT */]: [2 /* BEFORE_IDENT */],
31
+ ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
32
+ ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
33
+ };
34
+ pathStateMachine[2 /* BEFORE_IDENT */] = {
35
+ ["w" /* WORKSPACE */]: [2 /* BEFORE_IDENT */],
36
+ ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
37
+ ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */]
38
+ };
39
+ pathStateMachine[3 /* IN_IDENT */] = {
40
+ ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
41
+ ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */],
42
+ ["w" /* WORKSPACE */]: [1 /* IN_PATH */, 1 /* PUSH */],
43
+ ["." /* DOT */]: [2 /* BEFORE_IDENT */, 1 /* PUSH */],
44
+ ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */, 1 /* PUSH */],
45
+ ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */, 1 /* PUSH */]
46
+ };
47
+ pathStateMachine[4 /* IN_SUB_PATH */] = {
48
+ ["'" /* SINGLE_QUOTE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */],
49
+ ["\"" /* DOUBLE_QUOTE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */],
50
+ ["[" /* LEFT_BRACKET */]: [
51
+ 4 /* IN_SUB_PATH */,
52
+ 2 /* INC_SUB_PATH_DEPTH */
53
+ ],
54
+ ["]" /* RIGHT_BRACKET */]: [1 /* IN_PATH */, 3 /* PUSH_SUB_PATH */],
55
+ ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
56
+ ["l" /* ELSE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */]
57
+ };
58
+ pathStateMachine[5 /* IN_SINGLE_QUOTE */] = {
59
+ ["'" /* SINGLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
60
+ ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
61
+ ["l" /* ELSE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */]
62
+ };
63
+ pathStateMachine[6 /* IN_DOUBLE_QUOTE */] = {
64
+ ["\"" /* DOUBLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
65
+ ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
66
+ ["l" /* ELSE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */]
67
+ };
68
+ /**
69
+ * Check if an expression is a literal value.
70
+ */
71
+ const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
72
+ function isLiteral(exp) {
73
+ return literalValueRE.test(exp);
74
+ }
75
+ /**
76
+ * Strip quotes from a string
77
+ */
78
+ function stripQuotes(str) {
79
+ const a = str.charCodeAt(0);
80
+ const b = str.charCodeAt(str.length - 1);
81
+ return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;
82
+ }
83
+ /**
84
+ * Determine the type of a character in a keypath.
85
+ */
86
+ function getPathCharType(ch) {
87
+ if (ch === undefined || ch === null) {
88
+ return "o" /* END_OF_FAIL */;
89
+ }
90
+ const code = ch.charCodeAt(0);
91
+ switch (code) {
92
+ case 0x5b: // [
93
+ case 0x5d: // ]
94
+ case 0x2e: // .
95
+ case 0x22: // "
96
+ case 0x27: // '
97
+ return ch;
98
+ case 0x5f: // _
99
+ case 0x24: // $
100
+ case 0x2d: // -
101
+ return "i" /* IDENT */;
102
+ case 0x09: // Tab (HT)
103
+ case 0x0a: // Newline (LF)
104
+ case 0x0d: // Return (CR)
105
+ case 0xa0: // No-break space (NBSP)
106
+ case 0xfeff: // Byte Order Mark (BOM)
107
+ case 0x2028: // Line Separator (LS)
108
+ case 0x2029: // Paragraph Separator (PS)
109
+ return "w" /* WORKSPACE */;
110
+ }
111
+ return "i" /* IDENT */;
112
+ }
113
+ /**
114
+ * Format a subPath, return its plain form if it is
115
+ * a literal string or number. Otherwise prepend the
116
+ * dynamic indicator (*).
117
+ */
118
+ function formatSubPath(path) {
119
+ const trimmed = path.trim();
120
+ // invalid leading 0
121
+ if (path.charAt(0) === '0' && isNaN(parseInt(path))) {
122
+ return false;
123
+ }
124
+ return isLiteral(trimmed)
125
+ ? stripQuotes(trimmed)
126
+ : "*" /* ASTARISK */ + trimmed;
127
+ }
128
+ /**
129
+ * Parse a string path into an array of segments
130
+ */
131
+ function parse(path) {
132
+ const keys = [];
133
+ let index = -1;
134
+ let mode = 0 /* BEFORE_PATH */;
135
+ let subPathDepth = 0;
136
+ let c;
137
+ let key; // eslint-disable-line
138
+ let newChar;
139
+ let type;
140
+ let transition;
141
+ let action;
142
+ let typeMap;
143
+ const actions = [];
144
+ actions[0 /* APPEND */] = () => {
145
+ if (key === undefined) {
146
+ key = newChar;
147
+ }
148
+ else {
149
+ key += newChar;
150
+ }
151
+ };
152
+ actions[1 /* PUSH */] = () => {
153
+ if (key !== undefined) {
154
+ keys.push(key);
155
+ key = undefined;
156
+ }
157
+ };
158
+ actions[2 /* INC_SUB_PATH_DEPTH */] = () => {
159
+ actions[0 /* APPEND */]();
160
+ subPathDepth++;
161
+ };
162
+ actions[3 /* PUSH_SUB_PATH */] = () => {
163
+ if (subPathDepth > 0) {
164
+ subPathDepth--;
165
+ mode = 4 /* IN_SUB_PATH */;
166
+ actions[0 /* APPEND */]();
167
+ }
168
+ else {
169
+ subPathDepth = 0;
170
+ if (key === undefined) {
171
+ return false;
172
+ }
173
+ key = formatSubPath(key);
174
+ if (key === false) {
175
+ return false;
176
+ }
177
+ else {
178
+ actions[1 /* PUSH */]();
179
+ }
180
+ }
181
+ };
182
+ function maybeUnescapeQuote() {
183
+ const nextChar = path[index + 1];
184
+ if ((mode === 5 /* IN_SINGLE_QUOTE */ &&
185
+ nextChar === "'" /* SINGLE_QUOTE */) ||
186
+ (mode === 6 /* IN_DOUBLE_QUOTE */ &&
187
+ nextChar === "\"" /* DOUBLE_QUOTE */)) {
188
+ index++;
189
+ newChar = '\\' + nextChar;
190
+ actions[0 /* APPEND */]();
191
+ return true;
192
+ }
193
+ }
194
+ while (mode !== null) {
195
+ index++;
196
+ c = path[index];
197
+ if (c === '\\' && maybeUnescapeQuote()) {
198
+ continue;
199
+ }
200
+ type = getPathCharType(c);
201
+ typeMap = pathStateMachine[mode];
202
+ transition = typeMap[type] || typeMap["l" /* ELSE */] || 8 /* ERROR */;
203
+ // check parse error
204
+ if (transition === 8 /* ERROR */) {
205
+ return;
206
+ }
207
+ mode = transition[0];
208
+ if (transition[1] !== undefined) {
209
+ action = actions[transition[1]];
210
+ if (action) {
211
+ newChar = c;
212
+ if (action() === false) {
213
+ return;
214
+ }
215
+ }
216
+ }
217
+ // check parse finish
218
+ if (mode === 7 /* AFTER_PATH */) {
219
+ return keys;
220
+ }
221
+ }
222
+ }
223
+ // path token cache
224
+ const cache = new Map();
225
+ function resolveValue(obj, path) {
226
+ // check object
227
+ if (!isObject(obj)) {
228
+ return null;
229
+ }
230
+ // parse path
231
+ let hit = cache.get(path);
232
+ if (!hit) {
233
+ hit = parse(path);
234
+ if (hit) {
235
+ cache.set(path, hit);
236
+ }
237
+ }
238
+ // check hit
239
+ if (!hit) {
240
+ return null;
241
+ }
242
+ // resolve path value
243
+ const len = hit.length;
244
+ let last = obj;
245
+ let i = 0;
246
+ while (i < len) {
247
+ const val = last[hit[i]];
248
+ if (val === undefined) {
249
+ return null;
250
+ }
251
+ last = val;
252
+ i++;
253
+ }
254
+ return last;
255
+ }
256
+ /**
257
+ * Transform flat json in obj to normal json in obj
258
+ */
259
+ function handleFlatJson(obj) {
260
+ // check obj
261
+ if (!isObject(obj)) {
262
+ return obj;
263
+ }
264
+ for (const key in obj) {
265
+ // check key
266
+ if (!hasOwn(obj, key)) {
267
+ continue;
268
+ }
269
+ // handle for normal json
270
+ if (!key.includes("." /* DOT */)) {
271
+ // recursive process value if value is also a object
272
+ if (isObject(obj[key])) {
273
+ handleFlatJson(obj[key]);
274
+ }
275
+ }
276
+ // handle for flat json, transform to normal json
277
+ else {
278
+ // go to the last object
279
+ const subKeys = key.split("." /* DOT */);
280
+ const lastIndex = subKeys.length - 1;
281
+ let currentObj = obj;
282
+ for (let i = 0; i < lastIndex; i++) {
283
+ if (!(subKeys[i] in currentObj)) {
284
+ currentObj[subKeys[i]] = {};
285
+ }
286
+ currentObj = currentObj[subKeys[i]];
287
+ }
288
+ // update last object value, delete old property
289
+ currentObj[subKeys[lastIndex]] = obj[key];
290
+ delete obj[key];
291
+ // recursive process value if value is also a object
292
+ if (isObject(currentObj[subKeys[lastIndex]])) {
293
+ handleFlatJson(currentObj[subKeys[lastIndex]]);
294
+ }
295
+ }
296
+ }
297
+ return obj;
298
+ }
299
+
300
+ exports.handleFlatJson = handleFlatJson;
301
+ exports.parse = parse;
302
+ exports.resolveValue = resolveValue;
@@ -0,0 +1,21 @@
1
+
2
+ /**
3
+ * Transform flat json in obj to normal json in obj
4
+ */
5
+ export declare function handleFlatJson(obj: unknown): unknown;
6
+
7
+ /**
8
+ * Parse a string path into an array of segments
9
+ */
10
+ export declare function parse(path: Path): string[] | undefined;
11
+
12
+ /** @VueI18nGeneral */
13
+ export declare type Path = string;
14
+
15
+ export declare type PathValue = string | number | boolean | Function | null | {
16
+ [key: string]: PathValue;
17
+ } | PathValue[];
18
+
19
+ export declare function resolveValue(obj: unknown, path: Path): PathValue;
20
+
21
+ export { }
@@ -0,0 +1,297 @@
1
+ /*!
2
+ * @intlify/message-resolver v9.1.7
3
+ * (c) 2021 kazuya kawaguchi
4
+ * Released under the MIT License.
5
+ */
6
+ /**
7
+ * Original Utilities
8
+ * written by kazuya kawaguchi
9
+ */
10
+ if ((process.env.NODE_ENV !== 'production')) ;
11
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
12
+ function hasOwn(obj, key) {
13
+ return hasOwnProperty.call(obj, key);
14
+ }
15
+ const isObject = (val) => // eslint-disable-line
16
+ val !== null && typeof val === 'object';
17
+
18
+ const pathStateMachine = [];
19
+ pathStateMachine[0 /* BEFORE_PATH */] = {
20
+ ["w" /* WORKSPACE */]: [0 /* BEFORE_PATH */],
21
+ ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
22
+ ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
23
+ ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
24
+ };
25
+ pathStateMachine[1 /* IN_PATH */] = {
26
+ ["w" /* WORKSPACE */]: [1 /* IN_PATH */],
27
+ ["." /* DOT */]: [2 /* BEFORE_IDENT */],
28
+ ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
29
+ ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
30
+ };
31
+ pathStateMachine[2 /* BEFORE_IDENT */] = {
32
+ ["w" /* WORKSPACE */]: [2 /* BEFORE_IDENT */],
33
+ ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
34
+ ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */]
35
+ };
36
+ pathStateMachine[3 /* IN_IDENT */] = {
37
+ ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
38
+ ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */],
39
+ ["w" /* WORKSPACE */]: [1 /* IN_PATH */, 1 /* PUSH */],
40
+ ["." /* DOT */]: [2 /* BEFORE_IDENT */, 1 /* PUSH */],
41
+ ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */, 1 /* PUSH */],
42
+ ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */, 1 /* PUSH */]
43
+ };
44
+ pathStateMachine[4 /* IN_SUB_PATH */] = {
45
+ ["'" /* SINGLE_QUOTE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */],
46
+ ["\"" /* DOUBLE_QUOTE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */],
47
+ ["[" /* LEFT_BRACKET */]: [
48
+ 4 /* IN_SUB_PATH */,
49
+ 2 /* INC_SUB_PATH_DEPTH */
50
+ ],
51
+ ["]" /* RIGHT_BRACKET */]: [1 /* IN_PATH */, 3 /* PUSH_SUB_PATH */],
52
+ ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
53
+ ["l" /* ELSE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */]
54
+ };
55
+ pathStateMachine[5 /* IN_SINGLE_QUOTE */] = {
56
+ ["'" /* SINGLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
57
+ ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
58
+ ["l" /* ELSE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */]
59
+ };
60
+ pathStateMachine[6 /* IN_DOUBLE_QUOTE */] = {
61
+ ["\"" /* DOUBLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
62
+ ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
63
+ ["l" /* ELSE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */]
64
+ };
65
+ /**
66
+ * Check if an expression is a literal value.
67
+ */
68
+ const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
69
+ function isLiteral(exp) {
70
+ return literalValueRE.test(exp);
71
+ }
72
+ /**
73
+ * Strip quotes from a string
74
+ */
75
+ function stripQuotes(str) {
76
+ const a = str.charCodeAt(0);
77
+ const b = str.charCodeAt(str.length - 1);
78
+ return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;
79
+ }
80
+ /**
81
+ * Determine the type of a character in a keypath.
82
+ */
83
+ function getPathCharType(ch) {
84
+ if (ch === undefined || ch === null) {
85
+ return "o" /* END_OF_FAIL */;
86
+ }
87
+ const code = ch.charCodeAt(0);
88
+ switch (code) {
89
+ case 0x5b: // [
90
+ case 0x5d: // ]
91
+ case 0x2e: // .
92
+ case 0x22: // "
93
+ case 0x27: // '
94
+ return ch;
95
+ case 0x5f: // _
96
+ case 0x24: // $
97
+ case 0x2d: // -
98
+ return "i" /* IDENT */;
99
+ case 0x09: // Tab (HT)
100
+ case 0x0a: // Newline (LF)
101
+ case 0x0d: // Return (CR)
102
+ case 0xa0: // No-break space (NBSP)
103
+ case 0xfeff: // Byte Order Mark (BOM)
104
+ case 0x2028: // Line Separator (LS)
105
+ case 0x2029: // Paragraph Separator (PS)
106
+ return "w" /* WORKSPACE */;
107
+ }
108
+ return "i" /* IDENT */;
109
+ }
110
+ /**
111
+ * Format a subPath, return its plain form if it is
112
+ * a literal string or number. Otherwise prepend the
113
+ * dynamic indicator (*).
114
+ */
115
+ function formatSubPath(path) {
116
+ const trimmed = path.trim();
117
+ // invalid leading 0
118
+ if (path.charAt(0) === '0' && isNaN(parseInt(path))) {
119
+ return false;
120
+ }
121
+ return isLiteral(trimmed)
122
+ ? stripQuotes(trimmed)
123
+ : "*" /* ASTARISK */ + trimmed;
124
+ }
125
+ /**
126
+ * Parse a string path into an array of segments
127
+ */
128
+ function parse(path) {
129
+ const keys = [];
130
+ let index = -1;
131
+ let mode = 0 /* BEFORE_PATH */;
132
+ let subPathDepth = 0;
133
+ let c;
134
+ let key; // eslint-disable-line
135
+ let newChar;
136
+ let type;
137
+ let transition;
138
+ let action;
139
+ let typeMap;
140
+ const actions = [];
141
+ actions[0 /* APPEND */] = () => {
142
+ if (key === undefined) {
143
+ key = newChar;
144
+ }
145
+ else {
146
+ key += newChar;
147
+ }
148
+ };
149
+ actions[1 /* PUSH */] = () => {
150
+ if (key !== undefined) {
151
+ keys.push(key);
152
+ key = undefined;
153
+ }
154
+ };
155
+ actions[2 /* INC_SUB_PATH_DEPTH */] = () => {
156
+ actions[0 /* APPEND */]();
157
+ subPathDepth++;
158
+ };
159
+ actions[3 /* PUSH_SUB_PATH */] = () => {
160
+ if (subPathDepth > 0) {
161
+ subPathDepth--;
162
+ mode = 4 /* IN_SUB_PATH */;
163
+ actions[0 /* APPEND */]();
164
+ }
165
+ else {
166
+ subPathDepth = 0;
167
+ if (key === undefined) {
168
+ return false;
169
+ }
170
+ key = formatSubPath(key);
171
+ if (key === false) {
172
+ return false;
173
+ }
174
+ else {
175
+ actions[1 /* PUSH */]();
176
+ }
177
+ }
178
+ };
179
+ function maybeUnescapeQuote() {
180
+ const nextChar = path[index + 1];
181
+ if ((mode === 5 /* IN_SINGLE_QUOTE */ &&
182
+ nextChar === "'" /* SINGLE_QUOTE */) ||
183
+ (mode === 6 /* IN_DOUBLE_QUOTE */ &&
184
+ nextChar === "\"" /* DOUBLE_QUOTE */)) {
185
+ index++;
186
+ newChar = '\\' + nextChar;
187
+ actions[0 /* APPEND */]();
188
+ return true;
189
+ }
190
+ }
191
+ while (mode !== null) {
192
+ index++;
193
+ c = path[index];
194
+ if (c === '\\' && maybeUnescapeQuote()) {
195
+ continue;
196
+ }
197
+ type = getPathCharType(c);
198
+ typeMap = pathStateMachine[mode];
199
+ transition = typeMap[type] || typeMap["l" /* ELSE */] || 8 /* ERROR */;
200
+ // check parse error
201
+ if (transition === 8 /* ERROR */) {
202
+ return;
203
+ }
204
+ mode = transition[0];
205
+ if (transition[1] !== undefined) {
206
+ action = actions[transition[1]];
207
+ if (action) {
208
+ newChar = c;
209
+ if (action() === false) {
210
+ return;
211
+ }
212
+ }
213
+ }
214
+ // check parse finish
215
+ if (mode === 7 /* AFTER_PATH */) {
216
+ return keys;
217
+ }
218
+ }
219
+ }
220
+ // path token cache
221
+ const cache = new Map();
222
+ function resolveValue(obj, path) {
223
+ // check object
224
+ if (!isObject(obj)) {
225
+ return null;
226
+ }
227
+ // parse path
228
+ let hit = cache.get(path);
229
+ if (!hit) {
230
+ hit = parse(path);
231
+ if (hit) {
232
+ cache.set(path, hit);
233
+ }
234
+ }
235
+ // check hit
236
+ if (!hit) {
237
+ return null;
238
+ }
239
+ // resolve path value
240
+ const len = hit.length;
241
+ let last = obj;
242
+ let i = 0;
243
+ while (i < len) {
244
+ const val = last[hit[i]];
245
+ if (val === undefined) {
246
+ return null;
247
+ }
248
+ last = val;
249
+ i++;
250
+ }
251
+ return last;
252
+ }
253
+ /**
254
+ * Transform flat json in obj to normal json in obj
255
+ */
256
+ function handleFlatJson(obj) {
257
+ // check obj
258
+ if (!isObject(obj)) {
259
+ return obj;
260
+ }
261
+ for (const key in obj) {
262
+ // check key
263
+ if (!hasOwn(obj, key)) {
264
+ continue;
265
+ }
266
+ // handle for normal json
267
+ if (!key.includes("." /* DOT */)) {
268
+ // recursive process value if value is also a object
269
+ if (isObject(obj[key])) {
270
+ handleFlatJson(obj[key]);
271
+ }
272
+ }
273
+ // handle for flat json, transform to normal json
274
+ else {
275
+ // go to the last object
276
+ const subKeys = key.split("." /* DOT */);
277
+ const lastIndex = subKeys.length - 1;
278
+ let currentObj = obj;
279
+ for (let i = 0; i < lastIndex; i++) {
280
+ if (!(subKeys[i] in currentObj)) {
281
+ currentObj[subKeys[i]] = {};
282
+ }
283
+ currentObj = currentObj[subKeys[i]];
284
+ }
285
+ // update last object value, delete old property
286
+ currentObj[subKeys[lastIndex]] = obj[key];
287
+ delete obj[key];
288
+ // recursive process value if value is also a object
289
+ if (isObject(currentObj[subKeys[lastIndex]])) {
290
+ handleFlatJson(currentObj[subKeys[lastIndex]]);
291
+ }
292
+ }
293
+ }
294
+ return obj;
295
+ }
296
+
297
+ export { handleFlatJson, parse, resolveValue };
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./dist/message-resolver.cjs.prod.js')
5
+ } else {
6
+ module.exports = require('./dist/message-resolver.cjs.js')
7
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@intlify/message-resolver",
3
+ "version": "9.1.7",
4
+ "description": "@intlify/message-resolver",
5
+ "keywords": [
6
+ "i18n",
7
+ "internationalization",
8
+ "intlify",
9
+ "resolver"
10
+ ],
11
+ "license": "MIT",
12
+ "author": {
13
+ "name": "kazuya kawaguchi",
14
+ "email": "kawakazu80@gmail.com"
15
+ },
16
+ "homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/message-resolver#readme",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/intlify/vue-i18n-next.git",
20
+ "directory": "packages/message-resolver"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/intlify/vue-i18n-next/issues"
24
+ },
25
+ "files": [
26
+ "index.js",
27
+ "dist"
28
+ ],
29
+ "main": "index.js",
30
+ "module": "dist/message-resolver.esm-bundler.js",
31
+ "types": "dist/message-resolver.d.ts",
32
+ "engines": {
33
+ "node": ">= 10"
34
+ },
35
+ "buildOptions": {
36
+ "name": "IntlifyMessageResolver",
37
+ "formats": [
38
+ "esm-bundler",
39
+ "cjs"
40
+ ]
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "sideEffects": false
46
+ }
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 kazuya kawaguchi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.