@douyinfe/semi-animation
Advanced tools
Comparing version 2.1.0-alpha.1 to 2.1.0-alpha.2
@@ -34,5 +34,3 @@ import _Date$now from "@babel/runtime-corejs3/core-js-stable/date/now"; | ||
export default class Animation extends Event { | ||
constructor() { | ||
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
constructor(props = {}, config = {}) { | ||
super(); | ||
@@ -39,0 +37,0 @@ this._props = _Object$assign({}, props); |
@@ -20,5 +20,3 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map"; | ||
function elastic() { | ||
let amplitude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; | ||
let period = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5; | ||
function elastic(amplitude = 1, period = 0.5) { | ||
const a = minMax(amplitude, 1, 10); | ||
@@ -25,0 +23,0 @@ const p = minMax(period, 0.1, 2); |
@@ -15,7 +15,3 @@ import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float"; | ||
// eslint-disable-next-line max-len | ||
export default function interpolate(from, to) { | ||
let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
let parser = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; | ||
let formatter = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; | ||
export default function interpolate(from, to, ratio = 0, parser = null, formatter = null) { | ||
if (typeof parser === 'function') { | ||
@@ -22,0 +18,0 @@ from = parser(from); |
@@ -8,10 +8,5 @@ import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout"; | ||
*/ | ||
export default function debounce(func) { | ||
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | ||
export default function debounce(func, delay = 0) { | ||
let timeoutId; | ||
return function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return function (...args) { | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
@@ -18,0 +13,0 @@ const context = this; |
@@ -22,9 +22,6 @@ import _Map from "@babel/runtime-corejs3/core-js-stable/map"; | ||
once(event, callback) { | ||
var _this = this; | ||
if (event && typeof callback === 'function') { | ||
const fn = function () { | ||
callback(...arguments); | ||
_this.off(event, fn); | ||
const fn = (...args) => { | ||
callback(...args); | ||
this.off(event, fn); | ||
}; | ||
@@ -57,9 +54,5 @@ | ||
emit(event) { | ||
emit(event, ...args) { | ||
var _context; | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
if (!this._eventMap.has(event)) { | ||
@@ -66,0 +59,0 @@ return false; |
@@ -1,7 +0,3 @@ | ||
const log = function (text) { | ||
const log = (text, ...rest) => { | ||
if (process.env.NODE_ENV === 'development') { | ||
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
rest[_key - 1] = arguments[_key]; | ||
} | ||
console.log(text, ...rest); | ||
@@ -8,0 +4,0 @@ } |
@@ -11,5 +11,3 @@ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign"; | ||
export default function wrapValue(val) { | ||
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
export default function wrapValue(val, config = {}) { | ||
if (shouldUseBezier(config)) { | ||
@@ -16,0 +14,0 @@ const easing = getEasing(config.easing); |
{ | ||
"name": "@douyinfe/semi-animation", | ||
"version": "2.1.0-alpha.1", | ||
"version": "2.1.0-alpha.2", | ||
"description": "animation base library for semi-ui", | ||
@@ -11,3 +11,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"main": "lib/cjs/index.js", | ||
"main": "lib/es/index.js", | ||
"module": "lib/es/index.js", | ||
@@ -48,3 +48,3 @@ "typings": "lib/es/index.d.ts", | ||
}, | ||
"gitHead": "1c0cec8640fb0f5da95138054e3fed1f304deff8" | ||
"gitHead": "50381484f8df8aaa00285cf0a2ee01edf0083115" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
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
0
60618
39
834
1