capital-case
Advanced tools
Comparing version 1.0.4 to 2.0.0
import { Options } from "no-case"; | ||
export { Options }; | ||
export declare function capitalCaseTransform(input: string): string; | ||
export type { Options }; | ||
export declare function capitalCase(input: string, options?: Options): string; |
@@ -1,16 +0,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.capitalCase = exports.capitalCaseTransform = void 0; | ||
var tslib_1 = require("tslib"); | ||
var no_case_1 = require("no-case"); | ||
var upper_case_first_1 = require("upper-case-first"); | ||
function capitalCaseTransform(input) { | ||
return upper_case_first_1.upperCaseFirst(input.toLowerCase()); | ||
import { split, toLower, toUpper } from "no-case"; | ||
export function capitalCase(input, options) { | ||
const lower = toLower(options?.locale); | ||
const upper = toUpper(options?.locale); | ||
return split(input, options) | ||
.map((x) => `${upper(x[0])}${lower(x.slice(1))}`) | ||
.join(" "); | ||
} | ||
exports.capitalCaseTransform = capitalCaseTransform; | ||
function capitalCase(input, options) { | ||
if (options === void 0) { options = {}; } | ||
return no_case_1.noCase(input, tslib_1.__assign({ delimiter: " ", transform: capitalCaseTransform }, options)); | ||
} | ||
exports.capitalCase = capitalCase; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "capital-case", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"description": "Transform into a space separated string with each word capitalized", | ||
"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" | ||
}, | ||
@@ -46,25 +43,2 @@ "repository": { | ||
"homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/capital-case#readme", | ||
"size-limit": [ | ||
{ | ||
"path": "dist/index.js", | ||
"limit": "500 B" | ||
} | ||
], | ||
"jest": { | ||
"roots": [ | ||
"<rootDir>/src/" | ||
], | ||
"transform": { | ||
"\\.tsx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"publishConfig": { | ||
@@ -74,19 +48,7 @@ "access": "public" | ||
"dependencies": { | ||
"no-case": "^3.0.4", | ||
"tslib": "^2.0.3", | ||
"upper-case-first": "^2.0.2" | ||
"no-case": "^4.0.0" | ||
}, | ||
"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" | ||
}, | ||
"gitHead": "76a21a7f6f2a226521ef6abd345ff309cbd01fb0" | ||
"@vitest/coverage-v8": "^0.34.5" | ||
} | ||
} |
# Capital Case | ||
[![NPM version][npm-image]][npm-url] | ||
[![NPM downloads][downloads-image]][downloads-url] | ||
[![Bundle size][bundlephobia-image]][bundlephobia-url] | ||
> Transform into a space separated string with each word capitalized. | ||
@@ -31,8 +27,1 @@ | ||
MIT | ||
[npm-image]: https://img.shields.io/npm/v/capital-case.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/capital-case | ||
[downloads-image]: https://img.shields.io/npm/dm/capital-case.svg?style=flat | ||
[downloads-url]: https://npmjs.org/package/capital-case | ||
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/capital-case.svg | ||
[bundlephobia-url]: https://bundlephobia.com/result?p=capital-case |
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
1
1
Yes
3047
5
11
1
27
+ Addedno-case@4.0.0(transitive)
- Removedtslib@^2.0.3
- Removedupper-case-first@^2.0.2
- Removedlower-case@2.0.2(transitive)
- Removedno-case@3.0.4(transitive)
- Removedtslib@2.8.1(transitive)
- Removedupper-case-first@2.0.2(transitive)
Updatedno-case@^4.0.0