From 1eedb1017551a5a7f800c3d7b955ddd060de5085 Mon Sep 17 00:00:00 2001 From: Esteban Date: Thu, 21 Nov 2024 10:19:58 -0500 Subject: [PATCH] N more s --- addon/decorators/core-validator.js | 6 +++++- package.json | 1 - yarn.lock | 7 ------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/addon/decorators/core-validator.js b/addon/decorators/core-validator.js index b0e947f5..194416d0 100644 --- a/addon/decorators/core-validator.js +++ b/addon/decorators/core-validator.js @@ -1,6 +1,5 @@ import { get, set } from '@ember/object'; import { getOwner } from '@ember/application'; -import { capitalize } from '@ember/string'; import { isEmpty, isBlank, isPresent, typeOf, isEqual } from '@ember/utils'; import { A, isArray } from '@ember/array'; @@ -28,6 +27,11 @@ const Messages = { 'sr-cyrl': MessagesSrCyrl, }; +function capitalize(str) { + if (typeof str !== 'string' || !str.length) return ''; + return str.charAt(0).toUpperCase() + str.slice(1); +} + function coreValidator(constructor) { return class CoreValidator extends constructor { validationErrors = {}; diff --git a/package.json b/package.json index dc4722a2..77923922 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ }, "devDependencies": { "@ember/optional-features": "^2.0.0", - "@ember/string": "^3.1.1", "@ember/test-helpers": "^2.8.1", "@embroider/test-setup": "^3.0.1", "@glimmer/component": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index bf9687e3..2d8f058f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2042,13 +2042,6 @@ mkdirp "^1.0.4" silent-error "^1.1.1" -"@ember/string@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@ember/string/-/string-3.1.1.tgz#0a5ac0d1e4925259e41d5c8d55ef616117d47ff0" - integrity sha512-UbXJ+k3QOrYN4SRPHgXCqYIJ+yWWUg1+vr0H4DhdQPTy8LJfyqwZ2tc5uqpSSnEXE+/1KopHBE5J8GDagAg5cg== - dependencies: - ember-cli-babel "^7.26.6" - "@ember/test-helpers@*", "@ember/test-helpers@^2.8.1": version "2.9.3" resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-2.9.3.tgz#c2a9d6ab1c367af92cf1a334f97eb19b8e06e6e1"