Socket
Socket
Sign inDemoInstall

camel-case

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

camel-case - npm Package Compare versions

Comparing version 4.1.2 to 5.0.0

6

dist/index.d.ts

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

import { Options } from "pascal-case";
export { Options };
export declare function camelCaseTransform(input: string, index: number): string;
export declare function camelCaseTransformMerge(input: string, index: number): string;
import { Options } from "no-case";
export type { Options };
export declare function camelCase(input: string, options?: Options): string;

@@ -1,23 +0,16 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.camelCase = exports.camelCaseTransformMerge = exports.camelCaseTransform = void 0;
var tslib_1 = require("tslib");
var pascal_case_1 = require("pascal-case");
function camelCaseTransform(input, index) {
if (index === 0)
return input.toLowerCase();
return pascal_case_1.pascalCaseTransform(input, index);
import { split, toLower, toUpper } from "no-case";
export function camelCase(input, options) {
const lower = toLower(options?.locale);
const upper = toUpper(options?.locale);
return split(input, options)
.map((word, index) => {
if (index === 0) {
return lower(word);
}
const char0 = word[0];
const initial = char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
return initial + lower(word.slice(1));
})
.join("");
}
exports.camelCaseTransform = camelCaseTransform;
function camelCaseTransformMerge(input, index) {
if (index === 0)
return input.toLowerCase();
return pascal_case_1.pascalCaseTransformMerge(input);
}
exports.camelCaseTransformMerge = camelCaseTransformMerge;
function camelCase(input, options) {
if (options === void 0) { options = {}; }
return pascal_case_1.pascalCase(input, tslib_1.__assign({ transform: camelCaseTransform }, options));
}
exports.camelCase = camelCase;
//# sourceMappingURL=index.js.map
{
"name": "camel-case",
"version": "4.1.2",
"version": "5.0.0",
"description": "Transform into a string with the separator denoted by the next 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/camel-case#readme",
"size-limit": [
{
"path": "dist/index.js",
"limit": "450 B"
}
],
"jest": {
"roots": [
"<rootDir>/src/"
],
"transform": {
"\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
},
"publishConfig": {

@@ -74,18 +48,4 @@ "access": "public"

"dependencies": {
"pascal-case": "^3.1.2",
"tslib": "^2.0.3"
},
"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"
"no-case": "^4.0.0"
}
}
# Camel Case
[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Bundle size][bundlephobia-image]][bundlephobia-url]
> Transform into a string with the separator denoted by the next word capitalized.

@@ -41,8 +37,1 @@

MIT
[npm-image]: https://img.shields.io/npm/v/camel-case.svg?style=flat
[npm-url]: https://npmjs.org/package/camel-case
[downloads-image]: https://img.shields.io/npm/dm/camel-case.svg?style=flat
[downloads-url]: https://npmjs.org/package/camel-case
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/camel-case.svg
[bundlephobia-url]: https://bundlephobia.com/result?p=camel-case

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