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

@commitlint/ensure

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/ensure - npm Package Compare versions

Comparing version 8.3.4 to 9.0.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [9.0.0](https://github.com/conventional-changelog/commitlint/compare/v8.3.5...v9.0.0) (2020-05-21)
### Bug Fixes
* [#840](https://github.com/conventional-changelog/commitlint/issues/840) add caret to lodash versions ([#843](https://github.com/conventional-changelog/commitlint/issues/843)) ([ffc0bac](https://github.com/conventional-changelog/commitlint/commit/ffc0bac26993acb2ab6a8fa51065f93c92b0d644))
## [8.3.4](https://github.com/conventional-changelog/commitlint/compare/v8.3.3...v8.3.4) (2020-01-03)

@@ -8,0 +19,0 @@

2

lib/case.d.ts

@@ -0,4 +1,4 @@

import { TargetCaseType } from '@commitlint/types';
export default ensureCase;
declare type TargetCaseType = 'camel-case' | 'kebab-case' | 'snake-case' | 'pascal-case' | 'start-case' | 'upper-case' | 'uppercase' | 'sentence-case' | 'sentencecase' | 'lower-case' | 'lowercase' | 'lowerCase';
declare function ensureCase(raw?: string, target?: TargetCaseType): boolean;
//# sourceMappingURL=case.d.ts.map
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
var _ = __importStar(require("lodash"));
exports["default"] = ensureCase;
function ensureCase(raw, target) {
if (raw === void 0) { raw = ''; }
if (target === void 0) { target = 'lowercase'; }
Object.defineProperty(exports, "__esModule", { value: true });
const camelCase_1 = __importDefault(require("lodash/camelCase"));
const kebabCase_1 = __importDefault(require("lodash/kebabCase"));
const snakeCase_1 = __importDefault(require("lodash/snakeCase"));
const upperFirst_1 = __importDefault(require("lodash/upperFirst"));
const startCase_1 = __importDefault(require("lodash/startCase"));
exports.default = ensureCase;
function ensureCase(raw = '', target = 'lowercase') {
// We delete any content together with quotes because he can contains proper names (example `refactor: `Eslint` configuration`).
// We need trim string because content with quotes can be at the beginning or end of a line
var input = String(raw)
const input = String(raw)
.replace(/`.*?`|".*?"|'.*?'/g, '')
.trim();
var transformed = toCase(input, target);
const transformed = toCase(input, target);
if (transformed === '' || transformed.match(/^\d/)) {

@@ -29,11 +27,11 @@ return true;

case 'camel-case':
return _.camelCase(input);
return camelCase_1.default(input);
case 'kebab-case':
return _.kebabCase(input);
return kebabCase_1.default(input);
case 'snake-case':
return _.snakeCase(input);
return snakeCase_1.default(input);
case 'pascal-case':
return _.upperFirst(_.camelCase(input));
return upperFirst_1.default(camelCase_1.default(input));
case 'start-case':
return _.startCase(input);
return startCase_1.default(input);
case 'upper-case':

@@ -50,5 +48,5 @@ case 'uppercase':

default:
throw new TypeError("ensure-case: Unknown target case \"" + target + "\"");
throw new TypeError(`ensure-case: Unknown target case "${target}"`);
}
}
//# sourceMappingURL=case.js.map
"use strict";
exports.__esModule = true;
exports["default"] = (function (value, enums) {
if (enums === void 0) { enums = []; }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (value, enums = []) => {
if (value === undefined) {

@@ -12,3 +11,3 @@ return false;

return enums.indexOf(value) > -1;
});
};
//# sourceMappingURL=enum.js.map

@@ -5,15 +5,15 @@ "use strict";

};
exports.__esModule = true;
var case_1 = __importDefault(require("./case"));
exports["case"] = case_1["default"];
var enum_1 = __importDefault(require("./enum"));
exports["enum"] = enum_1["default"];
var max_length_1 = __importDefault(require("./max-length"));
exports.maxLength = max_length_1["default"];
var max_line_length_1 = __importDefault(require("./max-line-length"));
exports.maxLineLength = max_line_length_1["default"];
var min_length_1 = __importDefault(require("./min-length"));
exports.minLength = min_length_1["default"];
var not_empty_1 = __importDefault(require("./not-empty"));
exports.notEmpty = not_empty_1["default"];
Object.defineProperty(exports, "__esModule", { value: true });
const case_1 = __importDefault(require("./case"));
exports.case = case_1.default;
const enum_1 = __importDefault(require("./enum"));
exports.enum = enum_1.default;
const max_length_1 = __importDefault(require("./max-length"));
exports.maxLength = max_length_1.default;
const max_line_length_1 = __importDefault(require("./max-line-length"));
exports.maxLineLength = max_line_length_1.default;
const min_length_1 = __importDefault(require("./min-length"));
exports.minLength = min_length_1.default;
const not_empty_1 = __importDefault(require("./not-empty"));
exports.notEmpty = not_empty_1.default;
//# sourceMappingURL=index.js.map
"use strict";
exports.__esModule = true;
exports["default"] = (function (value, max) {
return typeof value === 'string' && value.length <= max;
});
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (value, max) => typeof value === 'string' && value.length <= max;
//# sourceMappingURL=max-length.js.map

@@ -5,8 +5,6 @@ "use strict";

};
exports.__esModule = true;
var max_length_1 = __importDefault(require("./max-length"));
exports["default"] = (function (value, max) {
return typeof value === 'string' &&
value.split(/\r?\n/).every(function (line) { return max_length_1["default"](line, max); });
});
Object.defineProperty(exports, "__esModule", { value: true });
const max_length_1 = __importDefault(require("./max-length"));
exports.default = (value, max) => typeof value === 'string' &&
value.split(/\r?\n/).every(line => max_length_1.default(line, max));
//# sourceMappingURL=max-line-length.js.map
"use strict";
exports.__esModule = true;
exports["default"] = (function (value, min) {
return typeof value === 'string' && value.length >= min;
});
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (value, min) => typeof value === 'string' && value.length >= min;
//# sourceMappingURL=min-length.js.map
"use strict";
exports.__esModule = true;
exports["default"] = (function (value) {
return typeof value === 'string' && value.length > 0;
});
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (value) => typeof value === 'string' && value.length > 0;
//# sourceMappingURL=not-empty.js.map
{
"name": "@commitlint/ensure",
"version": "8.3.4",
"version": "9.0.0",
"description": "Lint your commit messages",

@@ -15,3 +15,3 @@ "main": "lib/index.js",

"engines": {
"node": ">=4"
"node": ">=8"
},

@@ -38,9 +38,11 @@ "repository": {

"devDependencies": {
"@commitlint/utils": "^8.3.4",
"globby": "10.0.1"
"@commitlint/utils": "^9.0.0",
"@types/lodash": "4.14.149",
"globby": "^11.0.0"
},
"dependencies": {
"lodash": "4.17.15"
"@commitlint/types": "^9.0.0",
"lodash": "^4.17.15"
},
"gitHead": "3fce33999e1e5f23b15545f1c6f3e7bd78e8d37b"
"gitHead": "71f0194f33943954a8dac1c458be47e5049717cd"
}

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

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

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