@opra/common 0.15.0 → 0.16.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.
Files changed (284) hide show
  1. package/cjs/document/factory/import-resource-class.js +1 -0
  2. package/cjs/document/factory/import-type-class.js +9 -2
  3. package/cjs/document/resource/collection.js +9 -9
  4. package/cjs/document/resource/singleton.js +4 -4
  5. package/cjs/url/opra-url.js +7 -7
  6. package/esm/document/api-document.js +37 -33
  7. package/esm/document/constants.js +6 -3
  8. package/esm/document/data-type/api-field.js +15 -12
  9. package/esm/document/data-type/builtin/any.type.js +8 -5
  10. package/esm/document/data-type/builtin/base64.type.js +8 -5
  11. package/esm/document/data-type/builtin/bigint.type.js +8 -5
  12. package/esm/document/data-type/builtin/boolean.type.js +11 -8
  13. package/esm/document/data-type/builtin/date.type.js +10 -7
  14. package/esm/document/data-type/builtin/guid.type.js +12 -9
  15. package/esm/document/data-type/builtin/index.js +13 -10
  16. package/esm/document/data-type/builtin/integer.type.js +13 -10
  17. package/esm/document/data-type/builtin/number.type.js +10 -7
  18. package/esm/document/data-type/builtin/object.type.js +8 -5
  19. package/esm/document/data-type/builtin/string.type.js +11 -8
  20. package/esm/document/data-type/builtin/time.type.js +10 -7
  21. package/esm/document/data-type/builtin/timestamp.type.js +12 -9
  22. package/esm/document/data-type/complex-type.js +34 -30
  23. package/esm/document/data-type/data-type.js +12 -9
  24. package/esm/document/data-type/enum-type.js +19 -15
  25. package/esm/document/data-type/mapped-type.js +29 -24
  26. package/esm/document/data-type/simple-type.js +21 -17
  27. package/esm/document/data-type/union-type.js +29 -26
  28. package/esm/document/factory/add-references.js +7 -3
  29. package/esm/document/factory/create-document.js +16 -10
  30. package/esm/document/factory/factory.js +37 -33
  31. package/esm/document/factory/import-resource-class.js +22 -15
  32. package/esm/document/factory/import-type-class.js +43 -26
  33. package/esm/document/factory/index.js +4 -1
  34. package/esm/document/factory/process-resources.js +16 -10
  35. package/esm/document/factory/process-types.js +37 -31
  36. package/esm/document/index.js +17 -14
  37. package/esm/document/resource/collection.js +50 -46
  38. package/esm/document/resource/resource.js +12 -9
  39. package/esm/document/resource/singleton.js +29 -25
  40. package/esm/document/utils/inspect.util.js +7 -4
  41. package/esm/document/utils/string-compare.util.js +5 -1
  42. package/esm/exception/enums/issue-severity.enum.js +5 -2
  43. package/esm/exception/error-issue.js +2 -1
  44. package/esm/exception/http-errors/bad-request.error.js +8 -4
  45. package/esm/exception/http-errors/failed-dependency.error.js +8 -4
  46. package/esm/exception/http-errors/forbidden.error.js +8 -4
  47. package/esm/exception/http-errors/internal-server.error.js +8 -4
  48. package/esm/exception/http-errors/method-not-allowed.error.js +8 -4
  49. package/esm/exception/http-errors/not-acceptable.error.js +8 -4
  50. package/esm/exception/http-errors/not-found.error.js +8 -4
  51. package/esm/exception/http-errors/unauthorized.error.js +8 -4
  52. package/esm/exception/http-errors/unprocessable-entity.error.js +8 -4
  53. package/esm/exception/index.js +18 -15
  54. package/esm/exception/opra-exception.js +7 -3
  55. package/esm/exception/resource-errors/resource-conflict.error.js +8 -4
  56. package/esm/exception/resource-errors/resource-not-found.error.js +8 -4
  57. package/esm/exception/wrap-exception.js +24 -20
  58. package/esm/filter/antlr/OpraFilterLexer.js +9 -6
  59. package/esm/filter/antlr/OpraFilterListener.js +5 -2
  60. package/esm/filter/antlr/OpraFilterParser.js +126 -79
  61. package/esm/filter/antlr/OpraFilterVisitor.js +5 -2
  62. package/esm/filter/ast/abstract/ast.js +5 -1
  63. package/esm/filter/ast/abstract/expression.js +6 -2
  64. package/esm/filter/ast/abstract/literal.js +6 -2
  65. package/esm/filter/ast/abstract/term.js +6 -2
  66. package/esm/filter/ast/expressions/arithmetic-expression.js +8 -3
  67. package/esm/filter/ast/expressions/array-expression.js +6 -2
  68. package/esm/filter/ast/expressions/comparison-expression.js +6 -2
  69. package/esm/filter/ast/expressions/logical-expression.js +6 -2
  70. package/esm/filter/ast/expressions/parentheses-expression.js +6 -2
  71. package/esm/filter/ast/index.js +19 -16
  72. package/esm/filter/ast/terms/boolean-literal.js +6 -2
  73. package/esm/filter/ast/terms/date-literal.js +12 -8
  74. package/esm/filter/ast/terms/external-constant.js +6 -2
  75. package/esm/filter/ast/terms/null-literal.js +6 -2
  76. package/esm/filter/ast/terms/number-literal.js +8 -4
  77. package/esm/filter/ast/terms/qualified-identifier.js +6 -2
  78. package/esm/filter/ast/terms/string-literal.js +8 -4
  79. package/esm/filter/ast/terms/time-literal.js +10 -6
  80. package/esm/filter/build.js +69 -45
  81. package/esm/filter/errors.js +9 -3
  82. package/esm/filter/filter-tree-visitor.js +31 -26
  83. package/esm/filter/index.js +8 -5
  84. package/esm/filter/opra-error-listener.js +8 -4
  85. package/esm/filter/parse.js +19 -14
  86. package/esm/filter/utils.js +7 -2
  87. package/esm/helpers/function-utils.js +14 -8
  88. package/esm/helpers/get-stack-filename.js +5 -1
  89. package/esm/helpers/index.js +11 -8
  90. package/esm/helpers/is-url.js +5 -1
  91. package/esm/helpers/mixin-utils.js +7 -2
  92. package/esm/helpers/object-utils.js +12 -6
  93. package/esm/helpers/path-to-object-tree.js +5 -1
  94. package/esm/helpers/responsive-map.js +5 -1
  95. package/esm/helpers/type-guards.js +17 -7
  96. package/esm/http/codecs/boolean-codec.js +5 -1
  97. package/esm/http/codecs/date-codec.js +5 -1
  98. package/esm/http/codecs/filter-codec.js +9 -5
  99. package/esm/http/codecs/integer-codec.js +6 -2
  100. package/esm/http/codecs/number-codec.js +5 -1
  101. package/esm/http/codecs/string-codec.js +5 -1
  102. package/esm/http/enums/http-headers-codes.enum.js +5 -2
  103. package/esm/http/enums/http-status-codes.enum.js +5 -2
  104. package/esm/http/enums/http-status-messages.js +4 -1
  105. package/esm/http/http-headers.js +9 -5
  106. package/esm/http/http-message.host.js +18 -13
  107. package/esm/http/http-params.js +25 -20
  108. package/esm/http/http-request-message.js +22 -18
  109. package/esm/http/http-response-message.js +28 -23
  110. package/esm/http/index.js +17 -14
  111. package/esm/http/interfaces/client-http-headers.interface.js +2 -1
  112. package/esm/http/interfaces/cookie-options.interface.js +2 -1
  113. package/esm/http/interfaces/server-http-headers.interface.js +2 -1
  114. package/esm/i18n/i18n.js +28 -23
  115. package/esm/i18n/index.js +9 -5
  116. package/esm/i18n/string-utils.js +7 -2
  117. package/esm/i18n/translate.js +7 -3
  118. package/esm/index.js +16 -11
  119. package/esm/schema/constants.js +4 -1
  120. package/esm/schema/data-type/complex-type.interface.js +5 -2
  121. package/esm/schema/data-type/data-type.interface.js +2 -1
  122. package/esm/schema/data-type/enum-type.interface.js +5 -2
  123. package/esm/schema/data-type/field.interface.js +2 -1
  124. package/esm/schema/data-type/mapped-type.interface.js +5 -2
  125. package/esm/schema/data-type/simple-type.interface.js +5 -2
  126. package/esm/schema/data-type/union-type.interface.js +5 -2
  127. package/esm/schema/document.interface.js +2 -1
  128. package/esm/schema/index.js +34 -31
  129. package/esm/schema/resource/collection.interface.js +5 -2
  130. package/esm/schema/resource/container.interface.js +5 -2
  131. package/esm/schema/resource/endpoint.interface.js +2 -1
  132. package/esm/schema/resource/resource.interface.js +2 -1
  133. package/esm/schema/resource/singleton.interface.js +5 -2
  134. package/esm/schema/type-guards.js +53 -40
  135. package/esm/types.js +2 -1
  136. package/esm/url/index.js +8 -5
  137. package/esm/url/opra-url-path-component.js +7 -3
  138. package/esm/url/opra-url-path.js +18 -14
  139. package/esm/url/opra-url.js +25 -21
  140. package/esm/url/utils/decode-path-component.js +8 -4
  141. package/esm/url/utils/encode-path-component.js +8 -3
  142. package/esm/utils/path-utils.js +7 -2
  143. package/package.json +5 -4
  144. package/{esm → types}/document/factory/import-resource-class.d.ts +1 -0
  145. package/{esm → types}/document/resource/collection.d.ts +10 -10
  146. package/{esm → types}/document/resource/singleton.d.ts +4 -4
  147. package/{esm → types}/schema/resource/collection.interface.d.ts +6 -6
  148. package/{esm → types}/url/opra-url.d.ts +3 -3
  149. package/{esm → types}/document/api-document.d.ts +0 -0
  150. package/{esm → types}/document/constants.d.ts +0 -0
  151. package/{esm → types}/document/data-type/api-field.d.ts +0 -0
  152. package/{esm → types}/document/data-type/builtin/any.type.d.ts +0 -0
  153. package/{esm → types}/document/data-type/builtin/base64.type.d.ts +0 -0
  154. package/{esm → types}/document/data-type/builtin/bigint.type.d.ts +0 -0
  155. package/{esm → types}/document/data-type/builtin/boolean.type.d.ts +0 -0
  156. package/{esm → types}/document/data-type/builtin/date.type.d.ts +0 -0
  157. package/{esm → types}/document/data-type/builtin/guid.type.d.ts +0 -0
  158. package/{esm → types}/document/data-type/builtin/index.d.ts +0 -0
  159. package/{esm → types}/document/data-type/builtin/integer.type.d.ts +0 -0
  160. package/{esm → types}/document/data-type/builtin/number.type.d.ts +0 -0
  161. package/{esm → types}/document/data-type/builtin/object.type.d.ts +0 -0
  162. package/{esm → types}/document/data-type/builtin/string.type.d.ts +0 -0
  163. package/{esm → types}/document/data-type/builtin/time.type.d.ts +0 -0
  164. package/{esm → types}/document/data-type/builtin/timestamp.type.d.ts +0 -0
  165. package/{esm → types}/document/data-type/complex-type.d.ts +0 -0
  166. package/{esm → types}/document/data-type/data-type.d.ts +0 -0
  167. package/{esm → types}/document/data-type/enum-type.d.ts +0 -0
  168. package/{esm → types}/document/data-type/mapped-type.d.ts +0 -0
  169. package/{esm → types}/document/data-type/simple-type.d.ts +0 -0
  170. package/{esm → types}/document/data-type/union-type.d.ts +0 -0
  171. package/{esm → types}/document/factory/add-references.d.ts +0 -0
  172. package/{esm → types}/document/factory/create-document.d.ts +0 -0
  173. package/{esm → types}/document/factory/factory.d.ts +0 -0
  174. package/{esm → types}/document/factory/import-type-class.d.ts +0 -0
  175. package/{esm → types}/document/factory/index.d.ts +0 -0
  176. package/{esm → types}/document/factory/process-resources.d.ts +0 -0
  177. package/{esm → types}/document/factory/process-types.d.ts +0 -0
  178. package/{esm → types}/document/index.d.ts +0 -0
  179. package/{esm → types}/document/resource/resource.d.ts +0 -0
  180. package/{esm → types}/document/utils/inspect.util.d.ts +0 -0
  181. package/{esm → types}/document/utils/string-compare.util.d.ts +0 -0
  182. package/{esm → types}/exception/enums/issue-severity.enum.d.ts +0 -0
  183. package/{esm → types}/exception/error-issue.d.ts +0 -0
  184. package/{esm → types}/exception/http-errors/bad-request.error.d.ts +0 -0
  185. package/{esm → types}/exception/http-errors/failed-dependency.error.d.ts +0 -0
  186. package/{esm → types}/exception/http-errors/forbidden.error.d.ts +0 -0
  187. package/{esm → types}/exception/http-errors/internal-server.error.d.ts +0 -0
  188. package/{esm → types}/exception/http-errors/method-not-allowed.error.d.ts +0 -0
  189. package/{esm → types}/exception/http-errors/not-acceptable.error.d.ts +0 -0
  190. package/{esm → types}/exception/http-errors/not-found.error.d.ts +0 -0
  191. package/{esm → types}/exception/http-errors/unauthorized.error.d.ts +0 -0
  192. package/{esm → types}/exception/http-errors/unprocessable-entity.error.d.ts +0 -0
  193. package/{esm → types}/exception/index.d.ts +0 -0
  194. package/{esm → types}/exception/opra-exception.d.ts +0 -0
  195. package/{esm → types}/exception/resource-errors/resource-conflict.error.d.ts +0 -0
  196. package/{esm → types}/exception/resource-errors/resource-not-found.error.d.ts +0 -0
  197. package/{esm → types}/exception/wrap-exception.d.ts +0 -0
  198. package/{esm → types}/filter/antlr/OpraFilterLexer.d.ts +0 -0
  199. package/{esm → types}/filter/antlr/OpraFilterListener.d.ts +0 -0
  200. package/{esm → types}/filter/antlr/OpraFilterParser.d.ts +0 -0
  201. package/{esm → types}/filter/antlr/OpraFilterVisitor.d.ts +0 -0
  202. package/{esm → types}/filter/ast/abstract/ast.d.ts +0 -0
  203. package/{esm → types}/filter/ast/abstract/expression.d.ts +0 -0
  204. package/{esm → types}/filter/ast/abstract/literal.d.ts +0 -0
  205. package/{esm → types}/filter/ast/abstract/term.d.ts +0 -0
  206. package/{esm → types}/filter/ast/expressions/arithmetic-expression.d.ts +0 -0
  207. package/{esm → types}/filter/ast/expressions/array-expression.d.ts +0 -0
  208. package/{esm → types}/filter/ast/expressions/comparison-expression.d.ts +0 -0
  209. package/{esm → types}/filter/ast/expressions/logical-expression.d.ts +0 -0
  210. package/{esm → types}/filter/ast/expressions/parentheses-expression.d.ts +0 -0
  211. package/{esm → types}/filter/ast/index.d.ts +0 -0
  212. package/{esm → types}/filter/ast/terms/boolean-literal.d.ts +0 -0
  213. package/{esm → types}/filter/ast/terms/date-literal.d.ts +0 -0
  214. package/{esm → types}/filter/ast/terms/external-constant.d.ts +0 -0
  215. package/{esm → types}/filter/ast/terms/null-literal.d.ts +0 -0
  216. package/{esm → types}/filter/ast/terms/number-literal.d.ts +0 -0
  217. package/{esm → types}/filter/ast/terms/qualified-identifier.d.ts +0 -0
  218. package/{esm → types}/filter/ast/terms/string-literal.d.ts +0 -0
  219. package/{esm → types}/filter/ast/terms/time-literal.d.ts +0 -0
  220. package/{esm → types}/filter/build.d.ts +0 -0
  221. package/{esm → types}/filter/errors.d.ts +0 -0
  222. package/{esm → types}/filter/filter-tree-visitor.d.ts +0 -0
  223. package/{esm → types}/filter/index.d.ts +0 -0
  224. package/{esm → types}/filter/opra-error-listener.d.ts +0 -0
  225. package/{esm → types}/filter/parse.d.ts +0 -0
  226. package/{esm → types}/filter/utils.d.ts +0 -0
  227. package/{esm → types}/helpers/function-utils.d.ts +0 -0
  228. package/{esm → types}/helpers/get-stack-filename.d.ts +0 -0
  229. package/{esm → types}/helpers/index.d.ts +0 -0
  230. package/{esm → types}/helpers/is-url.d.ts +0 -0
  231. package/{esm → types}/helpers/mixin-utils.d.ts +0 -0
  232. package/{esm → types}/helpers/object-utils.d.ts +0 -0
  233. package/{esm → types}/helpers/path-to-object-tree.d.ts +0 -0
  234. package/{esm → types}/helpers/responsive-map.d.ts +0 -0
  235. package/{esm → types}/helpers/type-guards.d.ts +0 -0
  236. package/{esm → types}/http/codecs/boolean-codec.d.ts +0 -0
  237. package/{esm → types}/http/codecs/date-codec.d.ts +0 -0
  238. package/{esm → types}/http/codecs/filter-codec.d.ts +0 -0
  239. package/{esm → types}/http/codecs/integer-codec.d.ts +0 -0
  240. package/{esm → types}/http/codecs/number-codec.d.ts +0 -0
  241. package/{esm → types}/http/codecs/string-codec.d.ts +0 -0
  242. package/{esm → types}/http/enums/http-headers-codes.enum.d.ts +0 -0
  243. package/{esm → types}/http/enums/http-status-codes.enum.d.ts +0 -0
  244. package/{esm → types}/http/enums/http-status-messages.d.ts +0 -0
  245. package/{esm → types}/http/http-headers.d.ts +0 -0
  246. package/{esm → types}/http/http-message.host.d.ts +0 -0
  247. package/{esm → types}/http/http-params.d.ts +0 -0
  248. package/{esm → types}/http/http-request-message.d.ts +0 -0
  249. package/{esm → types}/http/http-response-message.d.ts +0 -0
  250. package/{esm → types}/http/index.d.ts +0 -0
  251. package/{esm → types}/http/interfaces/client-http-headers.interface.d.ts +0 -0
  252. package/{esm → types}/http/interfaces/cookie-options.interface.d.ts +0 -0
  253. package/{esm → types}/http/interfaces/server-http-headers.interface.d.ts +0 -0
  254. package/{esm → types}/http/multipart/batch-multipart.d.ts +0 -0
  255. package/{esm → types}/http/multipart/http-request-content.d.ts +0 -0
  256. package/{esm → types}/http/multipart/http-response-content.d.ts +0 -0
  257. package/{esm → types}/http/multipart/index.d.ts +0 -0
  258. package/{esm → types}/i18n/i18n.d.ts +0 -0
  259. package/{esm → types}/i18n/index.d.ts +0 -0
  260. package/{esm → types}/i18n/string-utils.d.ts +0 -0
  261. package/{esm → types}/i18n/translate.d.ts +0 -0
  262. package/{esm → types}/index.d.ts +0 -0
  263. package/{esm → types}/schema/constants.d.ts +0 -0
  264. package/{esm → types}/schema/data-type/complex-type.interface.d.ts +0 -0
  265. package/{esm → types}/schema/data-type/data-type.interface.d.ts +0 -0
  266. package/{esm → types}/schema/data-type/enum-type.interface.d.ts +0 -0
  267. package/{esm → types}/schema/data-type/field.interface.d.ts +0 -0
  268. package/{esm → types}/schema/data-type/mapped-type.interface.d.ts +0 -0
  269. package/{esm → types}/schema/data-type/simple-type.interface.d.ts +0 -0
  270. package/{esm → types}/schema/data-type/union-type.interface.d.ts +0 -0
  271. package/{esm → types}/schema/document.interface.d.ts +0 -0
  272. package/{esm → types}/schema/index.d.ts +0 -0
  273. package/{esm → types}/schema/resource/container.interface.d.ts +0 -0
  274. package/{esm → types}/schema/resource/endpoint.interface.d.ts +0 -0
  275. package/{esm → types}/schema/resource/resource.interface.d.ts +0 -0
  276. package/{esm → types}/schema/resource/singleton.interface.d.ts +2 -2
  277. /package/{esm → types}/schema/type-guards.d.ts +0 -0
  278. /package/{esm → types}/types.d.ts +0 -0
  279. /package/{esm → types}/url/index.d.ts +0 -0
  280. /package/{esm → types}/url/opra-url-path-component.d.ts +0 -0
  281. /package/{esm → types}/url/opra-url-path.d.ts +0 -0
  282. /package/{esm → types}/url/utils/decode-path-component.d.ts +0 -0
  283. /package/{esm → types}/url/utils/encode-path-component.d.ts +0 -0
  284. /package/{esm → types}/utils/path-utils.d.ts +0 -0
