@stdlib/string-to-grapheme-cluster-iterator 0.2.0 → 0.2.2

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/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -257,7 +257,7 @@ See [LICENSE][stdlib-license].
257
257
 
258
258
  ## Copyright
259
259
 
260
- Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
260
+ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
261
261
 
262
262
  </section>
263
263
 
@@ -270,8 +270,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
270
270
  [npm-image]: http://img.shields.io/npm/v/@stdlib/string-to-grapheme-cluster-iterator.svg
271
271
  [npm-url]: https://npmjs.org/package/@stdlib/string-to-grapheme-cluster-iterator
272
272
 
273
- [test-image]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml/badge.svg?branch=v0.2.0
274
- [test-url]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml?query=branch:v0.2.0
273
+ [test-image]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml/badge.svg?branch=v0.2.2
274
+ [test-url]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml?query=branch:v0.2.2
275
275
 
276
276
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-to-grapheme-cluster-iterator/main.svg
277
277
  [coverage-url]: https://codecov.io/github/stdlib-js/string-to-grapheme-cluster-iterator?branch=main
@@ -283,8 +283,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
283
283
 
284
284
  -->
285
285
 
286
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
287
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
286
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
287
+ [chat-url]: https://stdlib.zulipchat.com
288
288
 
289
289
  [stdlib]: https://github.com/stdlib-js/stdlib
290
290
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";var p=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}};var d=p(function(j,m){
2
- var f=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),y=require('@stdlib/assert-is-function/dist'),w=require('@stdlib/assert-is-string/dist').isPrimitive,v=require('@stdlib/symbol-iterator/dist'),s=require('@stdlib/string-next-grapheme-cluster-break/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist');function l(e){var t,a,o,u,r;if(!w(e))throw new TypeError(g('1h1E6',e));if(arguments.length>1){if(u=arguments[1],!y(u))throw new TypeError(g('1h12H',u));t=arguments[2]}return r=0,a={},u?f(a,"next",h):f(a,"next",b),f(a,"return",q),v&&f(a,v,x),a;function h(){var i,n;return o?{done:!0}:(n=s(e,r),n===-1?(o=!0,e.length?{value:u.call(t,e.substring(r),r,e),done:!1}:{done:!0}):(i=u.call(t,e.substring(r,n),r,e),r=n,{value:i,done:!1}))}function b(){var i,n;return o?{done:!0}:(n=s(e,r),n===-1?(o=!0,e.length?{value:e.substring(r),done:!1}:{done:!0}):(i=e.substring(r,n),r=n,{value:i,done:!1}))}function q(i){return o=!0,arguments.length?{value:i,done:!0}:{done:!0}}function x(){return u?l(e,u,t):l(e)}}m.exports=l
2
+ var f=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),y=require('@stdlib/assert-is-function/dist'),w=require('@stdlib/assert-is-string/dist').isPrimitive,v=require('@stdlib/symbol-iterator/dist'),s=require('@stdlib/string-next-grapheme-cluster-break/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist');function l(e){var t,a,o,u,r;if(!w(e))throw new TypeError(g('1h13F',e));if(arguments.length>1){if(u=arguments[1],!y(u))throw new TypeError(g('1h12H',u));t=arguments[2]}return r=0,a={},u?f(a,"next",h):f(a,"next",b),f(a,"return",q),v&&f(a,v,x),a;function h(){var i,n;return o?{done:!0}:(n=s(e,r),n===-1?(o=!0,e.length?{value:u.call(t,e.substring(r),r,e),done:!1}:{done:!0}):(i=u.call(t,e.substring(r,n),r,e),r=n,{value:i,done:!1}))}function b(){var i,n;return o?{done:!0}:(n=s(e,r),n===-1?(o=!0,e.length?{value:e.substring(r),done:!1}:{done:!0}):(i=e.substring(r,n),r=n,{value:i,done:!1}))}function q(i){return o=!0,arguments.length?{value:i,done:!0}:{done:!0}}function x(){return u?l(e,u,t):l(e)}}m.exports=l
3
3
  });var F=d();module.exports=F;
