
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
miscellaneous javascript functions
include misc.js in your project or add to your workflow
npm install yy-misc
Kind: global class
numberobjectnumbernumbernumberbooleanArraynumbernumberreturn the difference between two numbers (greater - lesser)
Kind: instance method of Misc
| Param | Type |
|---|---|
| a | number |
| b | number |
objectreturns {most, least, all[]} array grouped by value
Kind: instance method of Misc
Returns: object - {most: most, least: least, all: Array}
| Param | Type |
|---|---|
| a | Array |
numberfinds the smallest number in an array
Kind: instance method of Misc
| Param | Type |
|---|---|
| a | Array |
returns whether a and b have the same sign or both equal 0
Kind: instance method of Misc
| Param | Type |
|---|---|
| a | number |
| b | number |
boolean |
numberround number to certain number of decimals
Kind: instance method of Misc
| Param | Type |
|---|---|
| num | number |
| decimals | number |
calculate ideal font size
Kind: instance method of Misc
| Param | Type | Description |
|---|---|---|
| text | string | (use maximum-sized text) |
| maxWidth | number | |
| [maxHeight] | number | |
| [fontFamily] | string |
numberfrom: http://stackoverflow.com/questions/6543917/count-number-of-words-in-string-using-javascript
Kind: instance method of Misc
| Param | Type |
|---|---|
| text | string |
booleanreturns whether the test value is about equal to the value (i.e., within the given percentage)
Kind: instance method of Misc
| Param | Type |
|---|---|
| test | number |
| value | number |
| percent | number |
ArrayRemoves duplicates from array and returns new array from http://stackoverflow.com/questions/9229645/remove-duplicates-from-javascript-array
Kind: instance method of Misc
| Param | Type |
|---|---|
| a | Array |
numberclamps a number
Kind: instance method of Misc
| Param | Type | Description |
|---|---|---|
| n | number | to clamp |
| min | number | |
| max | number |
Copyright (c) 2016 YOPEY YOPEY LLC - MIT License - Documented by jsdoc-to-markdown
FAQs
miscellaneous javascript functions
We found that yy-misc 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.