@opra/common 1.0.0-alpha.5 → 1.0.0-alpha.6
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/browser.js +22 -6
- package/cjs/document/http/http-controller.js +11 -5
- package/cjs/document/http/http-operation.js +11 -4
- package/esm/document/http/http-controller.js +11 -5
- package/esm/document/http/http-operation.js +11 -4
- package/package.json +1 -1
- package/types/document/http/http-parameter.d.ts +1 -2
package/browser.js
CHANGED
|
@@ -2525,9 +2525,17 @@ var HttpControllerClass = class extends DocumentElement {
|
|
|
2525
2525
|
return this.controllers.get(arg0);
|
|
2526
2526
|
}
|
|
2527
2527
|
findParameter(paramName, location) {
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2528
|
+
const paramNameLower = paramName.toLowerCase();
|
|
2529
|
+
let prm;
|
|
2530
|
+
for (prm of this.parameters) {
|
|
2531
|
+
if (location && location !== prm.location)
|
|
2532
|
+
continue;
|
|
2533
|
+
if (typeof prm.name === "string") {
|
|
2534
|
+
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
2535
|
+
if (prm._nameLower === paramNameLower)
|
|
2536
|
+
return prm;
|
|
2537
|
+
}
|
|
2538
|
+
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
2531
2539
|
return prm;
|
|
2532
2540
|
}
|
|
2533
2541
|
if (this.node.parent && this.node.parent.element instanceof HttpController2)
|
|
@@ -3140,9 +3148,17 @@ var HttpOperationClass = class extends DocumentElement {
|
|
|
3140
3148
|
__name(this, "HttpOperationClass");
|
|
3141
3149
|
}
|
|
3142
3150
|
findParameter(paramName, location) {
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3151
|
+
const paramNameLower = paramName.toLowerCase();
|
|
3152
|
+
let prm;
|
|
3153
|
+
for (prm of this.parameters) {
|
|
3154
|
+
if (location && location !== prm.location)
|
|
3155
|
+
continue;
|
|
3156
|
+
if (typeof prm.name === "string") {
|
|
3157
|
+
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
3158
|
+
if (prm._nameLower === paramNameLower)
|
|
3159
|
+
return prm;
|
|
3160
|
+
}
|
|
3161
|
+
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
3146
3162
|
return prm;
|
|
3147
3163
|
}
|
|
3148
3164
|
}
|
|
@@ -82,11 +82,17 @@ class HttpControllerClass extends document_element_js_1.DocumentElement {
|
|
|
82
82
|
return this.controllers.get(arg0);
|
|
83
83
|
}
|
|
84
84
|
findParameter(paramName, location) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
const paramNameLower = paramName.toLowerCase();
|
|
86
|
+
let prm;
|
|
87
|
+
for (prm of this.parameters) {
|
|
88
|
+
if (location && location !== prm.location)
|
|
89
|
+
continue;
|
|
90
|
+
if (typeof prm.name === 'string') {
|
|
91
|
+
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
92
|
+
if (prm._nameLower === paramNameLower)
|
|
93
|
+
return prm;
|
|
94
|
+
}
|
|
95
|
+
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
90
96
|
return prm;
|
|
91
97
|
}
|
|
92
98
|
if (this.node.parent && this.node.parent.element instanceof exports.HttpController)
|
|
@@ -39,10 +39,17 @@ exports.HttpOperation = function (...args) {
|
|
|
39
39
|
*/
|
|
40
40
|
class HttpOperationClass extends document_element_js_1.DocumentElement {
|
|
41
41
|
findParameter(paramName, location) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const paramNameLower = paramName.toLowerCase();
|
|
43
|
+
let prm;
|
|
44
|
+
for (prm of this.parameters) {
|
|
45
|
+
if (location && location !== prm.location)
|
|
46
|
+
continue;
|
|
47
|
+
if (typeof prm.name === 'string') {
|
|
48
|
+
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
49
|
+
if (prm._nameLower === paramNameLower)
|
|
50
|
+
return prm;
|
|
51
|
+
}
|
|
52
|
+
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
46
53
|
return prm;
|
|
47
54
|
}
|
|
48
55
|
}
|
|
@@ -79,11 +79,17 @@ class HttpControllerClass extends DocumentElement {
|
|
|
79
79
|
return this.controllers.get(arg0);
|
|
80
80
|
}
|
|
81
81
|
findParameter(paramName, location) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
const paramNameLower = paramName.toLowerCase();
|
|
83
|
+
let prm;
|
|
84
|
+
for (prm of this.parameters) {
|
|
85
|
+
if (location && location !== prm.location)
|
|
86
|
+
continue;
|
|
87
|
+
if (typeof prm.name === 'string') {
|
|
88
|
+
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
89
|
+
if (prm._nameLower === paramNameLower)
|
|
90
|
+
return prm;
|
|
91
|
+
}
|
|
92
|
+
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
87
93
|
return prm;
|
|
88
94
|
}
|
|
89
95
|
if (this.node.parent && this.node.parent.element instanceof HttpController)
|
|
@@ -36,10 +36,17 @@ export const HttpOperation = function (...args) {
|
|
|
36
36
|
*/
|
|
37
37
|
class HttpOperationClass extends DocumentElement {
|
|
38
38
|
findParameter(paramName, location) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const paramNameLower = paramName.toLowerCase();
|
|
40
|
+
let prm;
|
|
41
|
+
for (prm of this.parameters) {
|
|
42
|
+
if (location && location !== prm.location)
|
|
43
|
+
continue;
|
|
44
|
+
if (typeof prm.name === 'string') {
|
|
45
|
+
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
46
|
+
if (prm._nameLower === paramNameLower)
|
|
47
|
+
return prm;
|
|
48
|
+
}
|
|
49
|
+
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
43
50
|
return prm;
|
|
44
51
|
}
|
|
45
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Combine, StrictOmit, TypeThunkAsync } from 'ts-gems';
|
|
2
2
|
import type { OpraSchema } from '../../schema/index.js';
|
|
3
|
-
import { HttpParameterLocation } from '../../schema/types.js';
|
|
4
3
|
import { DocumentElement } from '../common/document-element.js';
|
|
5
4
|
import { Value } from '../common/value.js';
|
|
6
5
|
import { DataType } from '../data-type/data-type.js';
|
|
@@ -46,7 +45,7 @@ declare class HttpParameterClass extends Value {
|
|
|
46
45
|
deprecated?: boolean | string;
|
|
47
46
|
required?: boolean;
|
|
48
47
|
arraySeparator?: string;
|
|
49
|
-
location: HttpParameterLocation;
|
|
48
|
+
location: OpraSchema.HttpParameterLocation;
|
|
50
49
|
toJSON(): OpraSchema.HttpParameter;
|
|
51
50
|
}
|
|
52
51
|
export {};
|