
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
decline-word
Advanced tools
Helps you to decline words in Russian, Ukrainian and English languages.\
decline-word is available via npm:
$ npm i decline-word@1.2.7
1st parameter: amount of item(s)
2nd: main part of the word (unchangeable for each form)
3rd (optional, default = ''): word ending for 1 item
4th (optional, default = ''): word ending for 2 items
5th (optional, default = ''): word ending for 5 items
const declineWord = require('decline-word');
console.log(`12 ${declineWord(12, 'ΡΠ±Π»ΠΎΠΊ', 'ΠΎ', 'Π°')}`); // 12 ΡΠ±Π»ΠΎΠΊ
console.log(`22 ${declineWord(22, 'ΡΠ±Π»ΠΎΠΊ', 'ΠΎ', 'Π°')}`); // 22 ΡΠ±Π»ΠΎΠΊΠ°
console.log(`159 ${declineWord(159, 'ΡΠ±Π»ΠΎΠΊ', 'ΠΎ', 'Π°')}`); // 159 ΡΠ±Π»ΠΎΠΊ
console.log(`1151 ${declineWord(1151, 'ΡΠ±Π»ΠΎΠΊ', 'ΠΎ', 'Π°')}`); // 1151 ΡΠ±Π»ΠΎΠΊΠΎ
console.log(`1 ${declineWord(1, 'Π°ΠΏΠ΅Π»ΡΡΠΈΠ½', '', 'ΠΈ', 'ΡΠ²')}`); // 1 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½
console.log(`11 ${declineWord(11, 'Π°ΠΏΠ΅Π»ΡΡΠΈΠ½', '', 'ΠΈ', 'ΡΠ²')}`); // 11 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ΡΠ²
console.log(`84 ${declineWord(84, 'Π°ΠΏΠ΅Π»ΡΡΠΈΠ½', '', 'ΠΈ', 'ΡΠ²')}`); // 84 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ΠΈ
console.log(`147 ${declineWord(147, 'Π°ΠΏΠ΅Π»ΡΡΠΈΠ½', '', 'ΠΈ', 'ΡΠ²')}`); // 147 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ΡΠ²
There are some differences of default parameter values comparing with the Russian and Ukrainian languages.
1st parameter: amount of item(s)
2nd: main part of the word (unchangeable for each form)
3rd (optional, default = ''): word ending for 1 item
4th (optional, default = 's'): word ending for 2 items
5th (optional, default = <4th parameter>): word ending for 5 items
That difference is made for more convenience using with English words.
const declineWord = require('decline-word');
console.log(`1 ${declineWord(1, 'door')}`); // 1 door
console.log(`10 ${declineWord(10, 'door')}`); // 10 doors
console.log(`11 ${declineWord(11, 'hero', '', 'es')}`); // 11 heroes
console.log(`21 ${declineWord(21, 'hero', '', 'es')}`); // 21 hero
console.log(`5 ${declineWord(5, 'cand', 'y', 'ies')}`); // 5 candies
console.log(`101 ${declineWord(101, 'cand', 'y', 'ies')}`); // 101 candy
// declineWord(31, 't', 'ooth', 'eeth') or...
console.log(`31 ${declineWord(31, '', 'tooth', 'teeth')}`); // 31 tooth
console.log(`32 ${declineWord(32, '', 'tooth', 'teeth')}`); // 32 teeth
const declineWord = require('decline-word');
const declApples = declineWord.wrap('ΡΠ±Π»ΠΎΠΊ', 'ΠΎ', 'Π°');
const declOranges = declineWord.wrap('Π°ΠΏΠ΅Π»ΡΡΠΈΠ½', '', 'Π°', 'ΠΎΠ²');
const declPears = declineWord.wrap('Π³ΡΡΡ', 'Π°', 'ΠΈ');
for(let i = 0; i <= 6; i++) {
console.log(`${i} ${declApples(i)} | ${i} ${declOranges(i)} | ${i} ${declPears(i)}`);
}
/*
1st iteration: '0 ΡΠ±Π»ΠΎΠΊ | 0 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ΠΎΠ² | 0 Π³ΡΡΡ'
2nd iteration: '1 ΡΠ±Π»ΠΎΠΊΠΎ | 1 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ | 1 Π³ΡΡΡΠ°'
3rd iteration: '2 ΡΠ±Π»ΠΎΠΊΠ° | 2 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½Π° | 2 Π³ΡΡΡΠΈ'
4th iteration: '3 ΡΠ±Π»ΠΎΠΊΠ° | 3 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½Π° | 3 Π³ΡΡΡΠΈ'
5th iteration: '4 ΡΠ±Π»ΠΎΠΊΠ° | 4 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½Π° | 4 Π³ΡΡΡΠΈ'
6th iteration: '5 ΡΠ±Π»ΠΎΠΊ | 5 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ΠΎΠ² | 5 Π³ΡΡΡ'
7th iteration: '6 ΡΠ±Π»ΠΎΠΊ | 6 Π°ΠΏΠ΅Π»ΡΡΠΈΠ½ΠΎΠ² | 6 Π³ΡΡΡ'
*/
const { declineWrapper } = require('decline-word');
// Nominative case, ΠΈΠΌΠ΅Π½ΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΏΠ°Π΄Π΅ΠΆ, Π½Π°Π·ΠΈΠ²Π½ΠΈΠΉ Π²ΡΠ΄ΠΌΡΠ½ΠΎΠΊ
const nomCase = declineWrapper('ΠΏΠ°Π΄Π΅ΠΆ', '', 'Π°', 'Π΅ΠΉ');
console.log('ΠΎΠ΄ΠΈΠ½', nomCase(1)); // ΠΎΠ΄ΠΈΠ½ ΠΏΠ°Π΄Π΅ΠΆ
console.log('Π΄Π²Π°', nomCase(2)); // Π΄Π²Π° ΠΏΠ°Π΄Π΅ΠΆΠ°
console.log('ΠΏΡΡΡ', nomCase(5)); // ΠΏΡΡΡ ΠΏΠ°Π΄Π΅ΠΆΠ΅ΠΉ
// Genitive case, ΡΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΏΠ°Π΄Π΅ΠΆ, ΡΠΎΠ΄ΠΎΠ²ΠΈΠΉ Π²ΡΠ΄ΠΌΡΠ½ΠΎΠΊ
const genCase = declineWrapper('ΠΏΠ°Π΄Π΅ΠΆ', 'Π°', 'Π΅ΠΉ', 'Π΅ΠΉ');
console.log('ΠΎΠ΄Π½ΠΎΠ³ΠΎ', genCase(1)); // ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΏΠ°Π΄Π΅ΠΆΠ°
console.log('Π΄Π²ΡΡ
', genCase(2)); // Π΄Π²ΡΡ
ΠΏΠ°Π΄Π΅ΠΆΠ΅ΠΉ
console.log('ΠΏΡΡΠΈ', genCase(5)); // ΠΏΡΡΠΈ ΠΏΠ°Π΄Π΅ΠΆΠ΅ΠΉ
// Dative case, Π΄Π°ΡΠ΅Π»ΡΠ½ΡΠΉ ΠΏΠ°Π΄Π΅ΠΆ, Π΄Π°Π²Π°Π»ΡΠ½ΠΈΠΉ Π²ΡΠ΄ΠΌΡΠ½ΠΎΠΊ
const datCase = declineWrapper('ΠΏΠ°Π΄Π΅ΠΆ', 'Ρ', 'Π°ΠΌ', 'Π°ΠΌ');
console.log('ΠΎΠ΄Π½ΠΎΠΌΡ', datCase(1)); // ΠΎΠ΄Π½ΠΎΠΌΡ ΠΏΠ°Π΄Π΅ΠΆΡ
console.log('Π΄Π²ΡΠΌ', datCase(2)); // Π΄Π²ΡΠΌ ΠΏΠ°Π΄Π΅ΠΆΠ°ΠΌ
console.log('ΠΏΡΡΠΈ', datCase(5)); // ΠΏΡΡΠΈ ΠΏΠ°Π΄Π΅ΠΆΠ°ΠΌ
// Accusative case, Π²ΠΈΠ½ΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΏΠ°Π΄Π΅ΠΆ, Π·Π½Π°Ρ
ΡΠ΄Π½ΠΈΠΉ Π²ΡΠ΄ΠΌΡΠ½ΠΎΠΊ
const accCase = declineWrapper('ΠΏΠ°Π΄Π΅ΠΆ', '', 'Π°', 'Π΅ΠΉ');
console.log('ΠΎΠ΄ΠΈΠ½', accCase(1)); // ΠΎΠ΄ΠΈΠ½ ΠΏΠ°Π΄Π΅ΠΆ
console.log('Π΄Π²Π°', accCase(2)); // Π΄Π²Π° ΠΏΠ°Π΄Π΅ΠΆΠ°
console.log('ΠΏΡΡΡ', accCase(5)); // ΠΏΡΡΡ ΠΏΠ°Π΄Π΅ΠΆΠ΅ΠΉ
// Instrumental case, ΡΠ²ΠΎΡΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΏΠ°Π΄Π΅ΠΆ, ΠΎΡΡΠ΄Π½ΠΈΠΉ Π²ΡΠ΄ΠΌΡΠ½ΠΎΠΊ
const insCase = declineWrapper('ΠΏΠ°Π΄Π΅ΠΆ', 'ΠΎΠΌ', 'Π°ΠΌΠΈ', 'Π°ΠΌΠΈ');
console.log('ΠΎΠ΄Π½ΠΈΠΌ', insCase(1)); // ΠΎΠ΄Π½ΠΈΠΌ ΠΏΠ°Π΄Π΅ΠΆΠΎΠΌ
console.log('Π΄Π²ΡΠΌΡ', insCase(2)); // Π΄Π²ΡΠΌΡ ΠΏΠ°Π΄Π΅ΠΆΠ°ΠΌΠΈ
console.log('ΠΏΡΡΡΡ', insCase(5)); // ΠΏΡΡΡΡ ΠΏΠ°Π΄Π΅ΠΆΠ°ΠΌΠΈ
// Prepositional case, ΠΏΡΠ΅Π΄Π»ΠΎΠΆΠ½ΡΠΉ ΠΏΠ°Π΄Π΅ΠΆ, ΠΌΡΡΡΠ΅Π²ΠΈΠΉ Π²ΡΠ΄ΠΌΡΠ½ΠΎΠΊ
const prepCase = declineWrapper('ΠΏΠ°Π΄Π΅ΠΆ', 'Π΅', 'Π°Ρ
', 'Π°Ρ
');
console.log('Π½Π° ΠΎΠ΄Π½ΠΎΠΌ', prepCase(1)); // Π½Π° ΠΎΠ΄Π½ΠΎΠΌ ΠΏΠ°Π΄Π΅ΠΆΠ΅
console.log('Π½Π° Π΄Π²ΡΡ
', prepCase(2)); // Π½Π° Π΄Π²ΡΡ
ΠΏΠ°Π΄Π΅ΠΆΠ°Ρ
console.log('Π½Π° ΠΏΡΡΠΈ', prepCase(5)); // Π½Π° ΠΏΡΡΠΈ ΠΏΠ°Π΄Π΅ΠΆΠ°Ρ
$ npm test
Your improve suggestions and bug reports are welcome any time.
FAQs
Declines words in Russian, Ukrainian and English languages.
The npm package decline-word receives a total of 213 weekly downloads. As such, decline-word popularity was classified as not popular.
We found that decline-word demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authoritiesβ publishing activity, highlighting trends and transparency across the CVE ecosystem.