partial replacement with es6 modules

This commit is contained in:
tmshv committed 2016-02-15 17:10:59 +03:00
1 parent 5623c296a1
commit b57d7b09ba
11 files changed
+28 -46

No files matched your search

+5 -9
View File
@@ -1,4 +1,4 @@
const COURSES = [
export const courses = [
{
"id": "painting",
"name": "Живопись"
@@ -29,13 +29,9 @@ const COURSES = [
}
];
exports.courses = COURSES;
exports.course = getCourseByID;
exports.name = getCourseNameByID;
function getCourseByID(id){
for(var i=0; i<COURSES.length; i++){
var p = COURSES[i];
export function getCourseByID(id){
for(var i=0; i<courses.length; i++){
var p = courses[i];
if(p.id == id){
return p;
}
@@ -43,7 +39,7 @@ function getCourseByID(id){
return null;
}
function getCourseNameByID(id){
export function getCourseNameByID(id){
var p = getCourseByID(id);
if(p) return p.name;
else return null;