@opra/common 0.33.3 → 0.33.4
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
CHANGED
|
@@ -1950,6 +1950,7 @@ var Resource = class _Resource {
|
|
|
1950
1950
|
};
|
|
1951
1951
|
|
|
1952
1952
|
// ../../build/common/esm/document/resource/container-class.js
|
|
1953
|
+
var PATH_PREFIX_PATTERN = /^(\/*)(.+)$/;
|
|
1953
1954
|
var ContainerClass = class _ContainerClass extends Resource {
|
|
1954
1955
|
static {
|
|
1955
1956
|
__name(this, "ContainerClass");
|
|
@@ -1972,6 +1973,7 @@ var ContainerClass = class _ContainerClass extends Resource {
|
|
|
1972
1973
|
}
|
|
1973
1974
|
getResource(path, silent) {
|
|
1974
1975
|
let resource;
|
|
1976
|
+
path = PATH_PREFIX_PATTERN.exec(path)?.[2] || path;
|
|
1975
1977
|
if (path.includes("/")) {
|
|
1976
1978
|
const arr = path.split("/");
|
|
1977
1979
|
let i;
|
|
@@ -5,6 +5,7 @@ const index_js_1 = require("../../exception/index.js");
|
|
|
5
5
|
const index_js_2 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_3 = require("../../schema/index.js");
|
|
7
7
|
const resource_js_1 = require("./resource.js");
|
|
8
|
+
const PATH_PREFIX_PATTERN = /^(\/*)(.+)$/;
|
|
8
9
|
class ContainerClass extends resource_js_1.Resource {
|
|
9
10
|
constructor(owner, init) {
|
|
10
11
|
super(owner instanceof ContainerClass ? owner.document : owner, init);
|
|
@@ -24,6 +25,7 @@ class ContainerClass extends resource_js_1.Resource {
|
|
|
24
25
|
}
|
|
25
26
|
getResource(path, silent) {
|
|
26
27
|
let resource;
|
|
28
|
+
path = PATH_PREFIX_PATTERN.exec(path)?.[2] || path;
|
|
27
29
|
if (path.includes('/')) {
|
|
28
30
|
const arr = path.split('/');
|
|
29
31
|
let i;
|
|
@@ -2,6 +2,7 @@ import { NotAcceptableError, ResourceNotAvailableError } from '../../exception/i
|
|
|
2
2
|
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
3
|
import { OpraSchema } from '../../schema/index.js';
|
|
4
4
|
import { Resource } from './resource.js';
|
|
5
|
+
const PATH_PREFIX_PATTERN = /^(\/*)(.+)$/;
|
|
5
6
|
export class ContainerClass extends Resource {
|
|
6
7
|
constructor(owner, init) {
|
|
7
8
|
super(owner instanceof ContainerClass ? owner.document : owner, init);
|
|
@@ -21,6 +22,7 @@ export class ContainerClass extends Resource {
|
|
|
21
22
|
}
|
|
22
23
|
getResource(path, silent) {
|
|
23
24
|
let resource;
|
|
25
|
+
path = PATH_PREFIX_PATTERN.exec(path)?.[2] || path;
|
|
24
26
|
if (path.includes('/')) {
|
|
25
27
|
const arr = path.split('/');
|
|
26
28
|
let i;
|