Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swap-case

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swap-case - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

12

package.json
{
"name": "swap-case",
"version": "1.1.0",
"version": "1.1.1",
"description": "Swap the case of a string",

@@ -11,3 +11,6 @@ "main": "swap-case.js",

"scripts": {
"test": "istanbul cover _mocha -- -R spec"
"lint": "standard",
"test-std": "mocha -- -R spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail",
"test": "npm run lint && npm run test-cov"
},

@@ -36,4 +39,5 @@ "repository": {

"istanbul": "^0.3.0",
"mocha": "^1.18.2",
"pre-commit": "0.0.9"
"mocha": "^2.2.1",
"pre-commit": "^1.0.6",
"standard": "^3.3.0"
},

@@ -40,0 +44,0 @@ "dependencies": {

# Swap Case
[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]

@@ -13,3 +14,3 @@ [![Test coverage][coveralls-image]][coveralls-url]

```bash
```
npm install swap-case --save

@@ -21,10 +22,10 @@ ```

```javascript
var swapCase = require('swap-case');
var swapCase = require('swap-case')
swapCase(null); //=> ""
swapCase('string'); //=> "STRING"
swapCase('PascalCase'); //=> "pASCALcASE"
swapCase('Iñtërnâtiônàlizætiøn'); //=> "iÑTËRNÂTIÔNÀLIZÆTIØN"
swapCase(null) //=> ""
swapCase('string') //=> "STRING"
swapCase('PascalCase') //=> "pASCALcASE"
swapCase('Iñtërnâtiônàlizætiøn') //=> "iÑTËRNÂTIÔNÀLIZÆTIØN"
swapCase('My String', 'tr'); //=> "mY sTRİNG"
swapCase('My String', 'tr') //=> "mY sTRİNG"
```

@@ -38,2 +39,4 @@

[npm-url]: https://npmjs.org/package/swap-case
[downloads-image]: https://img.shields.io/npm/dm/swap-case.svg?style=flat
[downloads-url]: https://npmjs.org/package/swap-case
[travis-image]: https://img.shields.io/travis/blakeembrey/swap-case.svg?style=flat

@@ -40,0 +43,0 @@ [travis-url]: https://travis-ci.org/blakeembrey/swap-case

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

var upperCase = require('upper-case');
var lowerCase = require('lower-case');
var upperCase = require('upper-case')
var lowerCase = require('lower-case')

@@ -14,15 +14,15 @@ /**

if (str == null) {
return '';
return ''
}
var result = '';
var result = ''
for (var i = 0; i < str.length; i++) {
var c = str[i];
var u = upperCase(c, locale);
var c = str[i]
var u = upperCase(c, locale)
result += u === c ? lowerCase(c, locale) : u;
result += u === c ? lowerCase(c, locale) : u
}
return result;
};
return result
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc