
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
@isoftdata/utility-string
Advanced tools
Breaking change in version 2: ESM style exports
stringToBoolean(string)
Type: string
Returnsboolean
const inventoryItem = { inventoryId: 1, usesCost: 'True' }
stringToBoolean(inventoryItem.usesCost) // true
booleanToYesNo(boolean[, translateFn])
Pass the i18next
.tfunction as the optional second argument and'common:yes'and'common:no'will be used for the keys passed to thetranslateFncall.
Type: boolean
Returnsstring
booleanToYesNo(true) // 'Yes'
booleanToYesNo(false) // 'No'
Designed to be a drop-in replacement for i18next's
.tfunction that you can use as a default in your translation-aware componments/code as a fallback for consumers that don't have translation/i18next support. It supports the same syntax as i18next's.tfunction, but does not do translation, just uses the default string you pass. It does support the most common advanced use cases, including interpolation via i18next's iterpolation syntax like{{example}}and{{- example}}.
(key: string, defaultValue: string, options?: Record<string, string>)
Returnsstring
translate('foo', 'blah blah {{foo}} bar', { foo: 'candy' }) // 'blah blah candy bar'
translate('foo', 'what is this?') // 'what is this?'
translate('foo', 'what the {{- curse}} is this?', { curse: 'heck' }) // 'what the heck is this?'
Generates a unique numbered name for a duplicate. The strategy (
PARENS,SNAKE, orKEBAB) is auto-detected fromsourceNamewhen it already carries a numbered suffix, and falls back to thestrategyoption otherwise. Always uses the next number after the highest found inexistingNames.
getDuplicateName(sourceName: string, options?: GetDuplicateNameOptions)
Type: string
The name to duplicate. If it already ends with a numbered suffix (e.g. foo (1), foo_1, foo-1), the suffix is stripped and the strategy is inferred from it.
Type: 'PARENS' | 'SNAKE' | 'KEBAB' — Default: 'PARENS'
Controls the format of the appended number. Ignored when the strategy is auto-detected from sourceName.
| Strategy | Output format |
|---|---|
PARENS | foo (2) |
SNAKE | foo_2 |
KEBAB | foo-2 |
Type: Array<string> — Default: []
Names to check when determining the next number. The result will be one higher than the highest matching number found.
Returnsstring
getDuplicateName('Report', { existingNames: ['Report (1)', 'Report (2)'] }) // 'Report (3)'
getDuplicateName('report_2', { existingNames: ['report_1', 'report_2'] }) // 'report_3'
getDuplicateName('Report') // 'Report (1)'
FAQs
Unknown package
We found that @isoftdata/utility-string demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.