
Research
/Security News
Malicious Chrome and Firefox Extensions Steal Crypto Traders’ Session and Wallet Data
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.
@isoftdata/utility-string
Advanced tools

Breaking change in version 2: ESM style exports
pluralIfNeeded(number[, pluralSuffix, singleSuffix])
Type: number
Type: string
Default: 's'
Type: string
Default: ''(empty string)
Returnsstring
//Simple Example
const inventoryList = [ { inventoryId: 1 }, { inventoryId: 2 } ]
`You have ${inventoryList.length} item${pluralIfNeeded(inventoryList.length)} in inventory` // 'You have 2 items in inventory'
//Example with custom plural suffix and single suffix
const daytonOxenCount = 0
const billOxenCount = 1
const tedOxenCount = 2
`Dayton has ${daytonOxenCount} ox${pluralIfNeeded(daytonOxenCount, 'en')}` // 'Dayton has 0 oxen'
`Bill has ${billOxenCount} ox${pluralIfNeeded(billOxenCount, 'en')}` // 'Bill has 1 ox'
`Ted has ${tedOxenCount} ox${pluralIfNeeded(tedOxenCount, 'en')}` // 'Ted has 2 oxen'
//Another example with custom plural suffix and single suffix
const daytonCactusCount = 0
const billCactusCount = 1
const tedCactusCount = 2
`Dayton has ${daytonCactusCount} cact${pluralIfNeeded(daytonCactusCount, 'i', 'us')}` // 'Dayton has 0 cactus'
`Bill has ${billCactusCount} cact${pluralIfNeeded(billCactusCount, 'i', 'us')}` // 'Bill has 1 cacti'
`Ted has ${tedCactusCount} cact${pluralIfNeeded(tedCactusCount, 'i', 'us')}` // 'Ted has 2 cactus'
stringToBoolean(string)
Type: string
Returnsboolean
const inventoryItem = { inventoryId: 1, usesCost: 'True' }
stringToBoolean(inventoryItem.usesCost) // true
booleanToYesNo(boolean)
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}}.
translate('foo', 'blah blah {{foo}} bar', { foo: 'candy' }) // 'blah blah candy bar'
(key: string, defaultValue: string, options?: Record<string, string>)
Returnsstring
translate('foo', 'what is this?') // 'what is this?'
translate('foo', 'what the {{- curse}} is this?', { curse: 'heck' }) // 'what the heck is this?'
FAQs
Unknown package
The npm package @isoftdata/utility-string receives a total of 55 weekly downloads. As such, @isoftdata/utility-string popularity was classified as not popular.
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.

Research
/Security News
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.

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.