New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

yy-misc

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yy-misc

miscellaneous javascript functions

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

misc.js

miscellaneous javascript functions

Installation

include misc.js in your project or add to your workflow

npm install yy-misc

API Reference

Kind: global class

  • Misc

misc.difference(a, b) ⇒ number

return the difference between two numbers (greater - lesser)

Kind: instance method of Misc

ParamType
anumber
bnumber

misc.arrayCount(a) ⇒ object

returns {most, least, all[]} array grouped by value

Kind: instance method of Misc
Returns: object - {most: most, least: least, all: Array}

ParamType
aArray

misc.arraySmallest(a) ⇒ number

finds the smallest number in an array

Kind: instance method of Misc

ParamType
aArray

misc.sameSign(a, b)

returns whether a and b have the same sign or both equal 0

Kind: instance method of Misc

ParamType
anumber
bnumber
boolean

misc.preciseRound(num, decimals) ⇒ number

round number to certain number of decimals

Kind: instance method of Misc

ParamType
numnumber
decimalsnumber

misc.fontSize(text, maxWidth, [maxHeight], [fontFamily])

calculate ideal font size

Kind: instance method of Misc

ParamTypeDescription
textstring(use maximum-sized text)
maxWidthnumber
[maxHeight]number
[fontFamily]string

misc.wordCount(text) ⇒ number

from: http://stackoverflow.com/questions/6543917/count-number-of-words-in-string-using-javascript

Kind: instance method of Misc

ParamType
textstring

misc.aboutEqual(test, value, percent) ⇒ boolean

returns whether the test value is about equal to the value (i.e., within the given percentage)

Kind: instance method of Misc

ParamType
testnumber
valuenumber
percentnumber

misc.uniqueArray(a) ⇒ Array

Removes duplicates from array and returns new array from http://stackoverflow.com/questions/9229645/remove-duplicates-from-javascript-array

Kind: instance method of Misc

ParamType
aArray

misc.clamp(n, min, max) ⇒ number

clamps a number

Kind: instance method of Misc

ParamTypeDescription
nnumberto clamp
minnumber
maxnumber

Copyright (c) 2016 YOPEY YOPEY LLC - MIT License - Documented by jsdoc-to-markdown

FAQs

Package last updated on 03 Jan 2017

Did you know?

Socket

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.

Install

Related posts