@autoguru/utilities
Advanced tools
Comparing version 1.0.65 to 1.0.66
@@ -1,1 +0,1 @@ | ||
export declare const bindEvent: <Node_1 extends HTMLElement | HTMLDocument, K extends "fullscreenchange" | "fullscreenerror" | "abort" | "animationcancel" | "animationend" | "animationiteration" | "animationstart" | "auxclick" | "blur" | "cancel" | "canplay" | "canplaythrough" | "change" | "click" | "close" | "contextmenu" | "cuechange" | "dblclick" | "drag" | "dragend" | "dragenter" | "dragexit" | "dragleave" | "dragover" | "dragstart" | "drop" | "durationchange" | "emptied" | "ended" | "error" | "focus" | "focusin" | "focusout" | "gotpointercapture" | "input" | "invalid" | "keydown" | "keypress" | "keyup" | "load" | "loadeddata" | "loadedmetadata" | "loadend" | "loadstart" | "lostpointercapture" | "mousedown" | "mouseenter" | "mouseleave" | "mousemove" | "mouseout" | "mouseover" | "mouseup" | "pause" | "play" | "playing" | "pointercancel" | "pointerdown" | "pointerenter" | "pointerleave" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "progress" | "ratechange" | "reset" | "resize" | "scroll" | "securitypolicyviolation" | "seeked" | "seeking" | "select" | "selectionchange" | "selectstart" | "stalled" | "submit" | "suspend" | "timeupdate" | "toggle" | "touchcancel" | "touchend" | "touchmove" | "touchstart" | "transitioncancel" | "transitionend" | "transitionrun" | "transitionstart" | "volumechange" | "waiting" | "wheel" | "copy" | "cut" | "paste">(node: Node_1, event: K, callback: (event: HTMLElementEventMap[K]) => unknown) => () => void; | ||
export declare const bindEvent: <Node_1 extends HTMLElement | HTMLDocument>(node: Node_1, type: string, callback: (event: any) => unknown) => () => void; |
@@ -1,32 +0,8 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
'use strict' | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var tinyWarning = _interopDefault(require('tiny-warning')); | ||
var invariant = _interopDefault(require('tiny-invariant')); | ||
const clamp = (value, min, max) => Math.min(max, Math.max(value, min)); | ||
const wrapEvent = (handler, consumerHandler) => (event) => { | ||
invariant(typeof handler === 'function', 'You must supply a handler method.'); | ||
handler(event); | ||
if (!event.defaultPrevented && typeof consumerHandler !== 'undefined') { | ||
invariant(typeof consumerHandler === 'function', 'You supplied a consumer handler that was supposed to be a function.'); | ||
return consumerHandler(event); | ||
} | ||
}; | ||
const bindEvent = (node, event, callback) => { | ||
node.addEventListener(event, callback); | ||
return () => { | ||
node.removeEventListener(event, callback); | ||
}; | ||
}; | ||
exports.warning = tinyWarning; | ||
exports.invariant = invariant; | ||
exports.bindEvent = bindEvent; | ||
exports.clamp = clamp; | ||
exports.wrapEvent = wrapEvent; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./utilities.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./utilities.cjs.development.js') | ||
} |
{ | ||
"name": "@autoguru/utilities", | ||
"version": "1.0.65", | ||
"version": "1.0.66", | ||
"description": "A collection of smallish things that help AutoGuru write code.", | ||
@@ -16,3 +16,3 @@ "homepage": "https://github.com/autoguru-au/octane/tree/master/packages/utilities#readme", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build": "tsdx build", | ||
"prepublish": "yarn run build" | ||
@@ -27,6 +27,4 @@ }, | ||
"@autoguru/jest-preset": "^1.0.64", | ||
"@autoguru/tsconfig": "^1.0.63", | ||
"rollup": "^1.20.3", | ||
"rollup-plugin-typescript2": "^0.24.0", | ||
"typescript": "~3.6.2" | ||
"tsdx": "^0.9.1", | ||
"typescript": "next" | ||
}, | ||
@@ -36,3 +34,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "76af5f4b3377f49e2d011ad597c4420344121b3d" | ||
"gitHead": "6a3742187b013d2c7602e45564b7246e763484db" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13648
4
17
75
1
4