
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@aboutbits/pagination
Advanced tools
This pagacke includes a pagination calculation, where you can simply pass some basic information to the calcualtion function, and in return you receive an object with all relevant pagination information.
First, you have to install the package:
npm install @aboutbits/pagination
Second, you can call the calculate function by passing the following information:
page
: The current pagesize
: The amount of items shown per pagetotal
: The amount of total items in the list/collectionconfig
: A configuration object containing the following possible configuration values:
indexType
: The starting point of the pagination (default: IndexType.ONE_BASED)maxPages
: The maximum amount of pages that should be shown (default: 5)In return, you receive an object with all relevant information:
import { calculatePagination } from '@aboutbits/pagination'
let pagination = calculatePagination(1, 5, 100)
console.log(pagination)
This would return the following object:
{
"previous": {
"indexNumber": 1,
"isDisabled": true
},
"next": {
"indexNumber": 2,
"isDisabled": false
},
"pages": [
{
"indexNumber": 1,
"displayNumber": 1,
"isCurrent": true
},
{
"indexNumber": 2,
"displayNumber": 2,
"isCurrent": false
},
{
"indexNumber": 3,
"displayNumber": 3,
"isCurrent": false
},
{
"indexNumber": 4,
"displayNumber": 4,
"isCurrent": false
},
{
"indexNumber": 5,
"displayNumber": 5,
"isCurrent": false
}
]
}
To build and publish the package, simply commit all changes and push them to master. Then run one of the following commands locally:
npm version patch
npm version minor
npm version major
About Bits is a company based in South Tyrol, Italy. You can find more information about us on our website.
For support, please contact info@aboutbits.it.
The MIT License (MIT). Please see the license file for more information.
FAQs
Pagination
The npm package @aboutbits/pagination receives a total of 363 weekly downloads. As such, @aboutbits/pagination popularity was classified as not popular.
We found that @aboutbits/pagination 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.