Page MenuHomeSealhub

subject.js
No OneTemporary

subject.js

"use strict";
const locreq = require("locreq")(__dirname);
const Promise = require("bluebird");
const SubjectPath = locreq("lib/data-structures/subject-path.js");
function Subject (){}
Subject.prototype = new function(){
this.get_subject = function(subject_path){
// This is a recursive function. It traverses the subject tree and returns
// the subject referenced by subject_path
subject_path = new SubjectPath(subject_path);
return Promise.resolve(this.get_child_subject(subject_path.head()))
.then(function(child_subject){
if (subject_path.elements.length === 1){
return child_subject;
} else {
return child_subject.get_subject(subject_path.tail());
}
});
};
};
module.exports = Subject;

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 11, 10:07 (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
984176
Default Alt Text
subject.js (727 B)

Event Timeline