Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995434
subject-path.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
866 B
Referenced Files
None
Subscribers
None
subject-path.ts
View Options
import
clone
from
"clone"
;
export
type
SubjectPathEquiv
=
string
[]
|
string
|
SubjectPath
;
export
default
class
SubjectPath
{
elements
:
string
[]
=
[];
constructor
(
subject_path
:
SubjectPathEquiv
)
{
if
(
subject_path
instanceof
SubjectPath
)
{
this
.
fromPath
(
subject_path
);
}
else
if
(
typeof
subject_path
===
"string"
)
{
this
.
fromString
(
subject_path
);
}
else
if
(
subject_path
instanceof
Array
)
{
this
.
fromArray
(
subject_path
);
}
}
fromString
(
path
:
string
)
{
this
.
elements
=
path
.
split
(
"."
);
}
fromArray
(
path
:
string
[])
{
this
.
elements
=
clone
(
path
);
}
fromPath
(
path
:
SubjectPath
)
{
this
.
elements
=
clone
(
path
.
elements
);
}
clone
()
{
const
cloned_elements
=
clone
(
this
.
elements
);
return
new
SubjectPath
(
cloned_elements
);
}
tail
()
{
return
new
SubjectPath
(
this
.
elements
.
slice
(
1
));
}
head
()
{
return
this
.
elements
[
0
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Dec 23, 04:28 (13 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556006
Default Alt Text
subject-path.ts (866 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment