@stdlib/array-complex64 0.0.6 → 0.2.0

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.
@@ -24,6 +24,7 @@ var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
24
24
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
25
25
  var realf = require( '@stdlib/complex-realf' );
26
26
  var imagf = require( '@stdlib/complex-imagf' );
27
+ var format = require( '@stdlib/string-format' );
27
28
 
28
29
 
29
30
  // MAIN //
@@ -52,7 +53,7 @@ function fromIterator( it ) {
52
53
  } else if ( isComplexLike( z ) ) {
53
54
  out.push( realf( z ), imagf( z ) );
54
55
  } else {
55
- return new TypeError( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `'+z+'`.' );
56
+ return new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );
56
57
  }
57
58
  }
58
59
  return out;
@@ -24,6 +24,7 @@ var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
24
24
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
25
25
  var realf = require( '@stdlib/complex-realf' );
26
26
  var imagf = require( '@stdlib/complex-imagf' );
27
+ var format = require( '@stdlib/string-format' );
27
28
 
28
29
 
29
30
  // MAIN //
@@ -57,7 +58,7 @@ function fromIteratorMap( it, clbk, thisArg ) {
57
58
  } else if ( isComplexLike( z ) ) {
58
59
  out.push( realf( z ), imagf( z ) );
59
60
  } else {
60
- return new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+z+'`.' );
61
+ return new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );
61
62
  }
62
63
  }
63
64
  return out;