Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@cnbritain/common-js
Advanced tools
Object
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Object
Creates an object with user agent information
Kind: static property of detect
Url: http://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser
Boolean
window.history support
Kind: static property of detect
Boolean
Touch support
Kind: static property of detect
Boolean
Android useragent sniff
Kind: static property of detect
Boolean
iOS useragent sniff
Kind: static property of detect
Boolean
Linux useragent sniff
Kind: static property of detect
Boolean
Macintoch useragent sniff
Kind: static property of detect
Boolean
Windows useragent sniff
Kind: static property of detect
Boolean
Box model support
Kind: static property of detect
Boolean
HTML5 video support
Kind: static property of detect
Promise
Number/Function
function
function
Object
*
HTMLNode/Boolean
HTMLNode/Boolean
HTMLElement/Boolean
Object
Object
Number
Number
Number
Number
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Promise
Promise
Boolean
String
String
function
Boolean
*
Adds a class to an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
Adds an event to an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
type | String |
fn | function |
Adds an event that will fire once and then remove itself
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
type | String |
fn | function |
Adds html to a node
Kind: static method of functions
Param | Type |
---|---|
node | HTMLElement |
Promise
Basic ajax function
Kind: static method of functions
Param | Type |
---|---|
options | Object |
Number/Function
Clamps a value to the min and max. Also set up to allow currying.
Kind: static method of functions
Param | Type |
---|---|
min | Number |
max | Number |
value1 | Number |
function
Debounce function, allows one function to be ran wait
milliseconds after.
Kind: static method of functions
Param | Type | Description |
---|---|---|
fn | function | |
wait | Number | Number of milliseconds |
scope | Object | |
immediate | Boolean |
function
Creates a function that will delegate events to a selector
Kind: static method of functions
Param | Type |
---|---|
selector | String |
fn | function |
ctx | * |
Exits fullscreen mode for the element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
Loop over a collection and shift the item from the collection
Kind: static method of functions
Param | Type |
---|---|
collection | Array |
fn | function |
Object
Gets the elements offset. Based off of jquerys implementation
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
*
Gets the event target
Kind: static method of functions
Returns: *
- The target of the event
Param | Type | Description |
---|---|---|
e | Object | The event information |
HTMLNode/Boolean
Gets the iframe element based on the window
Kind: static method of functions
Param | Type |
---|---|
window | Window |
HTMLNode/Boolean
Gets the parent element matching the selector. If it doesn't match, returns nothing
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
selector | String |
HTMLElement/Boolean
Gets the previous element matching the selector. If it doesn't match, returns false
Kind: static method of functions
Param | Type |
---|---|
el | HTMLElement |
selector | String |
Object
Gets the parent till the selector or the root.
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
selector | String |
Object
Gets the previous element till the selector or the root
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
selector | String |
Number
Gets the scroll left of the element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode/Window |
Number
Gets the scroll top of the element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode/Window |
Number
Gets the scrollleft of the window
Kind: static method of functions
Number
Gets the scrolltop of the window
Kind: static method of functions
Boolean
Checks if the element has a class
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
Boolean
hasOwnProperty that prevents contamination from the object being tested
Kind: static method of functions
Param | Type |
---|---|
obj | Object |
key | String |
Boolean
Checks if the placement is in an article slot
Kind: static method of functions
Param | Type |
---|---|
placement | String |
Boolean
Checks if a value is defined
Kind: static method of functions
Param | Type |
---|---|
value | * |
Boolean
Checks if the value is an empty string
Kind: static method of functions
Param | Type |
---|---|
value | * |
Boolean
Checks if the placement is a header slot
Kind: static method of functions
Param | Type |
---|---|
placement | String |
Boolean
Checks if the placement is a splash slot
Kind: static method of functions
Param | Type |
---|---|
placement | String |
Boolean
Checks if win is a window element
Kind: static method of functions
Param | Type |
---|---|
win | * |
Promise
Loads a script file into the page
Kind: static method of functions
Param | Type |
---|---|
url | String |
options | Object |
Promise
Loads any social scripts. Includes twitter, facebook, vine and instagram
Kind: static method of functions
Boolean
Inverts the value
Kind: static method of functions
Param | Type |
---|---|
value | * |
Runs loadFn once the page has loaded
Kind: static method of functions
Param | Type |
---|---|
loadFn | function |
Runs readyFn once the page is ready
Kind: static method of functions
Param | Type |
---|---|
readyFn | function |
String
Pads a number
Kind: static method of functions
Param | Type |
---|---|
value | Number |
width | Number |
chr | String |
String
Generates a random id
Kind: static method of functions
Removes a class from an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
Removes the element from the tree
Kind: static method of functions
Param | Type |
---|---|
el | HTMLElement |
Removes an event from an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
type | String |
fn | function |
function
Throttles an event being fired by the threshold
Kind: static method of functions
Param | Type | Description |
---|---|---|
fn | function | |
threshhold | Number | Milliseconds to throttle by |
scope | Object |
Boolean
Converts a value to a boolean
Kind: static method of functions
Param | Type |
---|---|
value | * |
Toggles a class on an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
*
Unescapes a value from jinja
Kind: static method of functions
Param | Type |
---|---|
value | * |
FAQs
Common javascripts
The npm package @cnbritain/common-js receives a total of 3 weekly downloads. As such, @cnbritain/common-js popularity was classified as not popular.
We found that @cnbritain/common-js 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.