[Chore] - Remove unneeded string extensions (#29834)

* remove usage of string includes polyfill

* remove deps as well

* add changelog entry

* add .gitkeep
This commit is contained in:
Evan Moncuso 2025-03-05 14:35:31 -08:00 committed by GitHub
parent 4cbdadffe2
commit 2c94c0034b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 3 additions and 43 deletions

3
changelog/29834.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:change
UI: remove outdated and unneeded js string extensions
```

View file

@ -80,10 +80,6 @@ const appConfig = {
module.exports = function (defaults) {
const app = new EmberApp(defaults, appConfig);
app.import('vendor/string-includes.js');
app.import('node_modules/string.prototype.endswith/endswith.js');
app.import('node_modules/string.prototype.startswith/startswith.js');
app.import('node_modules/jsonlint/lib/jsonlint.js');
app.import('node_modules/codemirror/addon/lint/lint.css');
app.import('node_modules/codemirror/lib/codemirror.css');

View file

@ -158,8 +158,6 @@
"sass": "^1.66.3",
"shell-quote": "^1.8.1",
"sinon": "^17.0.1",
"string.prototype.endswith": "^0.2.0",
"string.prototype.startswith": "^0.2.0",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.0.2",

0
ui/vendor/.gitkeep vendored Normal file
View file

View file

@ -1,21 +0,0 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
// By Mozilla Contributors licensed under CC-BY-SA 2.5 (http://creativecommons.org/licenses/by-sa/2.5/)
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill
if (!String.prototype.includes) {
String.prototype.includes = function (search, start) {
'use strict';
if (typeof start !== 'number') {
start = 0;
}
if (start + search.length > this.length) {
return false;
} else {
return this.indexOf(search, start) !== -1;
}
};
}

View file

@ -17312,13 +17312,6 @@ __metadata:
languageName: node
linkType: hard
"string.prototype.endswith@npm:^0.2.0":
version: 0.2.0
resolution: "string.prototype.endswith@npm:0.2.0"
checksum: ee0d1619878a7525a6613da16b3a1d7f6d84a8d4414f78a8a1d24aef9789d4bd774d9e93eeb922a78e7f67d804e60f4cba314beb8f55327bff6e83ba39b91f24
languageName: node
linkType: hard
"string.prototype.matchall@npm:^4.0.5, string.prototype.matchall@npm:^4.0.6":
version: 4.0.12
resolution: "string.prototype.matchall@npm:4.0.12"
@ -17340,13 +17333,6 @@ __metadata:
languageName: node
linkType: hard
"string.prototype.startswith@npm:^0.2.0":
version: 0.2.0
resolution: "string.prototype.startswith@npm:0.2.0"
checksum: b4224e2454c276baf0609c76f5db0ee6355a89a649041df9a2e49b4cdf4b424dbebbe2c070a3b5f6f00594f8f8fa98415799c7211e873e13f6ee007daae73516
languageName: node
linkType: hard
"string.prototype.trim@npm:^1.2.10":
version: 1.2.10
resolution: "string.prototype.trim@npm:1.2.10"
@ -18946,8 +18932,6 @@ __metadata:
sass: ^1.66.3
shell-quote: ^1.8.1
sinon: ^17.0.1
string.prototype.endswith: ^0.2.0
string.prototype.startswith: ^0.2.0
stylelint: ^15.11.0
stylelint-config-standard: ^34.0.0
stylelint-prettier: ^4.0.2