diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 952a131..b61e587 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -81,21 +81,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - name: 'Update dependencies in package.json' run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 445db1f..474004b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -149,11 +149,6 @@ jobs: # Add link definition for CLI package to README.md: find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
/
\n\n[$escapedPkg]: https:\/\/www.npmjs.com\/package\/$escapedPkg/" - # Replace LICENSE comments with abbreviated ones: - - name: 'Replace LICENSE comments with abbreviated ones' - run: | - find . -name "*.js" -type f -exec perl -i -p0e 's|/\*\*\n\*\s\@license\sApache-2.0\n\*\n\*\sCopyright\s\(c\)\s\d{4}\sThe\sStdlib\sAuthors\.\n(.*?)\n\*\slimitations\sunder\sthe\sLicense\.\n\*/|// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0|s' {} \; - # Replace GitHub MathJax equations with SVGs: - name: 'Replace GitHub MathJax equations with SVGs' run: | diff --git a/.github/workflows/publish_cli.yml b/.github/workflows/publish_cli.yml index e347171..02da0eb 100644 --- a/.github/workflows/publish_cli.yml +++ b/.github/workflows/publish_cli.yml @@ -103,11 +103,6 @@ jobs: SLUG=${{ github.repository }} git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" --follow-tags - # Replace LICENSE comments with abbreviated ones: - - name: 'Replace LICENSE comments with abbreviated ones' - run: | - find . -name "bin/cli" -type f -exec perl -i -p0e 's|/\*\*\n\*\s\@license\sApache-2.0\n\*\n\*\sCopyright\s\(c\)\s\d{4}\sThe\sStdlib\sAuthors\.\n(.*?)\n\*\slimitations\sunder\sthe\sLicense\.\n\*/|// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0|s' {} \; - # Replace GitHub MathJax equations with SVGs: - name: 'Replace GitHub MathJax equations with SVGs' run: | diff --git a/README.md b/README.md index 032c760..ca013fd 100644 --- a/README.md +++ b/README.md @@ -258,8 +258,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. [npm-image]: http://img.shields.io/npm/v/@stdlib/string-kebabcase.svg [npm-url]: https://npmjs.org/package/@stdlib/string-kebabcase -[test-image]: https://github.com/stdlib-js/string-kebabcase/actions/workflows/test.yml/badge.svg?branch=v0.0.7 -[test-url]: https://github.com/stdlib-js/string-kebabcase/actions/workflows/test.yml?query=branch:v0.0.7 +[test-image]: https://github.com/stdlib-js/string-kebabcase/actions/workflows/test.yml/badge.svg?branch=main +[test-url]: https://github.com/stdlib-js/string-kebabcase/actions/workflows/test.yml?query=branch:main [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-kebabcase/main.svg [coverage-url]: https://codecov.io/github/stdlib-js/string-kebabcase?branch=main diff --git a/bin/cli b/bin/cli old mode 100644 new mode 100755 diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..86cbf42 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import kebabcase from '../docs/types/index'; +export = kebabcase; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..a101d24 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5 @@ +"use strict";var t=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var a=t(function(p,i){ +var s=require('@stdlib/assert-is-string/dist').isPrimitive,u=require('@stdlib/error-tools-fmtprodmsg/dist'),n=require('@stdlib/string-base-kebabcase/dist');function o(r){if(!s(r))throw new TypeError(u('1Oj3B',r));return n(r)}i.exports=o +});var v=a();module.exports=v; +/** @license Apache-2.0 */ +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..8203140 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../lib/main.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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 isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\nvar base = require( '@stdlib/string-base-kebabcase' );\n\n\n// MAIN //\n\n/**\n* Converts a string to kebab case.\n*\n* @param {string} str - string to convert\n* @throws {TypeError} must provide a string\n* @returns {string} kebab-cased string\n*\n* @example\n* var str = kebabCase( 'Hello World!' );\n* // returns 'hello-world'\n*\n* @example\n* var str = kebabCase( 'foo bar' );\n* // returns 'foo-bar'\n*\n* @example\n* var str = kebabCase( 'I am a tiny little teapot' );\n* // returns 'i-am-a-tiny-little-teapot'\n*\n* @example\n* var str = kebabCase( 'BEEP boop' );\n* // returns 'beep-boop'\n*\n* @example\n* var str = kebabCase( 'isMobile' );\n* // returns 'is-mobile'\n*/\nfunction kebabCase( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', str ) );\n\t}\n\treturn base( str );\n}\n\n\n// EXPORTS //\n\nmodule.exports = kebabCase;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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* Convert a string to kebab case.\n*\n* @module @stdlib/string-kebabcase\n*\n* @example\n* var kebabcase = require( '@stdlib/string-kebabcase' );\n*\n* var str = kebabcase( 'Foo Bar' );\n* // returns 'foo-bar'\n*\n* str = kebabcase( 'I am a tiny little house' );\n* // returns 'i-am-a-tiny-little-house'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAS,QAAS,uBAAwB,EAC1CC,EAAO,QAAS,+BAAgC,EAgCpD,SAASC,EAAWC,EAAM,CACzB,GAAK,CAACJ,EAAUI,CAAI,EACnB,MAAM,IAAI,UAAWH,EAAQ,wDAAyDG,CAAI,CAAE,EAE7F,OAAOF,EAAME,CAAI,CAClB,CAKAL,EAAO,QAAUI,IC7BjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_main", "__commonJSMin", "exports", "module", "isString", "format", "base", "kebabCase", "str", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 67ac226..3ab8213 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Converts a string to kebab case.