Comparing version 3.5.19 to 3.5.20
@@ -5,2 +5,7 @@ # Changelog | ||
## [3.5.20][] - 2022-05-09 | ||
- Fix isFirstUpper bug with special characters | ||
- Add isFirstLower and isFirstLetter functions | ||
## [3.5.19][] - 2022-03-15 | ||
@@ -143,3 +148,4 @@ | ||
[unreleased]: https://github.com/metarhia/metautil/compare/v3.5.19....HEAD | ||
[unreleased]: https://github.com/metarhia/metautil/compare/v3.5.20....HEAD | ||
[3.5.20]: https://github.com/metarhia/metautil/compare/v3.5.19...v3.5.20 | ||
[3.5.19]: https://github.com/metarhia/metautil/compare/v3.5.18...v3.5.19 | ||
@@ -146,0 +152,0 @@ [3.5.18]: https://github.com/metarhia/metautil/compare/v3.5.17...v3.5.18 |
@@ -82,4 +82,10 @@ 'use strict'; | ||
const isFirstUpper = (s) => !!s && s[0] === s[0].toUpperCase(); | ||
const inRange = (x, min, max) => x >= min && x <= max; | ||
const isFirstUpper = (s) => !!s && inRange(s[0], 'A', 'Z'); | ||
const isFirstLower = (s) => !!s && inRange(s[0], 'a', 'z'); | ||
const isFirstLetter = (s) => isFirstUpper(s) || isFirstLower(s); | ||
const toLowerCamel = (s) => s.charAt(0).toLowerCase() + s.slice(1); | ||
@@ -339,2 +345,4 @@ | ||
isFirstUpper, | ||
isFirstLower, | ||
isFirstLetter, | ||
toLowerCamel, | ||
@@ -341,0 +349,0 @@ toUpperCamel, |
@@ -34,2 +34,4 @@ import { EventEmitter } from 'events'; | ||
export function isFirstUpper(s: string): boolean; | ||
export function isFirstLower(s: string): boolean; | ||
export function isFirstLetter(s: string): boolean; | ||
export function toLowerCamel(s: string): string; | ||
@@ -36,0 +38,0 @@ export function toUpperCamel(s: string): string; |
{ | ||
"name": "metautil", | ||
"version": "3.5.19", | ||
"version": "3.5.20", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -41,12 +41,12 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^17.0.21", | ||
"eslint": "^8.11.0", | ||
"@types/node": "^17.0.31", | ||
"eslint": "^8.15.0", | ||
"eslint-config-metarhia": "^7.0.1", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"metatests": "^0.8.1", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.6.2" | ||
"metatests": "^0.8.2", | ||
"prettier": "^2.6.2", | ||
"typescript": "^4.6.4" | ||
} | ||
} |
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
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
32781
732