Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@invision-www/scroll-to

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@invision-www/scroll-to - npm Package Compare versions

Comparing version 1.0.3 to 1.0.8-y.0

build-es5/scrollTo.js

17

build/index.js

@@ -1,15 +0,2 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _scrollTo;
function _load_scrollTo() {
return _scrollTo = _interopRequireDefault(require('./scrollTo'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (_scrollTo || _load_scrollTo()).default;
import scrollTo from './scrollTo';
export default scrollTo;

@@ -1,24 +0,4 @@

'use strict';
import raf from 'raf';
import eases from 'eases'; // -----------------------------------------------
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scrollTo;
var _raf;
function _load_raf() {
return _raf = _interopRequireDefault(require('raf'));
}
var _eases;
function _load_eases() {
return _eases = _interopRequireDefault(require('eases'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// -----------------------------------------------
/**

@@ -35,3 +15,4 @@ * ScrollTo

*/
function scrollTo(options) {
export default function scrollTo(options) {
if (typeof window === 'undefined') {

@@ -47,10 +28,10 @@ return;

var time = speed / 1000;
var tick = function tick() {
currentTime += 1 / 60;
var p = currentTime / time,
t = (_eases || _load_eases()).default[easing](p);
t = eases[easing](p);
if (p < 1) {
(0, (_raf || _load_raf()).default)(tick);
raf(tick);
window.scrollTo(0, scrollY + (scrollTargetY - scrollY) * t);

@@ -72,3 +53,3 @@ } else {

window.isScrolling = true;
(0, (_raf || _load_raf()).default)(tick);
}
raf(tick);
}
{
"name": "@invision-www/scroll-to",
"version": "1.0.3",
"version": "1.0.8-y.0",
"description": "",
"main": "dist/scrollTo.js",
"browser": "dist/scrollTo.js",
"main": "build/scrollTo.js",
"browser": "build-es5/scrollTo.js",
"scripts": {

@@ -8,0 +8,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

@@ -0,0 +0,0 @@ jest.mock('raf');

import scrollTo from './scrollTo';
export default scrollTo;

@@ -0,0 +0,0 @@ import raf from 'raf';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc