Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F9583674
subject-path.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
subject-path.js
View Options
var
clone
=
require
(
"clone"
);
var
SubjectPath
=
function
(
subject_path
){
this
.
elements
=
[];
this
.
subject_type_instance
=
null
;
this
.
_init
(
subject_path
);
}
SubjectPath
.
prototype
=
new
function
(){
this
.
_init
=
function
(
subject_path
){
this
.
_load_path_elements
(
subject_path
);
}
this
.
_load_path_elements
=
function
(
subject_path
){
if
(
subject_path
instanceof
SubjectPath
){
this
.
_from_path
(
subject_path
);
}
else
if
(
typeof
subject_path
===
"string"
){
this
.
_from_string
(
subject_path
);
}
else
if
(
subject_path
instanceof
Array
){
this
.
_from_array
(
subject_path
);
}
}
this
.
_from_string
=
function
(
description_string
){
this
.
elements
=
description_string
.
split
(
"."
);
}
this
.
_from_array
=
function
(
description_array
){
this
.
elements
=
clone
(
description_array
);
}
this
.
_from_path
=
function
(
subject
){
this
.
elements
=
clone
(
subject
.
elements
);
}
this
.
clone
=
function
(){
var
cloned_elements
=
clone
(
this
.
elements
);
return
new
SubjectPath
(
cloned_elements
);
}
this
.
tail
=
function
(){
return
new
SubjectPath
(
this
.
elements
.
slice
(
1
))
}
this
.
head
=
function
(){
return
this
.
elements
[
0
];
}
}
module
.
exports
=
SubjectPath
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 10:24 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
983714
Default Alt Text
subject-path.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment