Skip to content

Releases: bharathidas/String-Manipulation

String Manipulation

Choose a tag to compare

@bharathidas bharathidas released this 21 Aug 05:36
4e02fdc

String Manipulation — Studio Pro 10.24.17

Fixed — Marketplace security scan failure (CWE-494)

The Marketplace scan failed this module with a CRITICAL finding:

javascriptsource/stringmanipulation/actions/package-lock.json — The package-lock.json file contains at least 1 library whose integrity is not checked. (CWE-494)

Cause. Of the 43 entries in the lock file, only the direct dependency @stdlib/string carried resolved and integrity. All 42 transitive @stdlib packages had neither — just a version number. Without an integrity hash, npm cannot verify what it downloads, which is the supply-chain risk the scan is designed to catch.

Fix. The lock file has been regenerated against the npm registry so that every entry carries both resolved and integrity, in the modern packages block and the legacy dependencies block alike.

Before After
Entries 43 43
Missing integrity 42 0
Missing resolved 42 0

The shipped code is unchanged. Every one of the 43 pinned versions in the regenerated lock was compared against the node_modules tree that ships in this package — 43 identical, 0 mismatches, nothing added, nothing removed. The lock now describes exactly the tree it always described; it simply records the hashes as well. Integrity hashes were spot-checked against the registry for @stdlib/array@0.2.1, @stdlib/utils@0.2.1, @stdlib/types@0.3.2 and debug@2.6.9.

The codePointAt fix from 2.1 is retained.

Notes

Studio Pro 10.24.17, imports with 0 errors. 35 actions over the bundled @stdlib/string 0.2.1. Import StringManipulation.mpk via App Explorer > Import module package.

String Manipulation

Choose a tag to compare

@bharathidas bharathidas released this 20 Aug 13:06
4e02fdc

String Manipulation — Studio Pro 10.24.17

Fixed

codePointAt crashed instead of reporting bad input. Its guard called a trim function that was never defined or imported, so a null input raised ReferenceError: trim is not defined rather than the intended "input should not be empty". The same guards used && where || was meant, so neither could fire for ordinary input, and position == null && position >= 0 could never be true at all.

The action now validates input and position properly, rejects a negative or non-whole position with a clear message, and returns the code point as the declared Big type rather than a raw number.

This defect predates the 10.24.17 upgrade.

Known remaining issues

The following are documented but not yet fixed, as changing them would alter existing signatures:

  • prevGraphemeClusterBreak declares a String return type but returns an integer index, and omits the library's optional fromIndex — so it can only ever find the last break, despite its description.
  • ltrimN documentation says it trims from the end; it trims from the beginning. The text is copied from rtrimN.
  • nextCodePointIndex and nextGraphemeClusterBreak name their second parameter length, but it is a position (fromIndex), not a length.
  • substringAfterLast makes fromIndex mandatory although the library defaults it to the end of the string; passing 0 narrows the search rather than widening it.

Notes

35 actions over the bundled @stdlib/string 0.2.1. Studio Pro 10.24.17, imports with 0 errors. Import StringManipulation.mpk via App Explorer > Import module package.

String Manipulation

Choose a tag to compare

@bharathidas bharathidas released this 20 Aug 08:19
4e02fdc

String Manipulation — now supported on Mendix Studio Pro 10.24.17

Rebuilt from Studio Pro 9.24.12 to 10.24.17 (LTS). No functional changes — this release only updates Studio Pro compatibility.

Import StringManipulation.mpk via App Explorer > Import module package in Studio Pro 10.24.17 or higher.


Utilized for modifying, parsing, or examining strings (sequences of characters) in processes like data cleaning, text processing, and producing formatted output.

Features

Padding
• lpad - left pad a string
• rpad - right pad a string
• pad - pad a string

Trimming
• ltrim - trim whitespace characters from the beginning of a string
• rtrim - trim whitespace characters from the end of a string
• ltrimN - trim n characters from the end of a string
• rtrimN - trim n characters from the end of a string

Case Conversion
• constantCase - convert a string to constant case
• dotCase - convert a string to dot case
• headerCase - convert a string to HTTP header case
• kebabCase - convert a string to kebab case
• pascalCase - convert a string to Pascal case
• snakeCase - convert a string to snake case
• startCase - capitalize the first letter of each word in a string

