@stdlib/string-uppercase
Advanced tools
Sorry, the diff of this file is not supported yet
| /// <reference path="../docs/types/index.d.ts" /> | ||
| import uppercase from '../docs/types/index'; | ||
| export = uppercase; |
| "use strict";var a=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var t=a(function(v,i){ | ||
| var s=require('@stdlib/assert-is-string/dist').isPrimitive,u=require('@stdlib/error-tools-fmtprodmsg/dist');function n(r){if(!s(r))throw new TypeError(u('1Pv3B',r));return r.toUpperCase()}i.exports=n | ||
| });var o=t();module.exports=o; | ||
| /** @license Apache-2.0 */ | ||
| //# sourceMappingURL=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' );\n\n\n// MAIN //\n\n/**\n* Converts a string to uppercase.\n*\n* @param {string} str - string to convert\n* @throws {TypeError} must provide a string\n* @returns {string} uppercase string\n*\n* @example\n* var str = uppercase( 'bEEp' );\n* // returns 'BEEP'\n*/\nfunction uppercase( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', str ) );\n\t}\n\treturn str.toUpperCase();\n}\n\n\n// EXPORTS //\n\nmodule.exports = uppercase;\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* Convert a string to uppercase.\n*\n* @module @stdlib/string-uppercase\n*\n* @example\n* var uppercase = require( '@stdlib/string-uppercase' );\n*\n* var str = uppercase( 'bEEp' );\n* // returns 'BEEP'\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,EAgB9C,SAASC,EAAWC,EAAM,CACzB,GAAK,CAACH,EAAUG,CAAI,EACnB,MAAM,IAAI,UAAWF,EAAQ,wDAAyDE,CAAI,CAAE,EAE7F,OAAOA,EAAI,YAAY,CACxB,CAKAJ,EAAO,QAAUG,ICfjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", | ||
| "names": ["require_main", "__commonJSMin", "exports", "module", "isString", "format", "uppercase", "str", "main"] | ||
| } |
+50
| /** | ||
| * @license Apache-2.0 | ||
| * | ||
| * Copyright (c) 2018 The Stdlib Authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| 'use strict'; | ||
| // MODULES // | ||
| var isString = require( '@stdlib/assert-is-string' ).isPrimitive; | ||
| var format = require( '@stdlib/string-format' ); | ||
| // MAIN // | ||
| /** | ||
| * Converts a string to uppercase. | ||
| * | ||
| * @param {string} str - string to convert | ||
| * @throws {TypeError} must provide a string | ||
| * @returns {string} uppercase string | ||
| * | ||
| * @example | ||
| * var str = uppercase( 'bEEp' ); | ||
| * // returns 'BEEP' | ||
| */ | ||
| function uppercase( str ) { | ||
| if ( !isString( str ) ) { | ||
| throw new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', str ) ); | ||
| } | ||
| return str.toUpperCase(); | ||
| } | ||
| // EXPORTS // | ||
| module.exports = uppercase; |
@@ -19,3 +19,3 @@ /* | ||
| // TypeScript Version: 2.0 | ||
| // TypeScript Version: 4.1 | ||
@@ -22,0 +22,0 @@ /** |
+2
-2
@@ -35,3 +35,3 @@ /** | ||
| var uppercase = require( './uppercase.js' ); | ||
| var main = require( './main.js' ); | ||
@@ -41,2 +41,2 @@ | ||
| module.exports = uppercase; | ||
| module.exports = main; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2022 The Stdlib Authors. | ||
| Copyright (c) 2016-2023 The Stdlib Authors. |
+6
-19
| { | ||
| "name": "@stdlib/string-uppercase", | ||
| "version": "0.0.9", | ||
| "version": "0.1.0", | ||
| "description": "Convert a string to uppercase.", | ||
@@ -16,5 +16,2 @@ "license": "Apache-2.0", | ||
| ], | ||
| "bin": { | ||
| "uppercase": "./bin/cli" | ||
| }, | ||
| "main": "./lib", | ||
@@ -44,20 +41,10 @@ "directories": { | ||
| "dependencies": { | ||
| "@stdlib/assert-is-string": "^0.0.x", | ||
| "@stdlib/cli-ctor": "^0.0.x", | ||
| "@stdlib/fs-read-file": "^0.0.x", | ||
| "@stdlib/process-read-stdin": "^0.0.x", | ||
| "@stdlib/streams-node-stdin": "^0.0.x", | ||
| "@stdlib/string-format": "^0.0.x" | ||
| "@stdlib/assert-is-string": "^0.1.0", | ||
| "@stdlib/string-format": "^0.1.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@stdlib/assert-is-browser": "^0.0.x", | ||
| "@stdlib/assert-is-windows": "^0.0.x", | ||
| "@stdlib/bench": "^0.0.x", | ||
| "@stdlib/process-exec-path": "^0.0.x", | ||
| "@stdlib/string-from-code-point": "^0.0.x", | ||
| "@stdlib/string-replace": "^0.0.x", | ||
| "tape": "git+https://github.com/kgryte/tape.git#fix/globby", | ||
| "proxyquire": "^2.0.0", | ||
| "istanbul": "^0.4.1", | ||
| "tap-spec": "5.x.x" | ||
| "tap-min": "git+https://github.com/Planeshifter/tap-min.git" | ||
| }, | ||
@@ -94,5 +81,5 @@ "engines": { | ||
| "funding": { | ||
| "type": "patreon", | ||
| "url": "https://www.patreon.com/athan" | ||
| "type": "opencollective", | ||
| "url": "https://opencollective.com/stdlib" | ||
| } | ||
| } |
+26
-71
@@ -21,2 +21,13 @@ <!-- | ||
| <details> | ||
| <summary> | ||
| About stdlib... | ||
| </summary> | ||
| <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p> | ||
| <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p> | ||
| <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p> | ||
| <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p> | ||
| </details> | ||
| # uppercase | ||
@@ -54,3 +65,3 @@ | ||
| Converts a `string` to uppercase. | ||
| Converts a string to uppercase. | ||
@@ -75,5 +86,3 @@ ```javascript | ||
| var str; | ||
| str = uppercase( 'Beep' ); | ||
| var str = uppercase( 'Beep' ); | ||
| // returns 'BEEP' | ||
@@ -98,63 +107,4 @@ | ||
| * * * | ||
| <section class="cli"> | ||
| ## CLI | ||
| <section class="installation"> | ||
| ## Installation | ||
| To use the module as a general utility, install the module globally | ||
| ```bash | ||
| npm install -g @stdlib/string-uppercase | ||
| ``` | ||
| </section> | ||
| <!-- CLI usage documentation. --> | ||
| <section class="usage"> | ||
| ### Usage | ||
| ```text | ||
| Usage: uppercase [options] [<string>] | ||
| Options: | ||
| -h, --help Print this message. | ||
| -V, --version Print the package version. | ||
| ``` | ||
| </section> | ||
| <!-- /.usage --> | ||
| <section class="examples"> | ||
| ### Examples | ||
| ```bash | ||
| $ uppercase bEEp | ||
| BEEP | ||
| ``` | ||
| To use as a [standard stream][standard-streams], | ||
| ```bash | ||
| $ echo -n 'bEEp' | uppercase | ||
| BEEP | ||
| ``` | ||
| </section> | ||
| <!-- /.examples --> | ||
| </section> | ||
| <!-- /.cli --> | ||
| <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> | ||
@@ -164,8 +114,7 @@ | ||
| * * * | ||
| ## See Also | ||
| - <span class="package-name">[`@stdlib/string/capitalize`][@stdlib/string/capitalize]</span><span class="delimiter">: </span><span class="description">capitalize the first character in a string.</span> | ||
| - <span class="package-name">[`@stdlib/string/lowercase`][@stdlib/string/lowercase]</span><span class="delimiter">: </span><span class="description">convert a string to lowercase.</span> | ||
| - <span class="package-name">[`@stdlib/string-uppercase-cli`][@stdlib/string-uppercase-cli]</span><span class="delimiter">: </span><span class="description">CLI package for use as a command-line utility.</span> | ||
| - <span class="package-name">[`@stdlib/string-capitalize`][@stdlib/string/capitalize]</span><span class="delimiter">: </span><span class="description">capitalize the first character in a string.</span> | ||
| - <span class="package-name">[`@stdlib/string-lowercase`][@stdlib/string/lowercase]</span><span class="delimiter">: </span><span class="description">convert a string to lowercase.</span> | ||
@@ -202,3 +151,3 @@ </section> | ||
| Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. | ||
@@ -213,7 +162,9 @@ </section> | ||
| [@stdlib/string-uppercase-cli]: https://www.npmjs.com/package/@stdlib/string-uppercase-cli | ||
| [npm-image]: http://img.shields.io/npm/v/@stdlib/string-uppercase.svg | ||
| [npm-url]: https://npmjs.org/package/@stdlib/string-uppercase | ||
| [test-image]: https://github.com/stdlib-js/string-uppercase/actions/workflows/test.yml/badge.svg?branch=v0.0.9 | ||
| [test-url]: https://github.com/stdlib-js/string-uppercase/actions/workflows/test.yml?query=branch:v0.0.9 | ||
| [test-image]: https://github.com/stdlib-js/string-uppercase/actions/workflows/test.yml/badge.svg?branch=v0.1.0 | ||
| [test-url]: https://github.com/stdlib-js/string-uppercase/actions/workflows/test.yml?query=branch:v0.1.0 | ||
@@ -231,3 +182,3 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-uppercase/main.svg | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
| [chat-url]: https://gitter.im/stdlib-js/stdlib/ | ||
| [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im | ||
@@ -238,2 +189,6 @@ [stdlib]: https://github.com/stdlib-js/stdlib | ||
| [cli-section]: https://github.com/stdlib-js/string-uppercase#cli | ||
| [cli-url]: https://github.com/stdlib-js/string-uppercase/tree/cli | ||
| [@stdlib/string-uppercase]: https://github.com/stdlib-js/string-uppercase/tree/main | ||
| [umd]: https://github.com/umdjs/umd | ||
@@ -240,0 +195,0 @@ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules |
Sorry, the diff of this file is not supported yet
| {{alias}}( str ) | ||
| Converts a `string` to uppercase. | ||
| Parameters | ||
| ---------- | ||
| str: string | ||
| Input string. | ||
| Returns | ||
| ------- | ||
| out: string | ||
| Uppercase string. | ||
| Examples | ||
| -------- | ||
| > var out = {{alias}}( 'bEEp' ) | ||
| 'BEEP' | ||
| See Also | ||
| -------- | ||
| /* | ||
| * @license Apache-2.0 | ||
| * | ||
| * Copyright (c) 2019 The Stdlib Authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| import uppercase = require( './index' ); | ||
| // TESTS // | ||
| // The function returns a string... | ||
| { | ||
| uppercase( 'Last man standing' ); // $ExpectType string | ||
| } | ||
| // The function does not compile if provided a value other than a string... | ||
| { | ||
| uppercase( true ); // $ExpectError | ||
| uppercase( false ); // $ExpectError | ||
| uppercase( null ); // $ExpectError | ||
| uppercase( undefined ); // $ExpectError | ||
| uppercase( 5 ); // $ExpectError | ||
| uppercase( [] ); // $ExpectError | ||
| uppercase( {} ); // $ExpectError | ||
| uppercase( ( x: number ): number => x ); // $ExpectError | ||
| } | ||
| // The function does not compile if provided insufficient arguments... | ||
| { | ||
| uppercase(); // $ExpectError | ||
| } |
| Usage: uppercase [options] [<string>] | ||
| Options: | ||
| -h, --help Print this message. | ||
| -V, --version Print the package version. | ||
| { | ||
| "boolean": [ | ||
| "help", | ||
| "version" | ||
| ], | ||
| "alias": { | ||
| "help": [ | ||
| "h" | ||
| ], | ||
| "version": [ | ||
| "V" | ||
| ] | ||
| } | ||
| } |
| /** | ||
| * @license Apache-2.0 | ||
| * | ||
| * Copyright (c) 2018 The Stdlib Authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| 'use strict'; | ||
| // MODULES // | ||
| var isString = require( '@stdlib/assert-is-string' ).isPrimitive; | ||
| var format = require( '@stdlib/string-format' ); | ||
| // MAIN // | ||
| /** | ||
| * Converts a string to uppercase. | ||
| * | ||
| * @param {string} str - string to convert | ||
| * @throws {TypeError} must provide a string | ||
| * @returns {string} uppercase string | ||
| * | ||
| * @example | ||
| * var str = uppercase( 'bEEp' ); | ||
| * // returns 'BEEP' | ||
| */ | ||
| function uppercase( str ) { | ||
| if ( !isString( str ) ) { | ||
| throw new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', str ) ); | ||
| } | ||
| return str.toUpperCase(); | ||
| } | ||
| // EXPORTS // | ||
| module.exports = uppercase; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25593
1.8%2
-66.67%4
-60%0
-100%11
-8.33%112
-28.66%208
-17.79%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated