@checksub_team/peaks_timeline 1.4.46 → 1.4.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksub_team/peaks_timeline",
3
- "version": "1.4.46",
3
+ "version": "1.4.47",
4
4
  "description": "JavaScript UI component for displaying audio waveforms",
5
5
  "main": "./peaks.js",
6
6
  "types": "./peaks.js.d.ts",
package/peaks.js CHANGED
@@ -16697,7 +16697,7 @@ module.exports = function (Utils) {
16697
16697
  throw new TypeError('peaks.segments.' + context + ': startTime should be a valid number');
16698
16698
  }
16699
16699
  if (!Utils.isValidTime(options.endTime)) {
16700
- throw new TypeError('peaks.segments.' + context + ': endTime should be a valid number');
16700
+ options.endTime = options.startTime;
16701
16701
  }
16702
16702
  options.startTime = Utils.roundTime(options.startTime);
16703
16703
  options.endTime = Utils.roundTime(options.endTime);
package/src/segment.js CHANGED
@@ -13,13 +13,11 @@ define([
13
13
 
14
14
  function validateSegment(peaks, options, context) {
15
15
  if (!Utils.isValidTime(options.startTime)) {
16
- // eslint-disable-next-line max-len
17
16
  throw new TypeError('peaks.segments.' + context + ': startTime should be a valid number');
18
17
  }
19
18
 
20
19
  if (!Utils.isValidTime(options.endTime)) {
21
- // eslint-disable-next-line max-len
22
- throw new TypeError('peaks.segments.' + context + ': endTime should be a valid number');
20
+ options.endTime = options.startTime;
23
21
  }
24
22
 
25
23
  options.startTime = Utils.roundTime(options.startTime);
@@ -39,12 +37,10 @@ define([
39
37
  options.endTime = Utils.roundTime(options.endTime);
40
38
 
41
39
  if (options.opacity < 0 || options.opacity > 1) {
42
- // eslint-disable-next-line max-len
43
40
  throw new RangeError('peaks.segments.' + context + ': opacity should be between 0 and 1');
44
41
  }
45
42
 
46
43
  if (Utils.isNullOrUndefined(options.labelText)) {
47
- // Set default label text
48
44
  options.labelText = '';
49
45
  }
50
46
  else if (!Utils.isString(options.labelText)) {