Skip to content

Commit

Permalink
Grunt ts -- in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Sep 15, 2023
1 parent ce2aa8d commit 9977664
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,40 @@ module.exports = function(grunt) {
}
}
});
grunt.task.registerTask('ts', 'Check index.d.ts', function() {
var JZZ = require('.');
function H1() {}
JZZ.lib.copyMidiHelpers(H1);
function H2() {}
JZZ.lib.copyUmpHelpers(H2);
var ts = grunt.file.read('index.d.ts').split(/\r?\n/);
var list = {};
var current;
var i, j, k;
for (i = 0; i < ts.length; i++) {
var match = ts[i].match(/namespace\s+(\S+)/);
if (match) {
current = {};
list['namespace ' + match[1]] = current;
continue;
}
match = ts[i].match(/interface\s+(\S+)/);
if (match) {
if (match[1] == 'Constructor') continue;
current = {};
list['interface ' + match[1]] = current;
continue;
}
match = ts[i].match(/\s+(\S+)\(/);
if (match) {
current[match[1]] = true;
}
var M1 = ['namespace MIDI'];
for (j = 0; j < M1.length; j++) {
//console.log(list[M1[j]]);
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ['jshint', 'uglify', 'version']);
Expand Down

0 comments on commit 9977664

Please sign in to comment.