Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stdlib/string-capitalize

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/string-capitalize - npm Package Compare versions

Comparing version
0.3.0
to
0.3.1
+1
-1
dist/index.js.map
{
"version": 3,
"sources": ["../lib/main.js", "../lib/index.js"],
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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-capitalize' );\n\n\n// MAIN //\n\n/**\n* Capitalizes the first character in a string.\n*\n* @param {string} str - input string\n* @throws {TypeError} must provide a string\n* @returns {string} capitalized string\n*\n* @example\n* var out = capitalize( 'last man standing' );\n* // returns 'Last man standing'\n*\n* @example\n* var out = capitalize( 'presidential election' );\n* // returns 'Presidential election'\n*\n* @example\n* var out = capitalize( 'javaScript' );\n* // returns 'JavaScript'\n*\n* @example\n* var out = capitalize( 'Hidden Treasures' );\n* // returns 'Hidden Treasures'\n*/\nfunction capitalize( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\treturn base( str );\n}\n\n\n// EXPORTS //\n\nmodule.exports = capitalize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Capitalize the first character in a string.\n*\n* @module @stdlib/string-capitalize\n*\n* @example\n* var capitalize = require( '@stdlib/string-capitalize' );\n*\n* var out = capitalize( 'last man standing' );\n* // returns 'Last man standing'\n*\n* out = capitalize( 'Hidden Treasures' );\n* // returns 'Hidden Treasures';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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-capitalize' );\n\n\n// MAIN //\n\n/**\n* Capitalizes the first character in a string.\n*\n* @param {string} str - input string\n* @throws {TypeError} must provide a string\n* @returns {string} capitalized string\n*\n* @example\n* var out = capitalize( 'last man standing' );\n* // returns 'Last man standing'\n*\n* @example\n* var out = capitalize( 'presidential election' );\n* // returns 'Presidential election'\n*\n* @example\n* var out = capitalize( 'javaScript' );\n* // returns 'JavaScript'\n*\n* @example\n* var out = capitalize( 'Hidden Treasures' );\n* // returns 'Hidden Treasures'\n*/\nfunction capitalize( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\treturn base( str );\n}\n\n\n// EXPORTS //\n\nmodule.exports = capitalize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Capitalize the first character in a string.\n*\n* @module @stdlib/string-capitalize\n*\n* @example\n* var capitalize = require( '@stdlib/string-capitalize' );\n*\n* var out = capitalize( 'last man standing' );\n* // returns 'Last man standing'\n*\n* out = capitalize( 'Hidden Treasures' );\n* // returns 'Hidden Treasures'\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,gCAAiC,EA4BrD,SAASC,EAAYC,EAAM,CAC1B,GAAK,CAACJ,EAAUI,CAAI,EACnB,MAAM,IAAI,UAAWH,EAAQ,kEAAmEG,CAAI,CAAE,EAEvG,OAAOF,EAAME,CAAI,CAClB,CAKAL,EAAO,QAAUI,ICzBjB,IAAIE,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_main", "__commonJSMin", "exports", "module", "isString", "format", "base", "capitalize", "str", "main"]
}

@@ -33,3 +33,3 @@ /**

* out = capitalize( 'Hidden Treasures' );
* // returns 'Hidden Treasures';
* // returns 'Hidden Treasures'
*/

@@ -36,0 +36,0 @@

+1
-1

@@ -1,1 +0,1 @@

Copyright (c) 2016-2024 The Stdlib Authors.
Copyright (c) 2016-2026 The Stdlib Authors.
{
"name": "@stdlib/string-capitalize",
"version": "0.3.0",
"version": "0.3.1",
"description": "Capitalize the first character in a string.",

@@ -33,6 +33,6 @@ "license": "Apache-2.0",

"dependencies": {
"@stdlib/assert-is-string": "^0.2.2",
"@stdlib/string-base-capitalize": "^0.3.0",
"@stdlib/string-format": "^0.2.2",
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
"@stdlib/assert-is-string": "^0.2.3",
"@stdlib/string-base-capitalize": "^0.3.1",
"@stdlib/string-format": "^0.2.3",
"@stdlib/error-tools-fmtprodmsg": "^0.2.3"
},

@@ -69,3 +69,2 @@ "devDependencies": {},

],
"__stdlib__": {},
"funding": {

@@ -72,0 +71,0 @@ "type": "opencollective",

@@ -140,3 +140,3 @@ <!--

Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].

@@ -156,4 +156,4 @@ </section>

[test-image]: https://github.com/stdlib-js/string-capitalize/actions/workflows/test.yml/badge.svg?branch=v0.3.0
[test-url]: https://github.com/stdlib-js/string-capitalize/actions/workflows/test.yml?query=branch:v0.3.0
[test-image]: https://github.com/stdlib-js/string-capitalize/actions/workflows/test.yml/badge.svg?branch=v0.3.1
[test-url]: https://github.com/stdlib-js/string-capitalize/actions/workflows/test.yml?query=branch:v0.3.1

@@ -170,4 +170,4 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-capitalize/main.svg

[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
[chat-url]: https://stdlib.zulipchat.com

@@ -174,0 +174,0 @@ [stdlib]: https://github.com/stdlib-js/stdlib