package/esm/index.js CHANGED
@@ -1,11 +1,16 @@
1
- export * from './types.js';
2
- export * from './document/index.js';
3
- export * from './exception/index.js';
4
- export * from './filter/index.js'; // todo review
5
- export * from './helpers/index.js';
6
- export * from './http/index.js';
7
- export * from './i18n/index.js';
8
- export * from './schema/index.js';
9
- export * from './url/index.js';
10
- export * from './utils/path-utils.js';
11
- export { uid } from 'uid';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uid = void 0;
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./types.js"), exports);
6
+ tslib_1.__exportStar(require("./document/index.js"), exports);
7
+ tslib_1.__exportStar(require("./exception/index.js"), exports);
8
+ tslib_1.__exportStar(require("./filter/index.js"), exports); // todo review
9
+ tslib_1.__exportStar(require("./helpers/index.js"), exports);
10
+ tslib_1.__exportStar(require("./http/index.js"), exports);
11
+ tslib_1.__exportStar(require("./i18n/index.js"), exports);
12
+ tslib_1.__exportStar(require("./schema/index.js"), exports);
13
+ tslib_1.__exportStar(require("./url/index.js"), exports);
14
+ tslib_1.__exportStar(require("./utils/path-utils.js"), exports);
15
+ var uid_1 = require("uid");
16
+ Object.defineProperty(exports, "uid", { enumerable: true, get: function () { return uid_1.uid; } });
@@ -1 +1,4 @@
1
- export const SpecVersion = '1.0';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpecVersion = void 0;
4
+ exports.SpecVersion = '1.0';
@@ -1,4 +1,7 @@
1
- export var ComplexType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComplexType = void 0;
4
+ var ComplexType;
2
5
  (function (ComplexType) {
3
6
  ComplexType.Kind = 'ComplexType';
4
- })(ComplexType || (ComplexType = {}));
7
+ })(ComplexType = exports.ComplexType || (exports.ComplexType = {}));
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,7 @@
1
- export var EnumType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnumType = void 0;
4
+ var EnumType;
2
5
  (function (EnumType) {
3
6
  EnumType.Kind = 'EnumType';
4
- })(EnumType || (EnumType = {}));
7
+ })(EnumType = exports.EnumType || (exports.EnumType = {}));
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,7 @@
1
- export var MappedType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MappedType = void 0;
4
+ var MappedType;
2
5
  (function (MappedType) {
3
6
  MappedType.Kind = 'MappedType';
4
- })(MappedType || (MappedType = {}));
7
+ })(MappedType = exports.MappedType || (exports.MappedType = {}));
@@ -1,4 +1,7 @@
1
- export var SimpleType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimpleType = void 0;
4
+ var SimpleType;
2
5
  (function (SimpleType) {
3
6
  SimpleType.Kind = 'SimpleType';
4
- })(SimpleType || (SimpleType = {}));
7
+ })(SimpleType = exports.SimpleType || (exports.SimpleType = {}));
@@ -1,4 +1,7 @@
1
- export var UnionType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnionType = void 0;
4
+ var UnionType;
2
5
  (function (UnionType) {
3
6
  UnionType.Kind = 'UnionType';
4
- })(UnionType || (UnionType = {}));
7
+ })(UnionType = exports.UnionType || (exports.UnionType = {}));
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,41 +1,44 @@
1
- import { SpecVersion as _SpecVersion } from './constants.js';
2
- import { ComplexType as _ComplexType } from './data-type/complex-type.interface.js';
3
- import { EnumType as _EnumType } from './data-type/enum-type.interface.js';
4
- import { MappedType as _MappedType } from './data-type/mapped-type.interface.js';
5
- import { SimpleType as _SimpleType } from './data-type/simple-type.interface.js';
6
- import { UnionType as _UnionType } from './data-type/union-type.interface.js';
7
- import { Collection as _Collection } from './resource/collection.interface.js';
8
- import { Container as _Container } from './resource/container.interface.js';
9
- import { Singleton as _Singleton } from './resource/singleton.interface.js';
10
- import { isCollection as _isCollection, isComplexType as _isComplexType, isContainer as _isContainer, isDataType as _isDataType, isEnumType as _isEnumType, isMappedType as _isMappedType, isResource as _isResource, isSimpleType as _isSimpleType, isSingleton as _isSingleton, isUnionType as _isUnionType } from './type-guards.js';
11
- export var OpraSchema;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpraSchema = void 0;
4
+ const constants_js_1 = require("./constants.js");
5
+ const complex_type_interface_js_1 = require("./data-type/complex-type.interface.js");
6
+ const enum_type_interface_js_1 = require("./data-type/enum-type.interface.js");
7
+ const mapped_type_interface_js_1 = require("./data-type/mapped-type.interface.js");
8
+ const simple_type_interface_js_1 = require("./data-type/simple-type.interface.js");
9
+ const union_type_interface_js_1 = require("./data-type/union-type.interface.js");
10
+ const collection_interface_js_1 = require("./resource/collection.interface.js");
11
+ const container_interface_js_1 = require("./resource/container.interface.js");
12
+ const singleton_interface_js_1 = require("./resource/singleton.interface.js");
13
+ const type_guards_js_1 = require("./type-guards.js");
14
+ var OpraSchema;
12
15
  (function (OpraSchema) {
13
16
  // Re-export constants and types
14
- OpraSchema.SpecVersion = _SpecVersion;
17
+ OpraSchema.SpecVersion = constants_js_1.SpecVersion;
15
18
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
- OpraSchema.ComplexType = _ComplexType;
19
+ OpraSchema.ComplexType = complex_type_interface_js_1.ComplexType;
17
20
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18
- OpraSchema.EnumType = _EnumType;
21
+ OpraSchema.EnumType = enum_type_interface_js_1.EnumType;
19
22
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
20
- OpraSchema.MappedType = _MappedType;
23
+ OpraSchema.MappedType = mapped_type_interface_js_1.MappedType;
21
24
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
- OpraSchema.SimpleType = _SimpleType;
25
+ OpraSchema.SimpleType = simple_type_interface_js_1.SimpleType;
23
26
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
24
- OpraSchema.UnionType = _UnionType;
27
+ OpraSchema.UnionType = union_type_interface_js_1.UnionType;
25
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
- OpraSchema.Collection = _Collection;
29
+ OpraSchema.Collection = collection_interface_js_1.Collection;
27
30
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
- OpraSchema.Container = _Container;
31
+ OpraSchema.Container = container_interface_js_1.Container;
29
32
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
- OpraSchema.Singleton = _Singleton;
31
- OpraSchema.isDataType = _isDataType;
32
- OpraSchema.isComplexType = _isComplexType;
33
- OpraSchema.isEnumType = _isEnumType;
34
- OpraSchema.isMappedType = _isMappedType;
35
- OpraSchema.isSimpleType = _isSimpleType;
36
- OpraSchema.isUnionType = _isUnionType;
37
- OpraSchema.isResource = _isResource;
38
- OpraSchema.isCollection = _isCollection;
39
- OpraSchema.isContainer = _isContainer;
40
- OpraSchema.isSingleton = _isSingleton;
41
- })(OpraSchema || (OpraSchema = {}));
33
+ OpraSchema.Singleton = singleton_interface_js_1.Singleton;
34
+ OpraSchema.isDataType = type_guards_js_1.isDataType;
35
+ OpraSchema.isComplexType = type_guards_js_1.isComplexType;
36
+ OpraSchema.isEnumType = type_guards_js_1.isEnumType;
37
+ OpraSchema.isMappedType = type_guards_js_1.isMappedType;
38
+ OpraSchema.isSimpleType = type_guards_js_1.isSimpleType;
39
+ OpraSchema.isUnionType = type_guards_js_1.isUnionType;
40
+ OpraSchema.isResource = type_guards_js_1.isResource;
41
+ OpraSchema.isCollection = type_guards_js_1.isCollection;
42
+ OpraSchema.isContainer = type_guards_js_1.isContainer;
43
+ OpraSchema.isSingleton = type_guards_js_1.isSingleton;
44
+ })(OpraSchema = exports.OpraSchema || (exports.OpraSchema = {}));
@@ -1,4 +1,7 @@
1
- export var Collection;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Collection = void 0;
4
+ var Collection;
2
5
  (function (Collection) {
3
6
  Collection.Kind = 'Collection';
4
- })(Collection || (Collection = {}));
7
+ })(Collection = exports.Collection || (exports.Collection = {}));
@@ -1,4 +1,7 @@
1
- export var Container;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Container = void 0;
4
+ var Container;
2
5
  (function (Container) {
3
6
  Container.Kind = 'Container';
4
- })(Container || (Container = {}));
7
+ })(Container = exports.Container || (exports.Container = {}));
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,7 @@
1
- export var Singleton;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Singleton = void 0;
4
+ var Singleton;
2
5
  (function (Singleton) {
3
6
  Singleton.Kind = 'Singleton';
4
- })(Singleton || (Singleton = {}));
7
+ })(Singleton = exports.Singleton || (exports.Singleton = {}));
@@ -1,46 +1,59 @@
1
- import { ComplexType } from './data-type/complex-type.interface.js';
2
- import { EnumType } from './data-type/enum-type.interface.js';
3
- import { MappedType } from './data-type/mapped-type.interface.js';
4
- import { SimpleType } from './data-type/simple-type.interface.js';
5
- import { UnionType } from './data-type/union-type.interface.js';
6
- import { Collection } from './resource/collection.interface.js';
7
- import { Container } from './resource/container.interface.js';
8
- import { Singleton } from './resource/singleton.interface.js';
9
- export function isDataType(obj) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isContainer = exports.isSingleton = exports.isCollection = exports.isResource = exports.isEnumType = exports.isMappedType = exports.isUnionType = exports.isSimpleType = exports.isComplexType = exports.isDataType = void 0;
4
+ const complex_type_interface_js_1 = require("./data-type/complex-type.interface.js");
5
+ const enum_type_interface_js_1 = require("./data-type/enum-type.interface.js");
6
+ const mapped_type_interface_js_1 = require("./data-type/mapped-type.interface.js");
7
+ const simple_type_interface_js_1 = require("./data-type/simple-type.interface.js");
8
+ const union_type_interface_js_1 = require("./data-type/union-type.interface.js");
9
+ const collection_interface_js_1 = require("./resource/collection.interface.js");
10
+ const container_interface_js_1 = require("./resource/container.interface.js");
11
+ const singleton_interface_js_1 = require("./resource/singleton.interface.js");
12
+ function isDataType(obj) {
10
13
  return obj && typeof obj === 'object' &&
11
- (obj.kind === ComplexType.Kind ||
12
- obj.kind === EnumType.Kind ||
13
- obj.kind === MappedType.Kind ||
14
- obj.kind === SimpleType.Kind ||
15
- obj.kind === UnionType.Kind);
16
- }
17
- export function isComplexType(obj) {
18
- return obj && typeof obj === 'object' && obj.kind === ComplexType.Kind;
19
- }
20
- export function isSimpleType(obj) {
21
- return obj && typeof obj === 'object' && obj.kind === SimpleType.Kind;
22
- }
23
- export function isUnionType(obj) {
24
- return obj && typeof obj === 'object' && obj.kind === UnionType.Kind;
25
- }
26
- export function isMappedType(obj) {
27
- return obj && typeof obj === 'object' && obj.kind === MappedType.Kind;
28
- }
29
- export function isEnumType(obj) {
30
- return obj && typeof obj === 'object' && obj.kind === EnumType.Kind;
31
- }
32
- export function isResource(obj) {
14
+ (obj.kind === complex_type_interface_js_1.ComplexType.Kind ||
15
+ obj.kind === enum_type_interface_js_1.EnumType.Kind ||
16
+ obj.kind === mapped_type_interface_js_1.MappedType.Kind ||
17
+ obj.kind === simple_type_interface_js_1.SimpleType.Kind ||
18
+ obj.kind === union_type_interface_js_1.UnionType.Kind);
19
+ }
20
+ exports.isDataType = isDataType;
21
+ function isComplexType(obj) {
22
+ return obj && typeof obj === 'object' && obj.kind === complex_type_interface_js_1.ComplexType.Kind;
23
+ }
24
+ exports.isComplexType = isComplexType;
25
+ function isSimpleType(obj) {
26
+ return obj && typeof obj === 'object' && obj.kind === simple_type_interface_js_1.SimpleType.Kind;
27
+ }
28
+ exports.isSimpleType = isSimpleType;
29
+ function isUnionType(obj) {
30
+ return obj && typeof obj === 'object' && obj.kind === union_type_interface_js_1.UnionType.Kind;
31
+ }
32
+ exports.isUnionType = isUnionType;
33
+ function isMappedType(obj) {
34
+ return obj && typeof obj === 'object' && obj.kind === mapped_type_interface_js_1.MappedType.Kind;
35
+ }
36
+ exports.isMappedType = isMappedType;
37
+ function isEnumType(obj) {
38
+ return obj && typeof obj === 'object' && obj.kind === enum_type_interface_js_1.EnumType.Kind;
39
+ }
40
+ exports.isEnumType = isEnumType;
41
+ function isResource(obj) {
33
42
  return obj && typeof obj === 'object' &&
34
- (obj.kind === Container.Kind ||
35
- obj.kind === Collection.Kind ||
36
- obj.kind === Singleton.Kind);
43
+ (obj.kind === container_interface_js_1.Container.Kind ||
44
+ obj.kind === collection_interface_js_1.Collection.Kind ||
45
+ obj.kind === singleton_interface_js_1.Singleton.Kind);
37
46
  }
