@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.
- package/cjs/document/factory/import-resource-class.js +1 -0
- package/cjs/document/factory/import-type-class.js +9 -2
- package/cjs/document/resource/collection.js +9 -9
- package/cjs/document/resource/singleton.js +4 -4
- package/cjs/url/opra-url.js +7 -7
- package/esm/document/api-document.js +37 -33
- package/esm/document/constants.js +6 -3
- package/esm/document/data-type/api-field.js +15 -12
- package/esm/document/data-type/builtin/any.type.js +8 -5
- package/esm/document/data-type/builtin/base64.type.js +8 -5
- package/esm/document/data-type/builtin/bigint.type.js +8 -5
- package/esm/document/data-type/builtin/boolean.type.js +11 -8
- package/esm/document/data-type/builtin/date.type.js +10 -7
- package/esm/document/data-type/builtin/guid.type.js +12 -9
- package/esm/document/data-type/builtin/index.js +13 -10
- package/esm/document/data-type/builtin/integer.type.js +13 -10
- package/esm/document/data-type/builtin/number.type.js +10 -7
- package/esm/document/data-type/builtin/object.type.js +8 -5
- package/esm/document/data-type/builtin/string.type.js +11 -8
- package/esm/document/data-type/builtin/time.type.js +10 -7
- package/esm/document/data-type/builtin/timestamp.type.js +12 -9
- package/esm/document/data-type/complex-type.js +34 -30
- package/esm/document/data-type/data-type.js +12 -9
- package/esm/document/data-type/enum-type.js +19 -15
- package/esm/document/data-type/mapped-type.js +29 -24
- package/esm/document/data-type/simple-type.js +21 -17
- package/esm/document/data-type/union-type.js +29 -26
- package/esm/document/factory/add-references.js +7 -3
- package/esm/document/factory/create-document.js +16 -10
- package/esm/document/factory/factory.js +37 -33
- package/esm/document/factory/import-resource-class.js +22 -15
- package/esm/document/factory/import-type-class.js +43 -26
- package/esm/document/factory/index.js +4 -1
- package/esm/document/factory/process-resources.js +16 -10
- package/esm/document/factory/process-types.js +37 -31
- package/esm/document/index.js +17 -14
- package/esm/document/resource/collection.js +50 -46
- package/esm/document/resource/resource.js +12 -9
- package/esm/document/resource/singleton.js +29 -25
- package/esm/document/utils/inspect.util.js +7 -4
- package/esm/document/utils/string-compare.util.js +5 -1
- package/esm/exception/enums/issue-severity.enum.js +5 -2
- package/esm/exception/error-issue.js +2 -1
- package/esm/exception/http-errors/bad-request.error.js +8 -4
- package/esm/exception/http-errors/failed-dependency.error.js +8 -4
- package/esm/exception/http-errors/forbidden.error.js +8 -4
- package/esm/exception/http-errors/internal-server.error.js +8 -4
- package/esm/exception/http-errors/method-not-allowed.error.js +8 -4
- package/esm/exception/http-errors/not-acceptable.error.js +8 -4
- package/esm/exception/http-errors/not-found.error.js +8 -4
- package/esm/exception/http-errors/unauthorized.error.js +8 -4
- package/esm/exception/http-errors/unprocessable-entity.error.js +8 -4
- package/esm/exception/index.js +18 -15
- package/esm/exception/opra-exception.js +7 -3
- package/esm/exception/resource-errors/resource-conflict.error.js +8 -4
- package/esm/exception/resource-errors/resource-not-found.error.js +8 -4
- package/esm/exception/wrap-exception.js +24 -20
- package/esm/filter/antlr/OpraFilterLexer.js +9 -6
- package/esm/filter/antlr/OpraFilterListener.js +5 -2
- package/esm/filter/antlr/OpraFilterParser.js +126 -79
- package/esm/filter/antlr/OpraFilterVisitor.js +5 -2
- package/esm/filter/ast/abstract/ast.js +5 -1
- package/esm/filter/ast/abstract/expression.js +6 -2
- package/esm/filter/ast/abstract/literal.js +6 -2
- package/esm/filter/ast/abstract/term.js +6 -2
- package/esm/filter/ast/expressions/arithmetic-expression.js +8 -3
- package/esm/filter/ast/expressions/array-expression.js +6 -2
- package/esm/filter/ast/expressions/comparison-expression.js +6 -2
- package/esm/filter/ast/expressions/logical-expression.js +6 -2
- package/esm/filter/ast/expressions/parentheses-expression.js +6 -2
- package/esm/filter/ast/index.js +19 -16
- package/esm/filter/ast/terms/boolean-literal.js +6 -2
- package/esm/filter/ast/terms/date-literal.js +12 -8
- package/esm/filter/ast/terms/external-constant.js +6 -2
- package/esm/filter/ast/terms/null-literal.js +6 -2
- package/esm/filter/ast/terms/number-literal.js +8 -4
- package/esm/filter/ast/terms/qualified-identifier.js +6 -2
- package/esm/filter/ast/terms/string-literal.js +8 -4
- package/esm/filter/ast/terms/time-literal.js +10 -6
- package/esm/filter/build.js +69 -45
- package/esm/filter/errors.js +9 -3
- package/esm/filter/filter-tree-visitor.js +31 -26
- package/esm/filter/index.js +8 -5
- package/esm/filter/opra-error-listener.js +8 -4
- package/esm/filter/parse.js +19 -14
- package/esm/filter/utils.js +7 -2
- package/esm/helpers/function-utils.js +14 -8
- package/esm/helpers/get-stack-filename.js +5 -1
- package/esm/helpers/index.js +11 -8
- package/esm/helpers/is-url.js +5 -1
- package/esm/helpers/mixin-utils.js +7 -2
- package/esm/helpers/object-utils.js +12 -6
- package/esm/helpers/path-to-object-tree.js +5 -1
- package/esm/helpers/responsive-map.js +5 -1
- package/esm/helpers/type-guards.js +17 -7
- package/esm/http/codecs/boolean-codec.js +5 -1
- package/esm/http/codecs/date-codec.js +5 -1
- package/esm/http/codecs/filter-codec.js +9 -5
- package/esm/http/codecs/integer-codec.js +6 -2
- package/esm/http/codecs/number-codec.js +5 -1
- package/esm/http/codecs/string-codec.js +5 -1
- package/esm/http/enums/http-headers-codes.enum.js +5 -2
- package/esm/http/enums/http-status-codes.enum.js +5 -2
- package/esm/http/enums/http-status-messages.js +4 -1
- package/esm/http/http-headers.js +9 -5
- package/esm/http/http-message.host.js +18 -13
- package/esm/http/http-params.js +25 -20
- package/esm/http/http-request-message.js +22 -18
- package/esm/http/http-response-message.js +28 -23
- package/esm/http/index.js +17 -14
- package/esm/http/interfaces/client-http-headers.interface.js +2 -1
- package/esm/http/interfaces/cookie-options.interface.js +2 -1
- package/esm/http/interfaces/server-http-headers.interface.js +2 -1
- package/esm/i18n/i18n.js +28 -23
- package/esm/i18n/index.js +9 -5
- package/esm/i18n/string-utils.js +7 -2
- package/esm/i18n/translate.js +7 -3
- package/esm/index.js +16 -11
- package/esm/schema/constants.js +4 -1
- package/esm/schema/data-type/complex-type.interface.js +5 -2
- package/esm/schema/data-type/data-type.interface.js +2 -1
- package/esm/schema/data-type/enum-type.interface.js +5 -2
- package/esm/schema/data-type/field.interface.js +2 -1
- package/esm/schema/data-type/mapped-type.interface.js +5 -2
- package/esm/schema/data-type/simple-type.interface.js +5 -2
- package/esm/schema/data-type/union-type.interface.js +5 -2
- package/esm/schema/document.interface.js +2 -1
- package/esm/schema/index.js +34 -31
- package/esm/schema/resource/collection.interface.js +5 -2
- package/esm/schema/resource/container.interface.js +5 -2
- package/esm/schema/resource/endpoint.interface.js +2 -1
- package/esm/schema/resource/resource.interface.js +2 -1
- package/esm/schema/resource/singleton.interface.js +5 -2
- package/esm/schema/type-guards.js +53 -40
- package/esm/types.js +2 -1
- package/esm/url/index.js +8 -5
- package/esm/url/opra-url-path-component.js +7 -3
- package/esm/url/opra-url-path.js +18 -14
- package/esm/url/opra-url.js +25 -21
- package/esm/url/utils/decode-path-component.js +8 -4
- package/esm/url/utils/encode-path-component.js +8 -3
- package/esm/utils/path-utils.js +7 -2
- package/package.json +5 -4
- package/{esm → types}/document/factory/import-resource-class.d.ts +1 -0
- package/{esm → types}/document/resource/collection.d.ts +10 -10
- package/{esm → types}/document/resource/singleton.d.ts +4 -4
- package/{esm → types}/schema/resource/collection.interface.d.ts +6 -6
- package/{esm → types}/url/opra-url.d.ts +3 -3
- package/{esm → types}/document/api-document.d.ts +0 -0
- package/{esm → types}/document/constants.d.ts +0 -0
- package/{esm → types}/document/data-type/api-field.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/any.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/base64.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/bigint.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/boolean.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/date.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/guid.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/index.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/integer.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/number.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/object.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/string.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/time.type.d.ts +0 -0
- package/{esm → types}/document/data-type/builtin/timestamp.type.d.ts +0 -0
- package/{esm → types}/document/data-type/complex-type.d.ts +0 -0
- package/{esm → types}/document/data-type/data-type.d.ts +0 -0
- package/{esm → types}/document/data-type/enum-type.d.ts +0 -0
- package/{esm → types}/document/data-type/mapped-type.d.ts +0 -0
- package/{esm → types}/document/data-type/simple-type.d.ts +0 -0
- package/{esm → types}/document/data-type/union-type.d.ts +0 -0
- package/{esm → types}/document/factory/add-references.d.ts +0 -0
- package/{esm → types}/document/factory/create-document.d.ts +0 -0
- package/{esm → types}/document/factory/factory.d.ts +0 -0
- package/{esm → types}/document/factory/import-type-class.d.ts +0 -0
- package/{esm → types}/document/factory/index.d.ts +0 -0
- package/{esm → types}/document/factory/process-resources.d.ts +0 -0
- package/{esm → types}/document/factory/process-types.d.ts +0 -0
- package/{esm → types}/document/index.d.ts +0 -0
- package/{esm → types}/document/resource/resource.d.ts +0 -0
- package/{esm → types}/document/utils/inspect.util.d.ts +0 -0
- package/{esm → types}/document/utils/string-compare.util.d.ts +0 -0
- package/{esm → types}/exception/enums/issue-severity.enum.d.ts +0 -0
- package/{esm → types}/exception/error-issue.d.ts +0 -0
- package/{esm → types}/exception/http-errors/bad-request.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/failed-dependency.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/forbidden.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/internal-server.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/method-not-allowed.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/not-acceptable.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/not-found.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/unauthorized.error.d.ts +0 -0
- package/{esm → types}/exception/http-errors/unprocessable-entity.error.d.ts +0 -0
- package/{esm → types}/exception/index.d.ts +0 -0
- package/{esm → types}/exception/opra-exception.d.ts +0 -0
- package/{esm → types}/exception/resource-errors/resource-conflict.error.d.ts +0 -0
- package/{esm → types}/exception/resource-errors/resource-not-found.error.d.ts +0 -0
- package/{esm → types}/exception/wrap-exception.d.ts +0 -0
- package/{esm → types}/filter/antlr/OpraFilterLexer.d.ts +0 -0
- package/{esm → types}/filter/antlr/OpraFilterListener.d.ts +0 -0
- package/{esm → types}/filter/antlr/OpraFilterParser.d.ts +0 -0
- package/{esm → types}/filter/antlr/OpraFilterVisitor.d.ts +0 -0
- package/{esm → types}/filter/ast/abstract/ast.d.ts +0 -0
- package/{esm → types}/filter/ast/abstract/expression.d.ts +0 -0
- package/{esm → types}/filter/ast/abstract/literal.d.ts +0 -0
- package/{esm → types}/filter/ast/abstract/term.d.ts +0 -0
- package/{esm → types}/filter/ast/expressions/arithmetic-expression.d.ts +0 -0
- package/{esm → types}/filter/ast/expressions/array-expression.d.ts +0 -0
- package/{esm → types}/filter/ast/expressions/comparison-expression.d.ts +0 -0
- package/{esm → types}/filter/ast/expressions/logical-expression.d.ts +0 -0
- package/{esm → types}/filter/ast/expressions/parentheses-expression.d.ts +0 -0
- package/{esm → types}/filter/ast/index.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/boolean-literal.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/date-literal.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/external-constant.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/null-literal.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/number-literal.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/qualified-identifier.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/string-literal.d.ts +0 -0
- package/{esm → types}/filter/ast/terms/time-literal.d.ts +0 -0
- package/{esm → types}/filter/build.d.ts +0 -0
- package/{esm → types}/filter/errors.d.ts +0 -0
- package/{esm → types}/filter/filter-tree-visitor.d.ts +0 -0
- package/{esm → types}/filter/index.d.ts +0 -0
- package/{esm → types}/filter/opra-error-listener.d.ts +0 -0
- package/{esm → types}/filter/parse.d.ts +0 -0
- package/{esm → types}/filter/utils.d.ts +0 -0
- package/{esm → types}/helpers/function-utils.d.ts +0 -0
- package/{esm → types}/helpers/get-stack-filename.d.ts +0 -0
- package/{esm → types}/helpers/index.d.ts +0 -0
- package/{esm → types}/helpers/is-url.d.ts +0 -0
- package/{esm → types}/helpers/mixin-utils.d.ts +0 -0
- package/{esm → types}/helpers/object-utils.d.ts +0 -0
- package/{esm → types}/helpers/path-to-object-tree.d.ts +0 -0
- package/{esm → types}/helpers/responsive-map.d.ts +0 -0
- package/{esm → types}/helpers/type-guards.d.ts +0 -0
- package/{esm → types}/http/codecs/boolean-codec.d.ts +0 -0
- package/{esm → types}/http/codecs/date-codec.d.ts +0 -0
- package/{esm → types}/http/codecs/filter-codec.d.ts +0 -0
- package/{esm → types}/http/codecs/integer-codec.d.ts +0 -0
- package/{esm → types}/http/codecs/number-codec.d.ts +0 -0
- package/{esm → types}/http/codecs/string-codec.d.ts +0 -0
- package/{esm → types}/http/enums/http-headers-codes.enum.d.ts +0 -0
- package/{esm → types}/http/enums/http-status-codes.enum.d.ts +0 -0
- package/{esm → types}/http/enums/http-status-messages.d.ts +0 -0
- package/{esm → types}/http/http-headers.d.ts +0 -0
- package/{esm → types}/http/http-message.host.d.ts +0 -0
- package/{esm → types}/http/http-params.d.ts +0 -0
- package/{esm → types}/http/http-request-message.d.ts +0 -0
- package/{esm → types}/http/http-response-message.d.ts +0 -0
- package/{esm → types}/http/index.d.ts +0 -0
- package/{esm → types}/http/interfaces/client-http-headers.interface.d.ts +0 -0
- package/{esm → types}/http/interfaces/cookie-options.interface.d.ts +0 -0
- package/{esm → types}/http/interfaces/server-http-headers.interface.d.ts +0 -0
- package/{esm → types}/http/multipart/batch-multipart.d.ts +0 -0
- package/{esm → types}/http/multipart/http-request-content.d.ts +0 -0
- package/{esm → types}/http/multipart/http-response-content.d.ts +0 -0
- package/{esm → types}/http/multipart/index.d.ts +0 -0
- package/{esm → types}/i18n/i18n.d.ts +0 -0
- package/{esm → types}/i18n/index.d.ts +0 -0
- package/{esm → types}/i18n/string-utils.d.ts +0 -0
- package/{esm → types}/i18n/translate.d.ts +0 -0
- package/{esm → types}/index.d.ts +0 -0
- package/{esm → types}/schema/constants.d.ts +0 -0
- package/{esm → types}/schema/data-type/complex-type.interface.d.ts +0 -0
- package/{esm → types}/schema/data-type/data-type.interface.d.ts +0 -0
- package/{esm → types}/schema/data-type/enum-type.interface.d.ts +0 -0
- package/{esm → types}/schema/data-type/field.interface.d.ts +0 -0
- package/{esm → types}/schema/data-type/mapped-type.interface.d.ts +0 -0
- package/{esm → types}/schema/data-type/simple-type.interface.d.ts +0 -0
- package/{esm → types}/schema/data-type/union-type.interface.d.ts +0 -0
- package/{esm → types}/schema/document.interface.d.ts +0 -0
- package/{esm → types}/schema/index.d.ts +0 -0
- package/{esm → types}/schema/resource/container.interface.d.ts +0 -0
- package/{esm → types}/schema/resource/endpoint.interface.d.ts +0 -0
- package/{esm → types}/schema/resource/resource.interface.d.ts +0 -0
- package/{esm → types}/schema/resource/singleton.interface.d.ts +2 -2
- /package/{esm → types}/schema/type-guards.d.ts +0 -0
- /package/{esm → types}/types.d.ts +0 -0
- /package/{esm → types}/url/index.d.ts +0 -0
- /package/{esm → types}/url/opra-url-path-component.d.ts +0 -0
- /package/{esm → types}/url/opra-url-path.d.ts +0 -0
- /package/{esm → types}/url/utils/decode-path-component.d.ts +0 -0
- /package/{esm → types}/url/utils/encode-path-component.d.ts +0 -0
- /package/{esm → types}/utils/path-utils.d.ts +0 -0
package/esm/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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; } });
|
package/esm/schema/constants.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/esm/schema/index.js
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 =
|
|
17
|
+
OpraSchema.SpecVersion = constants_js_1.SpecVersion;
|
|
15
18
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
-
OpraSchema.ComplexType =
|
|
19
|
+
OpraSchema.ComplexType = complex_type_interface_js_1.ComplexType;
|
|
17
20
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
-
OpraSchema.EnumType =
|
|
21
|
+
OpraSchema.EnumType = enum_type_interface_js_1.EnumType;
|
|
19
22
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
OpraSchema.MappedType =
|
|
23
|
+
OpraSchema.MappedType = mapped_type_interface_js_1.MappedType;
|
|
21
24
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
-
OpraSchema.SimpleType =
|
|
25
|
+
OpraSchema.SimpleType = simple_type_interface_js_1.SimpleType;
|
|
23
26
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
-
OpraSchema.UnionType =
|
|
27
|
+
OpraSchema.UnionType = union_type_interface_js_1.UnionType;
|
|
25
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
|
-
OpraSchema.Collection =
|
|
29
|
+
OpraSchema.Collection = collection_interface_js_1.Collection;
|
|
27
30
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
-
OpraSchema.Container =
|
|
31
|
+
OpraSchema.Container = container_interface_js_1.Container;
|
|
29
32
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
-
OpraSchema.Singleton =
|
|
31
|
-
OpraSchema.isDataType =
|
|
32
|
-
OpraSchema.isComplexType =
|
|
33
|
-
OpraSchema.isEnumType =
|
|
34
|
-
OpraSchema.isMappedType =
|
|
35
|
-
OpraSchema.isSimpleType =
|
|
36
|
-
OpraSchema.isUnionType =
|
|
37
|
-
OpraSchema.isResource =
|
|
38
|
-
OpraSchema.isCollection =
|
|
39
|
-
OpraSchema.isContainer =
|
|
40
|
-
OpraSchema.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return obj && typeof obj === 'object' && obj.kind ===
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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
|
-
|
|
45
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/esm/url/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
package/esm/url/opra-url-path.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var _a;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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;
|
package/esm/url/opra-url.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var _a;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
15
|
-
|
|
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[
|
|
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[
|
|
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[
|
|
190
|
-
this[
|
|
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[
|
|
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.
|
|
306
|
+
OpraURL.kParams = kParams;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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;
|