LearnNewsExamplesServices
Frontmatter
id4490
titleutil.StringUtil cleanup
stateClosed
labels
enhancement
assignees[]
createdAtMay 31, 2023, 6:21 PM
updatedAtSep 26, 2024, 2:34 PM
githubUrlhttps://github.com/neomjs/neo/issues/4490
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 26, 2023, 3:19 PM

util.StringUtil cleanup

Closed v8.1.0 enhancement
tobiu
tobiu commented on May 31, 2023, 6:21 PM

We should order the methods according to our coding guidelines:

Screenshot 2023-05-31 at 18 15 36

We could also cache the regex inside unescapeHtml() into a static class field.

tobiu added the enhancement label on May 31, 2023, 6:21 PM
tobiu assigned to @Ghost on Jun 19, 2023, 11:17 AM
Ghost cross-referenced by PR #4513 on Jun 24, 2023, 5:37 PM
tobiu closed this issue on Jun 26, 2023, 10:36 AM
tobiu
tobiu Jun 26, 2023, 3:13 PM

i will add a bit more polishing:

  • static configs order & comments
  • method order
  • static regex => new ctor not needed
tobiu reopened this issue on Jun 26, 2023, 3:13 PM
tobiu referenced in commit 0968069 - "util.StringUtil cleanup #4490" on Jun 26, 2023, 3:16 PM
tobiu referenced in commit ab40001 - "#4490 neo className" on Jun 26, 2023, 3:17 PM
tobiu
tobiu Jun 26, 2023, 3:19 PM

done now.

@dztoprak since there are many dependencies between static methods and static configs, another way to implement this would be converting the class into a singleton. example: https://github.com/neomjs/neo/blob/dev/src/util/Logger.mjs#L29

feel free to create a follow-up ticket, in case you like the singleton idea better.

tobiu closed this issue on Jun 26, 2023, 3:19 PM