Socket
Socket
Sign inDemoInstall

upper-case

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

upper-case - npm Package Compare versions

Comparing version 2.0.2 to 3.0.0

15

dist/index.js

@@ -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

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