Removing Characters
• removeFirst - remove the first character(s) of a string
• removeLast - remove the last character(s) of a string
• removePunctuation - remove punctuation characters from a string
• removeUTF8BOM - remove a UTF-8 byte order mark (BOM) from the beginning of a string
• removeWords - remove a list of words from a string

Splitting and Substrings
• splitGraphemeClusters - split a string by its grapheme cluster breaks
• substringAfterLast - return the part of a string after the last occurrence of a specified substring
• substringBeforeLast - return the part of a string before the last occurrence of a specified substring
• truncateMiddle - truncate a string in the middle to a specified length

Repeating and Reversing
• repeat - repeat a string a specified number of times and return the concatenated result
• reverseString - reverse a string

Encoding
• percentEncode - percent-encode a UTF-16 encoded string according to RFC 3986
• utf16ToUTF8 - convert a UTF-16 encoded string to an array of integers using UTF-8 encoding

Unicode and Grapheme Clusters
• codePointAt - return a Unicode code point from a string at a specified position
• fromCodePoint - create a string from a sequence of Unicode code points
• nextCodePointIndex - return the position of the next Unicode code point in a string after a specified position
• nextGraphemeClusterBreak - return the next extended grapheme cluster break in a string after a specified position
• prevGraphemeClusterBreak - return the previous extended grapheme cluster break in a string before a specified position

Number Conversion
• num2words - convert a number to a word representation

Misc
• Acronym - generate an acronym for a given string
• uncapitalize - uncapitalize the first character of a string

Dependencies:
• Mendix modeler 9.12.4.

Issues, suggestions and feature requests
https://github.com/bharathidas/String-Manipulation/issues

String Manipulation

Choose a tag to compare

@bharathidas bharathidas released this 20 Jul 14:11
4e02fdc

Utilized for modifying, parsing, or examining strings (sequences of characters) in processes like data cleaning, text processing, and producing formatted output.

Features

Padding
• lpad - left pad a string
• rpad - right pad a string
• pad - pad a string

Trimming
• ltrim - trim whitespace characters from the beginning of a string
• rtrim - trim whitespace characters from the end of a string
• ltrimN - trim n characters from the end of a string
• rtrimN - trim n characters from the end of a string

Case Conversion
• constantCase - convert a string to constant case
• dotCase - convert a string to dot case
• headerCase - convert a string to HTTP header case
• kebabCase - convert a string to kebab case
• pascalCase - convert a string to Pascal case
• snakeCase - convert a string to snake case
• startCase - capitalize the first letter of each word in a string

Removing Characters
• removeFirst - remove the first character(s) of a string
• removeLast - remove the last character(s) of a string
• removePunctuation - remove punctuation characters from a string
• removeUTF8BOM - remove a UTF-8 byte order mark (BOM) from the beginning of a string
• removeWords - remove a list of words from a string

Splitting and Substrings
• splitGraphemeClusters - split a string by its grapheme cluster breaks
• substringAfterLast - return the part of a string after the last occurrence of a specified substring
• substringBeforeLast - return the part of a string before the last occurrence of a specified substring
• truncateMiddle - truncate a string in the middle to a specified length

Repeating and Reversing
• repeat - repeat a string a specified number of times and return the concatenated result
• reverseString - reverse a string

Encoding
• percentEncode - percent-encode a UTF-16 encoded string according to RFC 3986
• utf16ToUTF8 - convert a UTF-16 encoded string to an array of integers using UTF-8 encoding

Unicode and Grapheme Clusters
• codePointAt - return a Unicode code point from a string at a specified position
• fromCodePoint - create a string from a sequence of Unicode code points
• nextCodePointIndex - return the position of the next Unicode code point in a string after a specified position
• nextGraphemeClusterBreak - return the next extended grapheme cluster break in a string after a specified position
• prevGraphemeClusterBreak - return the previous extended grapheme cluster break in a string before a specified position

Number Conversion
• num2words - convert a number to a word representation

Misc
• Acronym - generate an acronym for a given string
• uncapitalize - uncapitalize the first character of a string

Dependencies:
• Mendix modeler 9.12.4.

Issues, suggestions and feature requests
https://github.com/bharathidas/String-Manipulation/issues