Skip to content

Commit

Permalink
substr() to substring()
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed May 19, 2024
1 parent d984f36 commit 2d5f9da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion code/test-corrupt-file-missing-byte.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trk.smfSeqName('Corrupt File: Mising Byte')
.smfText('Thank you!');

var data = smf.dump();
data = data.substr(0, data.length - 1);
data = data.substring(0, data.length - 1);

TEST.write(data);
TEST.play(data);
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ RawClip.prototype.dump = function() {
RawClip.prototype.load = function(s) {
var off = 0;
if (!s.length) _error('Empty file');
if (s.substr(0, 8) != SMF2CLIP) {
if (s.substring(0, 8) != SMF2CLIP) {
var z = s.indexOf(SMF2CLIP);
if (z != -1) {
off += z;
Expand Down Expand Up @@ -207,7 +207,7 @@ if (module.parent) {
}
if (typeof name == 'undefined') {
name = path.basename(process.argv[1]);
if (name.toLowerCase().endsWith('.js')) name = name.substr(0, name.length - 3);
if (name.toLowerCase().endsWith('.js')) name = name.substring(0, name.length - 3);
name = path.join(__dirname, ext == '.midi2' ? 'midi2' : 'midi', name + ext);
}
console.log('Writing ' + name + ' ...');
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "test-midi-files",
"version": "1.0.7",
"version": "1.0.8",
"description": "A framework for producing test MIDI files",
"main": "index.js",
"scripts": {
Expand All @@ -20,18 +20,18 @@
],
"author": "jazz-soft (https://jazz-soft.net)",
"dependencies": {
"jzz": "^1.8.2",
"jzz-gui-player": "^1.7.3",
"jzz": "^1.8.4",
"jzz-gui-player": "^1.7.4",
"jzz-midi-gear": "^1.3.3",
"jzz-midi-gm": "^1.3.6",
"jzz-midi-smf": "^1.9.1",
"jzz-midi-smf": "^1.9.2",
"jzz-synth-tiny": "^1.4.0"
},
"devDependencies": {
"eslint": "^9.0.0",
"eslint": "^9.3.0",
"grunt": "^1.6.1",
"mocha": "^10.4.0",
"node-web-audio-api": "^0.18.0",
"node-web-audio-api": "^0.21.0",
"nyc": "^15.1.0"
},
"runkitExampleFilename": "runkit.js",
Expand Down

0 comments on commit 2d5f9da

Please sign in to comment.