4
4
  /** @license Apache-2.0 */
5
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/main.js", "../lib/index.js"],
4
- "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar iteratorSymbol = require( '@stdlib/symbol-iterator' );\nvar nextGraphemeClusterBreak = require( '@stdlib/string-next-grapheme-cluster-break' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator which iterates over each grapheme cluster in a string.\n*\n* @param {string} src - input value\n* @param {Function} [mapFcn] - function to invoke for each iterated value\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} second argument must be a function\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = graphemeClusters2iterator( '\uD83C\uDF37\uD83C\uDF55' );\n*\n* var v = iter.next().value;\n* // returns '\uD83C\uDF37'\n*\n* v = iter.next().value;\n* // returns '\uD83C\uDF55'\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nfunction graphemeClusters2iterator( src ) {\n\tvar thisArg;\n\tvar iter;\n\tvar FLG;\n\tvar fcn;\n\tvar i;\n\tif ( !isString( src ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be astring. Value: `%s`.', src ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tfcn = arguments[ 1 ];\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tthisArg = arguments[ 2 ];\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tif ( fcn ) {\n\t\tsetReadOnly( iter, 'next', next1 );\n\t} else {\n\t\tsetReadOnly( iter, 'next', next2 );\n\t}\n\tsetReadOnly( iter, 'return', end );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next1() {\n\t\tvar v;\n\t\tvar j;\n\t\tif ( FLG ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj = nextGraphemeClusterBreak( src, i );\n\t\tif ( j === -1 ) {\n\t\t\tFLG = true;\n\t\t\tif ( src.length ) {\n\t\t\t\treturn {\n\t\t\t\t\t'value': fcn.call( thisArg, src.substring( i ), i, src ),\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = fcn.call( thisArg, src.substring( i, j ), i, src );\n\t\ti = j;\n\t\treturn {\n\t\t\t'value': v,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next2() {\n\t\tvar v;\n\t\tvar j;\n\t\tif ( FLG ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj = nextGraphemeClusterBreak( src, i );\n\t\tif ( j === -1 ) {\n\t\t\tFLG = true;\n\t\t\tif ( src.length ) {\n\t\t\t\treturn {\n\t\t\t\t\t'value': src.substring( i ),\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = src.substring( i, j );\n\t\ti = j;\n\t\treturn {\n\t\t\t'value': v,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\tif ( fcn ) {\n\t\t\treturn graphemeClusters2iterator( src, fcn, thisArg );\n\t\t}\n\t\treturn graphemeClusters2iterator( src );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = graphemeClusters2iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator which iterates over grapheme clusters.\n*\n* @module @stdlib/string-to-grapheme-cluster-iterator\n*\n* @example\n* var graphemeClusters2iterator = require( '@stdlib/string-to-grapheme-cluster-iterator' );\n*\n* var iter = graphemeClusters2iterator( '\uD83C\uDF37\uD83C\uDF55' );\n*\n* var v = iter.next().value;\n* // returns '\uD83C\uDF37'\n*\n* v = iter.next().value;\n* // returns '\uD83C\uDF55'\n*\n* var bool = iter.next().done;\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAa,QAAS,4BAA6B,EACnDC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAiB,QAAS,yBAA0B,EACpDC,EAA2B,QAAS,4CAA6C,EACjFC,EAAS,QAAS,uBAAwB,EA2B9C,SAASC,EAA2BC,EAAM,CACzC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACJ,GAAK,CAACV,EAAUK,CAAI,EACnB,MAAM,IAAI,UAAWF,EAAQ,iEAAkEE,CAAI,CAAE,EAEtG,GAAK,UAAU,OAAS,EAAI,CAE3B,GADAI,EAAM,UAAW,CAAE,EACd,CAACV,EAAYU,CAAI,EACrB,MAAM,IAAI,UAAWN,EAAQ,qEAAsEM,CAAI,CAAE,EAE1GH,EAAU,UAAW,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n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar iteratorSymbol = require( '@stdlib/symbol-iterator' );\nvar nextGraphemeClusterBreak = require( '@stdlib/string-next-grapheme-cluster-break' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator which iterates over each grapheme cluster in a string.\n*\n* @param {string} src - input value\n* @param {Function} [mapFcn] - function to invoke for each iterated value\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} second argument must be a function\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = graphemeClusters2iterator( '\uD83C\uDF37\uD83C\uDF55' );\n*\n* var v = iter.next().value;\n* // returns '\uD83C\uDF37'\n*\n* v = iter.next().value;\n* // returns '\uD83C\uDF55'\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nfunction graphemeClusters2iterator( src ) {\n\tvar thisArg;\n\tvar iter;\n\tvar FLG;\n\tvar fcn;\n\tvar i;\n\tif ( !isString( src ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', src ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tfcn = arguments[ 1 ];\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tthisArg = arguments[ 2 ];\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tif ( fcn ) {\n\t\tsetReadOnly( iter, 'next', next1 );\n\t} else {\n\t\tsetReadOnly( iter, 'next', next2 );\n\t}\n\tsetReadOnly( iter, 'return', end );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next1() {\n\t\tvar v;\n\t\tvar j;\n\t\tif ( FLG ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj = nextGraphemeClusterBreak( src, i );\n\t\tif ( j === -1 ) {\n\t\t\tFLG = true;\n\t\t\tif ( src.length ) {\n\t\t\t\treturn {\n\t\t\t\t\t'value': fcn.call( thisArg, src.substring( i ), i, src ),\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = fcn.call( thisArg, src.substring( i, j ), i, src );\n\t\ti = j;\n\t\treturn {\n\t\t\t'value': v,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next2() {\n\t\tvar v;\n\t\tvar j;\n\t\tif ( FLG ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj = nextGraphemeClusterBreak( src, i );\n\t\tif ( j === -1 ) {\n\t\t\tFLG = true;\n\t\t\tif ( src.length ) {\n\t\t\t\treturn {\n\t\t\t\t\t'value': src.substring( i ),\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = src.substring( i, j );\n\t\ti = j;\n\t\treturn {\n\t\t\t'value': v,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\tif ( fcn ) {\n\t\t\treturn graphemeClusters2iterator( src, fcn, thisArg );\n\t\t}\n\t\treturn graphemeClusters2iterator( src );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = graphemeClusters2iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator which iterates over grapheme clusters.\n*\n* @module @stdlib/string-to-grapheme-cluster-iterator\n*\n* @example\n* var graphemeClusters2iterator = require( '@stdlib/string-to-grapheme-cluster-iterator' );\n*\n* var iter = graphemeClusters2iterator( '\uD83C\uDF37\uD83C\uDF55' );\n*\n* var v = iter.next().value;\n* // returns '\uD83C\uDF37'\n*\n* v = iter.next().value;\n* // returns '\uD83C\uDF55'\n*\n* var bool = iter.next().done;\n* // returns true\n*/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A,SAASH,GAAQ,CAChB,IAAIG,EACAC,EACJ,OAAKR,EACG,CACN,KAAQ,EACT,GAEDQ,EAAId,EAA0BG,EAAKK,CAAE,EAChCM,IAAM,IACVR,EAAM,GACDH,EAAI,OACD,CACN,MAASA,EAAI,UAAWK,CAAE,EAC1B,KAAQ,EACT,EAEM,CACN,KAAQ,EACT,IAEDK,EAAIV,EAAI,UAAWK,EAAGM,CAAE,EACxBN,EAAIM,EACG,CACN,MAASD,EACT,KAAQ,EACT,GACD,CASA,SAASF,EAAKI,EAAQ,CAErB,OADAT,EAAM,GACD,UAAU,OACP,CACN,MAASS,EACT,KAAQ,EACT,EAEM,CACN,KAAQ,EACT,CACD,CAQA,SAASH,GAAU,CAClB,OAAKL,EACGL,EAA2BC,EAAKI,EAAKH,CAAQ,EAE9CF,EAA2BC,CAAI,CACvC,CACD,CAKAR,EAAO,QAAUO,ICxJjB,IAAIc,EAAO,IAKX,OAAO,QAAUA",
6
6
  "names": ["require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isFunction", "isString", "iteratorSymbol", "nextGraphemeClusterBreak", "format", "graphemeClusters2iterator", "src", "thisArg", "iter", "FLG", "fcn", "i", "next1", "next2", "end", "factory", "v", "j", "value", "main"]
