upper-case
Advanced tools
Comparing version 2.0.2 to 3.0.0
@@ -1,8 +0,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.upperCase = exports.localeUpperCase = void 0; | ||
/** | ||
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt | ||
*/ | ||
var SUPPORTED_LOCALE = { | ||
const SUPPORTED_LOCALE = { | ||
tr: { | ||
@@ -35,16 +32,14 @@ regexp: /[\u0069]/g, | ||
*/ | ||
function localeUpperCase(str, locale) { | ||
var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; | ||
export function localeUpperCase(str, locale) { | ||
const lang = SUPPORTED_LOCALE[locale.toLowerCase()]; | ||
if (lang) | ||
return upperCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); | ||
return upperCase(str.replace(lang.regexp, (m) => lang.map[m])); | ||
return upperCase(str); | ||
} | ||
exports.localeUpperCase = localeUpperCase; | ||
/** | ||
* Upper case as a function. | ||
*/ | ||
function upperCase(str) { | ||
export function upperCase(str) { | ||
return str.toUpperCase(); | ||
} | ||
exports.upperCase = upperCase; | ||
//# sourceMappingURL=index.js.map |
@@ -1,5 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _1 = require("."); | ||
var TEST_CASES = [ | ||
import { describe, it, expect } from "vitest"; | ||
import { upperCase, localeUpperCase } from "./index.js"; | ||
const TEST_CASES = [ | ||
["", ""], | ||
@@ -11,25 +10,17 @@ ["test", "TEST"], | ||
]; | ||
var LOCALE_TEST_CASES = [["i", "\u0130", "tr"]]; | ||
describe("upper case", function () { | ||
var _loop_1 = function (input, result) { | ||
it(input + " -> " + result, function () { | ||
expect(_1.upperCase(input)).toEqual(result); | ||
const LOCALE_TEST_CASES = [["i", "\u0130", "tr"]]; | ||
describe("upper case", () => { | ||
for (const [input, result] of TEST_CASES) { | ||
it(`${input} -> ${result}`, () => { | ||
expect(upperCase(input)).toEqual(result); | ||
}); | ||
}; | ||
for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) { | ||
var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1]; | ||
_loop_1(input, result); | ||
} | ||
}); | ||
describe("locale upper case", function () { | ||
var _loop_2 = function (input, result, locale) { | ||
it(locale + ": " + input + " -> " + result, function () { | ||
expect(_1.localeUpperCase(input, locale)).toEqual(result); | ||
describe("locale upper case", () => { | ||
for (const [input, result, locale] of LOCALE_TEST_CASES) { | ||
it(`${locale}: ${input} -> ${result}`, () => { | ||
expect(localeUpperCase(input, locale)).toEqual(result); | ||
}); | ||
}; | ||
for (var _i = 0, LOCALE_TEST_CASES_1 = LOCALE_TEST_CASES; _i < LOCALE_TEST_CASES_1.length; _i++) { | ||
var _a = LOCALE_TEST_CASES_1[_i], input = _a[0], result = _a[1], locale = _a[2]; | ||
_loop_2(input, result, locale); | ||
} | ||
}); | ||
//# sourceMappingURL=index.spec.js.map |
{ | ||
"name": "upper-case", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Transforms the string to upper case", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"module": "dist.es2015/index.js", | ||
"sideEffects": false, | ||
"jsnext:main": "dist.es2015/index.js", | ||
"type": "module", | ||
"files": [ | ||
"dist/", | ||
"dist.es2015/", | ||
"LICENSE" | ||
"dist/" | ||
], | ||
"exports": { | ||
".": "./dist/index.js" | ||
}, | ||
"scripts": { | ||
"lint": "tslint \"src/**/*\" --project tsconfig.json", | ||
"build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json", | ||
"specs": "jest --coverage", | ||
"test": "npm run build && npm run lint && npm run specs", | ||
"size": "size-limit", | ||
"prepare": "npm run build" | ||
"format": "ts-scripts format", | ||
"specs": "ts-scripts specs", | ||
"test": "ts-scripts test", | ||
"build": "ts-scripts build", | ||
"bench": "vitest bench", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -45,43 +42,5 @@ "repository": { | ||
"homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/upper-case#readme", | ||
"size-limit": [ | ||
{ | ||
"path": "dist/index.js", | ||
"limit": "250 B" | ||
} | ||
], | ||
"jest": { | ||
"roots": [ | ||
"<rootDir>/src/" | ||
], | ||
"transform": { | ||
"\\.tsx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "^2.2.1", | ||
"@types/jest": "^24.0.23", | ||
"@types/node": "^12.12.14", | ||
"jest": "^24.9.0", | ||
"rimraf": "^3.0.0", | ||
"ts-jest": "^24.2.0", | ||
"tslint": "^5.20.1", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^9.0.0", | ||
"typescript": "^4.1.2" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.0.3" | ||
} | ||
} |
# Upper Case | ||
[![NPM version][npm-image]][npm-url] | ||
[![NPM downloads][downloads-image]][downloads-url] | ||
[![Bundle size][bundlephobia-image]][bundlephobia-url] | ||
> Transforms the string to upper case. | ||
@@ -28,8 +24,1 @@ | ||
MIT | ||
[npm-image]: https://img.shields.io/npm/v/upper-case.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/upper-case | ||
[downloads-image]: https://img.shields.io/npm/dm/upper-case.svg?style=flat | ||
[downloads-url]: https://npmjs.org/package/upper-case | ||
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/upper-case.svg | ||
[bundlephobia-url]: https://bundlephobia.com/result?p=upper-case |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
0
Yes
7161
8
76
1
24
- Removedtslib@^2.0.3
- Removedtslib@2.8.0(transitive)