upper-case
Advanced tools
Comparing version 2.0.0 to 2.0.1
/** | ||
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt | ||
*/ | ||
const SUPPORTED_LOCALE = { | ||
var SUPPORTED_LOCALE = { | ||
tr: { | ||
@@ -33,5 +33,5 @@ regexp: /[\u0069]/g, | ||
export function localeUpperCase(str, locale) { | ||
const lang = SUPPORTED_LOCALE[locale.toLowerCase()]; | ||
var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; | ||
if (lang) | ||
return upperCase(str.replace(lang.regexp, m => lang.map[m])); | ||
return upperCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); | ||
return upperCase(str); | ||
@@ -38,0 +38,0 @@ } |
import { upperCase, localeUpperCase } from "."; | ||
const TEST_CASES = [ | ||
var TEST_CASES = [ | ||
["", ""], | ||
@@ -9,17 +9,25 @@ ["test", "TEST"], | ||
]; | ||
const LOCALE_TEST_CASES = [["i", "\u0130", "tr"]]; | ||
describe("upper case", () => { | ||
for (const [input, result] of TEST_CASES) { | ||
it(`${input} -> ${result}`, () => { | ||
var LOCALE_TEST_CASES = [["i", "\u0130", "tr"]]; | ||
describe("upper case", function () { | ||
var _loop_1 = function (input, result) { | ||
it(input + " -> " + result, function () { | ||
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", () => { | ||
for (const [input, result, locale] of LOCALE_TEST_CASES) { | ||
it(`${locale}: ${input} -> ${result}`, () => { | ||
describe("locale upper case", function () { | ||
var _loop_2 = function (input, result, locale) { | ||
it(locale + ": " + input + " -> " + result, function () { | ||
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 |
@@ -6,3 +6,3 @@ "use strict"; | ||
*/ | ||
const SUPPORTED_LOCALE = { | ||
var SUPPORTED_LOCALE = { | ||
tr: { | ||
@@ -36,5 +36,5 @@ regexp: /[\u0069]/g, | ||
function localeUpperCase(str, locale) { | ||
const lang = SUPPORTED_LOCALE[locale.toLowerCase()]; | ||
var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; | ||
if (lang) | ||
return upperCase(str.replace(lang.regexp, m => lang.map[m])); | ||
return upperCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); | ||
return upperCase(str); | ||
@@ -41,0 +41,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const _1 = require("."); | ||
const TEST_CASES = [ | ||
var _1 = require("."); | ||
var TEST_CASES = [ | ||
["", ""], | ||
@@ -11,17 +11,25 @@ ["test", "TEST"], | ||
]; | ||
const LOCALE_TEST_CASES = [["i", "\u0130", "tr"]]; | ||
describe("upper case", () => { | ||
for (const [input, result] of TEST_CASES) { | ||
it(`${input} -> ${result}`, () => { | ||
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); | ||
}); | ||
}; | ||
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", () => { | ||
for (const [input, result, locale] of LOCALE_TEST_CASES) { | ||
it(`${locale}: ${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); | ||
}); | ||
}; | ||
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.0", | ||
"version": "2.0.1", | ||
"description": "Transforms the string to upper case", | ||
@@ -19,3 +19,3 @@ "main": "dist/index.js", | ||
"specs": "jest --coverage", | ||
"test": "npm run build && npm run lint && npm run specs && npm run size", | ||
"test": "npm run build && npm run lint && npm run specs", | ||
"size": "size-limit", | ||
@@ -84,3 +84,6 @@ "prepare": "npm run build" | ||
}, | ||
"gitHead": "55911ca17c2e0c964b9b84143e14e29ffc9ff499" | ||
"dependencies": { | ||
"tslib": "^1.10.0" | ||
}, | ||
"gitHead": "07b68e1a696a1a34090d4f1fc136b1bd467aaa3f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16660
172
0
1
+ Addedtslib@^1.10.0
+ Addedtslib@1.14.1(transitive)