Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openapi-generator-plus/generator-common

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openapi-generator-plus/generator-common - npm Package Compare versions

Comparing version 0.25.0 to 0.25.1

10

dist/case-transforms.js

@@ -15,8 +15,10 @@ "use strict";

function camelCase(value) {
if (value.toLocaleUpperCase() === value) {
value = value.toLocaleLowerCase();
}
/* Find separator characters; remove and upper-case the alphanumeric character imediately after */
value = value.replace(/([^a-zA-Z0-9]+)([a-zA-Z0-9])/g, (whole, sep, letter) => capitalize(letter));
/* If the string starts with capitals, we need to lower-case that first word */
/* If the string starts with capitals, followed by lower-case, we lower-case that first word */
value = value.replace(/^([A-Z]+)([A-Z][a-z])/, (whole, first, next) => first.toLocaleLowerCase() + next);
/* Handle all upper-case words */
value = value.replace(/^([A-Z]+)([^a-zA-Z]|$)/, (whole, first, next) => first.toLocaleLowerCase() + next);
/* If the string starts with a capital letter, lower-case it */
// /* If the string starts with a capital letter, lower-case it */
value = value.replace(/^[A-Z]/, (whole) => whole.toLocaleLowerCase());

@@ -23,0 +25,0 @@ return value;

4

package.json
{
"name": "@openapi-generator-plus/generator-common",
"version": "0.25.0",
"version": "0.25.1",
"description": "Common utilities for openapi-generator-plus generators",

@@ -16,3 +16,3 @@ "main": "dist/index.js",

},
"homepage": "https://github.com/karlvr/openapi-generator-plus-generators#readme",
"homepage": "https://github.com/karlvr/openapi-generator-plus-generators/tree/master/packages/generator-common#readme",
"dependencies": {

@@ -19,0 +19,0 @@ "pluralize": "^8.0.0",

@@ -11,8 +11,10 @@ /** Returns the string with the first character converted to upper-case */

export function camelCase(value: string): string {
if (value.toLocaleUpperCase() === value) {
value = value.toLocaleLowerCase()
}
/* Find separator characters; remove and upper-case the alphanumeric character imediately after */
value = value.replace(/([^a-zA-Z0-9]+)([a-zA-Z0-9])/g, (whole, sep, letter) => capitalize(letter))
/* If the string starts with capitals, we need to lower-case that first word */
/* If the string starts with capitals, followed by lower-case, we lower-case that first word */
value = value.replace(/^([A-Z]+)([A-Z][a-z])/, (whole, first, next) => first.toLocaleLowerCase() + next)
/* Handle all upper-case words */
value = value.replace(/^([A-Z]+)([^a-zA-Z]|$)/, (whole, first, next) => first.toLocaleLowerCase() + next)
/* If the string starts with a capital letter, lower-case it */
// /* If the string starts with a capital letter, lower-case it */
value = value.replace(/^[A-Z]/, (whole) => whole.toLocaleLowerCase())

@@ -19,0 +21,0 @@ return value

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