Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: build and tests
name: build and test

on: [push]

jobs:
build:
build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [lts/*]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm clean-install
- run: npm test
19 changes: 17 additions & 2 deletions src/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Easing from './Easing'
import Group from './Group'
import Interpolation from './Interpolation'
import now, { setNow } from './Now'
import now, {setNow} from './Now'
import Sequence from './Sequence'
import Tween from './Tween'
import VERSION from './Version'
Expand Down Expand Up @@ -273,7 +273,22 @@ const update = TWEEN.update.bind(TWEEN)

// NOTE! Make sure both lists of exports below are kept in sync:

export {Easing, Group, Interpolation, now, setNow, Sequence, nextId, Tween, VERSION, getAll, removeAll, add, remove, update}
export {
Easing,
Group,
Interpolation,
now,
setNow,
Sequence,
nextId,
Tween,
VERSION,
getAll,
removeAll,
add,
remove,
update,
}

const exports = {
Easing,
Expand Down
4 changes: 2 additions & 2 deletions src/Now.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
let _nowFunc: Function = () => performance.now()

const now = (): number => {
return _nowFunc()
return _nowFunc()
}

export function setNow(nowFunction: Function) {
_nowFunc = nowFunction
_nowFunc = nowFunction
}

export default now
Loading