38
- export function isCollection(obj) {
39
- return obj && typeof obj === 'object' && obj.kind === Collection.Kind;
47
+ exports.isResource = isResource;
48
+ function isCollection(obj) {
49
+ return obj && typeof obj === 'object' && obj.kind === collection_interface_js_1.Collection.Kind;
40
50
  }
41
- export function isSingleton(obj) {
42
- return obj && typeof obj === 'object' && obj.kind === Singleton.Kind;
51
+ exports.isCollection = isCollection;
52
+ function isSingleton(obj) {
53
+ return obj && typeof obj === 'object' && obj.kind === singleton_interface_js_1.Singleton.Kind;
43
54
  }
44
- export function isContainer(obj) {
45
- return obj && typeof obj === 'object' && obj.kind === Container.Kind;
55
+ exports.isSingleton = isSingleton;
56
+ function isContainer(obj) {
57
+ return obj && typeof obj === 'object' && obj.kind === container_interface_js_1.Container.Kind;
46
58
  }
59
+ exports.isContainer = isContainer;
package/esm/types.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/esm/url/index.js CHANGED
@@ -1,5 +1,8 @@
1
- export * from './opra-url.js';
2
- export * from './opra-url-path.js';
3
- export * from './opra-url-path-component.js';
4
- export * from './utils/encode-path-component.js';
5
- export * from './utils/decode-path-component.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./opra-url.js"), exports);
5
+ tslib_1.__exportStar(require("./opra-url-path.js"), exports);
6
+ tslib_1.__exportStar(require("./opra-url-path-component.js"), exports);
7
+ tslib_1.__exportStar(require("./utils/encode-path-component.js"), exports);
8
+ tslib_1.__exportStar(require("./utils/decode-path-component.js"), exports);
@@ -1,13 +1,16 @@
1
- import { encodePathComponent } from './utils/encode-path-component.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpraURLPathComponent = void 0;
4
+ const encode_path_component_js_1 = require("./utils/encode-path-component.js");
2
5
  const nodeInspectCustom = Symbol.for('nodejs.util.inspect.custom');
3
- export class OpraURLPathComponent {
6
+ class OpraURLPathComponent {
4
7
  constructor(init) {
5
8
  this.resource = init.resource;
6
9
  this.key = init.key;
7
10
  this.typeCast = init.typeCast;
8
11
  }
9
12
  toString() {
10
- const obj = encodePathComponent(this.resource, this.key, this.typeCast);
13
+ const obj = (0, encode_path_component_js_1.encodePathComponent)(this.resource, this.key, this.typeCast);
11
14
  if (obj)
12
15
  Object.setPrototypeOf(obj, OpraURLPathComponent.prototype);
13
16
  return obj;
@@ -24,3 +27,4 @@ export class OpraURLPathComponent {
24
27
  return out;
25
28
  }
26
29
  }
30
+ exports.OpraURLPathComponent = OpraURLPathComponent;
@@ -1,14 +1,17 @@
1
+ "use strict";
1
2
  var _a;
2
- import { tokenize } from 'fast-tokenizer';
3
- import { isURL } from '../helpers/index.js';
4
- import { normalizePath } from '../utils/path-utils.js';
5
- import { OpraURLPathComponent } from './opra-url-path-component.js';
6
- import { decodePathComponent } from './utils/decode-path-component.js';
7
- import { encodePathComponent } from './utils/encode-path-component.js';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.OpraURLPath = void 0;
5
+ const fast_tokenizer_1 = require("fast-tokenizer");
6
+ const index_js_1 = require("../helpers/index.js");
7
+ const path_utils_js_1 = require("../utils/path-utils.js");
8
+ const opra_url_path_component_js_1 = require("./opra-url-path-component.js");
9
+ const decode_path_component_js_1 = require("./utils/decode-path-component.js");
10
+ const encode_path_component_js_1 = require("./utils/encode-path-component.js");
8
11
  const nodeInspectCustom = Symbol.for('nodejs.util.inspect.custom');
9
12
  const kEntries = Symbol('kEntries');
10
13
  const kOptions = Symbol('kOptions');
11
- export class OpraURLPath {
14
+ class OpraURLPath {
12
15
  constructor(init, options) {
13
16
  this[_a] = [];
14
17
  this[kOptions] = { ...options, onChange: undefined };
@@ -89,7 +92,7 @@ export class OpraURLPath {
89
92
  }
90
93
  toString() {
91
94
  return this[kEntries]
92
- .map(x => encodePathComponent(x.resource, x.key, x.typeCast)).join('/');
95
+ .map(x => (0, encode_path_component_js_1.encodePathComponent)(x.resource, x.key, x.typeCast)).join('/');
93
96
  }
94
97
  values() {
95
98
  let i = -1;
@@ -109,24 +112,24 @@ export class OpraURLPath {
109
112
  }
110
113
  _join(target, source) {
111
114
  if (typeof source === 'string') {
112
- const pathTokenizer = tokenize(normalizePath(source, true), {
115
+ const pathTokenizer = (0, fast_tokenizer_1.tokenize)((0, path_utils_js_1.normalizePath)(source, true), {
113
116
  delimiters: '/', quotes: true, brackets: true,
114
117
  });
115
118
  for (const x of pathTokenizer) {
116
- const p = decodePathComponent(x);
117
- target.push(new OpraURLPathComponent(p));
119
+ const p = (0, decode_path_component_js_1.decodePathComponent)(x);
120
+ target.push(new opra_url_path_component_js_1.OpraURLPathComponent(p));
118
121
  }
119
122
  return;
120
123
  }
121
124
  if (source instanceof OpraURLPath) {
122
- target.push(...source[kEntries].map(x => new OpraURLPathComponent(x)));
125
+ target.push(...source[kEntries].map(x => new opra_url_path_component_js_1.OpraURLPathComponent(x)));
123
126
  return;
124
127
  }
125
128
  if (typeof source === 'object' && source.path instanceof OpraURLPath) {
126
129
  this._join(target, source.path);
127
130
  return;
128
131
  }
129
- if (isURL(source)) {
132
+ if ((0, index_js_1.isURL)(source)) {
130
133
  this._join(target, source.pathname);
131
134
  return;
132
135
  }
@@ -134,7 +137,7 @@ export class OpraURLPath {
134
137
  source.forEach(x => this._join(target, x));
135
138
  return;
136
139
  }
137
- target.push(new OpraURLPathComponent(source));
140
+ target.push(new opra_url_path_component_js_1.OpraURLPathComponent(source));
138
141
  }
139
142
  /* istanbul ignore next */
140
143
  [(_a = kEntries, nodeInspectCustom)]() {
@@ -147,5 +150,6 @@ export class OpraURLPath {
147
150
  return 'OpraURLPath';
148
151
  }
149
152
  }
153
+ exports.OpraURLPath = OpraURLPath;
150
154
  OpraURLPath.kEntries = kEntries;
151
155
  OpraURLPath.kOptions = kOptions;
@@ -1,9 +1,12 @@
1
+ "use strict";
1
2
  var _a;
2
- import { splitString, tokenize } from 'fast-tokenizer';
3
- import { HttpParams } from '../http/index.js';
4
- import { normalizePath } from '../utils/path-utils.js';
5
- import { OpraURLPath } from './opra-url-path.js';
6
- import { decodePathComponent } from './utils/decode-path-component.js';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.OpraURL = void 0;
5
+ const fast_tokenizer_1 = require("fast-tokenizer");
6
+ const index_js_1 = require("../http/index.js");
7
+ const path_utils_js_1 = require("../utils/path-utils.js");
8
+ const opra_url_path_js_1 = require("./opra-url-path.js");
9
+ const decode_path_component_js_1 = require("./utils/decode-path-component.js");
7
10
  const nodeInspectCustom = Symbol.for('nodejs.util.inspect.custom');
8
11
  const urlRegEx = /^(?:((?:[A-Z][A-Z+-.]+:)+)\/\/([^/?]+))?(.*)?$/i;
9
12
  const schemeRegEx = /^([A-Z][A-Z+-.]+:?)+$/i;
@@ -11,8 +14,8 @@ const hostRegEx = /^([^/:]+)(?::(\d+))?$/;
11
14
  const hostnameRegEx = /^([^/:]+)$/;
12
15
  const kContext = Symbol('kContext');
13
16
  const kPath = Symbol('kPath');
14
- const kSearchParams = Symbol('kSearchParams');
15
- export class OpraURL {
17
+ const kParams = Symbol('kParams');
18
+ class OpraURL {
16
19
  constructor(input, base) {
17
20
  this[_a] = {
18
21
  protocol: '',
@@ -23,13 +26,13 @@ export class OpraURL {
23
26
  hash: '',
24
27
  password: ''
25
28
  };
26
- this[kPath] = new OpraURLPath('', {
29
+ this[kPath] = new opra_url_path_js_1.OpraURLPath('', {
27
30
  onChange: () => {
28
31
  this[kContext].pathname = undefined;
29
32
  this[kContext].address = undefined;
30
33
  }
31
34
  });
32
- this[kSearchParams] = new HttpParams('', {
35
+ this[kParams] = new index_js_1.HttpParams('', {
33
36
  onChange: () => {
34
37
  this[kContext].search = undefined;
35
38
  }
@@ -179,20 +182,20 @@ export class OpraURL {
179
182
  }
180
183
  get search() {
181
184
  if (this[kContext].search == null) {
182
- const s = this[kSearchParams].toString();
185
+ const s = this[kParams].toString();
183
186
  this[kContext].search = s ? ('?' + s) : '';
184
187
  }
185
188
  return this[kContext].search;
186
189
  }
187
190
  set search(v) {
188
191
  if (v) {
189
- this[kSearchParams].clear();
190
- this[kSearchParams].appendAll(v);
192
+ this[kParams].clear();
193
+ this[kParams].appendAll(v);
191
194
  }
192
195
  this[kContext].search = undefined;
193
196
  }
194
197
  get searchParams() {
195
- return this[kSearchParams];
198
+ return this[kParams];
196
199
  }
197
200
  parse(input) {
198
201
  const m = urlRegEx.exec(input);
@@ -204,10 +207,10 @@ export class OpraURL {
204
207
  this.protocol = m[1];
205
208
  const isAbsolute = !!m[2];
206
209
  if (isAbsolute) {
207
- let tokens = splitString(m[2], { delimiters: '@' });
210
+ let tokens = (0, fast_tokenizer_1.splitString)(m[2], { delimiters: '@' });
208
211
  if (tokens.length > 1) {
209
212
  this.host = tokens[1];
210
- tokens = splitString(tokens[0], { delimiters: ':' });
213
+ tokens = (0, fast_tokenizer_1.splitString)(tokens[0], { delimiters: ':' });
211
214
  this.username = tokens[0] ? decodeURIComponent(tokens[0]) : '';
212
215
  this.password = tokens[1] ? decodeURIComponent(tokens[1]) : '';
213
216
  }
@@ -220,10 +223,10 @@ export class OpraURL {
220
223
  this.password = '';
221
224
  }
222
225
  input = m[3] || '';
223
- let tokenizer = tokenize(input, { delimiters: '#', quotes: true, brackets: true });
226
+ let tokenizer = (0, fast_tokenizer_1.tokenize)(input, { delimiters: '#', quotes: true, brackets: true });
224
227
  input = tokenizer.next() || '';
225
228
  this.hash = tokenizer.join('#');
226
- tokenizer = tokenize(input, { delimiters: '?', quotes: true, brackets: true });
229
+ tokenizer = (0, fast_tokenizer_1.tokenize)(input, { delimiters: '?', quotes: true, brackets: true });
227
230
  this._setPathname(tokenizer.next() || '', isAbsolute);
228
231
  this.search = tokenizer.join('&');
229
232
  }
@@ -278,11 +281,11 @@ export class OpraURL {
278
281
  this.path.clear();
279
282
  if (!v)
280
283
  return;
281
- const pathTokenizer = tokenize(normalizePath(v, true), {
284
+ const pathTokenizer = (0, fast_tokenizer_1.tokenize)((0, path_utils_js_1.normalizePath)(v, true), {
282
285
  delimiters: '/', quotes: true, brackets: true,
283
286
  });
284
287
  if (trimPrefix && this.prefix) {
285
- const prefixTokenizer = tokenize(normalizePath(this.prefix, true), {
288
+ const prefixTokenizer = (0, fast_tokenizer_1.tokenize)((0, path_utils_js_1.normalizePath)(this.prefix, true), {
286
289
  delimiters: '/', quotes: true, brackets: true,
287
290
  });
288
291
  for (const a of prefixTokenizer) {
@@ -292,11 +295,12 @@ export class OpraURL {
292
295
  }
293
296
  }
294
297
  for (const x of pathTokenizer) {
295
- const p = decodePathComponent(x);
298
+ const p = (0, decode_path_component_js_1.decodePathComponent)(x);
296
299
  this.path.join(p);
297
300
  }
298
301
  }
299
302
  }
303
+ exports.OpraURL = OpraURL;
300
304
  OpraURL.kContext = kContext;
301
305
  OpraURL.kPath = kPath;
302
- OpraURL.kSearchParams = kSearchParams;
306
+ OpraURL.kParams = kParams;
@@ -1,6 +1,9 @@
1
- import { splitString } from 'fast-tokenizer';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodePathComponent = void 0;
4
+ const fast_tokenizer_1 = require("fast-tokenizer");
2
5
  const pathComponentRegEx = /^([^/?#:@]+)(?:@([^/?#:]*))?(?:::(.*))?$/;
3
- export function decodePathComponent(input) {
6
+ function decodePathComponent(input) {
4
7
  const m = pathComponentRegEx.exec(input);
5
8
  if (!m)
6
9
  throw Object.assign(new TypeError('Invalid URL path'), {
@@ -11,9 +14,9 @@ export function decodePathComponent(input) {
11
14
  let key;
12
15
  if (m[2]) {
13
16
  const s = decodeURIComponent(m[2] || '');
14
- const b = splitString(s, { delimiters: ';', quotes: true, escape: false });
17
+ const b = (0, fast_tokenizer_1.splitString)(s, { delimiters: ';', quotes: true, escape: false });
15
18
  for (const k of b) {
16
- const c = splitString(k, { delimiters: '=', quotes: true, escape: false });
19
+ const c = (0, fast_tokenizer_1.splitString)(k, { delimiters: '=', quotes: true, escape: false });
17
20
  if ((b.length > 1 && c.length < 2) ||
18
21
  (key &&
19
22
  (c.length >= 2 && typeof key !== 'object') ||
@@ -35,3 +38,4 @@ export function decodePathComponent(input) {
35
38
  }
36
39
  return { resource, key };
37
40
  }
41
+ exports.decodePathComponent = decodePathComponent;