7
7
  }
@@ -73,7 +73,7 @@ type MapFunction = Nullary | Unary | Binary | Ternary;
73
73
  * Returns an iterator which iterates over each grapheme cluster in a string.
74
74
  *
75
75
  * @param src - input value
76
- * @param mapFc - function to invoke for each iterated value
76
+ * @param mapFcn - function to invoke for each iterated value
77
77
  * @param thisArg - execution context
78
78
  * @returns iterator
79
79
  *
package/lib/main.js CHANGED
@@ -59,7 +59,7 @@ function graphemeClusters2iterator( src ) {
59
59
  var fcn;
60
60
  var i;
61
61
  if ( !isString( src ) ) {
62
- throw new TypeError( format( 'invalid argument. First argument must be astring. Value: `%s`.', src ) );
62
+ throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', src ) );
63
63
  }
64
64
  if ( arguments.length > 1 ) {
65
65
  fcn = arguments[ 1 ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/string-to-grapheme-cluster-iterator",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Create an iterator which iterates over grapheme clusters.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -15,19 +15,12 @@
15
15
  ],
16
16
  "main": "./lib",
17
17
  "directories": {
18
- "benchmark": "./benchmark",
19
18
  "doc": "./docs",
20
- "example": "./examples",
21
19
  "lib": "./lib",
22
- "test": "./test"
20
+ "dist": "./dist"
23
21
  },
24
22
  "types": "./docs/types",
25
- "scripts": {
26
- "test": "make test",
27
- "test-cov": "make test-cov",
28
- "examples": "make examples",
29
- "benchmark": "make benchmark"
30
- },
23
+ "scripts": {},
31
24
  "homepage": "https://stdlib.io",
32
25
  "repository": {
33
26
  "type": "git",
@@ -37,26 +30,15 @@
37
30
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
31
  },
39
32
  "dependencies": {
40
- "@stdlib/assert-is-function": "^0.2.0",
41
- "@stdlib/assert-is-string": "^0.2.0",
42
- "@stdlib/string-format": "^0.2.0",
43
- "@stdlib/string-next-grapheme-cluster-break": "^0.2.0",
44
- "@stdlib/symbol-iterator": "^0.2.0",
45
- "@stdlib/types": "^0.3.1",
46
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
47
- "@stdlib/error-tools-fmtprodmsg": "^0.1.1"
48
- },
49
- "devDependencies": {
50
- "@stdlib/assert-is-iterator-like": "^0.2.0",
51
- "@stdlib/string-num-grapheme-clusters": "^0.1.0",
52
- "@stdlib/utils-noop": "^0.2.0",
53
- "proxyquire": "^2.0.0",
54
- "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
55
- "istanbul": "^0.4.1",
56
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
57
- "@stdlib/bench-harness": "^0.1.2",
58
- "@stdlib/bench": "^0.3.1"
33
+ "@stdlib/assert-is-function": "^0.2.3",
34
+ "@stdlib/assert-is-string": "^0.2.3",
35
+ "@stdlib/string-format": "^0.2.3",
36
+ "@stdlib/string-next-grapheme-cluster-break": "^0.2.2",
37
+ "@stdlib/symbol-iterator": "^0.2.2",
38
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.3",
39
+ "@stdlib/error-tools-fmtprodmsg": "^0.2.3"
59
40
  },
41
+ "devDependencies": {},
60
42
  "engines": {
61
43
  "node": ">=0.10.0",
62
44
  "npm": ">2.7.0"