Skip to content

Commit 69f28d4

Browse files
committed
update README header and remove moment
1 parent 9bd94ce commit 69f28d4

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
2-
[![Maintainability](https://api.codeclimate.com/v1/badges/b321644ef368976aee12/maintainability)](https://codeclimate.com/github/vibou/serverless-step-functions-offline/maintainability)
1+
<p>
2+
<a href="https://github.com/vibou/serverless-step-functions-offline#readme">
3+
<img src="http://public.serverless.com/badges/v2.svg">
4+
</a>
5+
<a href="https://github.com/vibou/serverless-step-functions-offline#readme">
6+
<img src="https://img.shields.io/github/workflow/status/dherault/serverless-offline/Integrate">
7+
</a>
8+
<img src="https://img.shields.io/node/v/serverless-offline.svg?style=flat-square">
9+
<a href="https://github.com/vibou/serverless-step-functions-offline#readme">
10+
<img src="https://img.shields.io/badge/dependencies-serverless%20%5E2.53.1-yellow">
11+
</a>
12+
</p>
313

414
[![NPM](https://nodei.co/npm/@vibou/serverless-step-functions-offline.png)](https://nodei.co/npm/@vibou/serverless-step-functions-offline/)
515

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vibou/serverless-step-functions-offline",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"description": "Serverlesss plugin to support step function offline",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
2323
"build:watch": "rm -Rf dist && babel src/*.ts --watch --out-dir dist --extensions \".ts,.tsx\" --source-maps inline"
2424
},
2525
"dependencies": {
26+
"dayjs": "^1.11.5",
2627
"lodash": "^4.17.15",
27-
"moment": "2.29.3",
2828
"uuid": "^9.0.0"
2929
},
3030
"devDependencies": {

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import os from 'os';
44
import path from 'path';
55

66
import { Choice, Fail, Map, Parallel, Pass, State, StateMachine, Succeed, Task, Wait } from 'asl-types';
7+
import dayjs from 'dayjs';
78
import _ from 'lodash';
8-
import moment from 'moment';
99
import Serverless from 'serverless';
1010
import Plugin, { Logging } from 'serverless/classes/Plugin';
1111
import { v4 } from 'uuid';
@@ -715,7 +715,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
715715
let waitTimer = 0,
716716
targetTime,
717717
timeDiff;
718-
const currentTime = moment();
718+
const currentTime = dayjs();
719719
const waitListKeys = ['Seconds', 'Timestamp', 'TimestampPath', 'SecondsPath'];
720720
const waitField = _.omit(currentState, 'Type', 'Next', 'Result');
721721
const waitKey = Object.keys(waitField)[0];
@@ -728,7 +728,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
728728
waitTimer = waitField['Seconds'];
729729
break;
730730
case 'Timestamp':
731-
targetTime = moment(waitField['Timestamp']);
731+
targetTime = dayjs(waitField['Timestamp']);
732732
timeDiff = targetTime.diff(currentTime, 'seconds');
733733
if (timeDiff > 0) waitTimer = timeDiff;
734734
break;
@@ -739,7 +739,7 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
739739
The TimestampPath parameter does not reference an input value: ${waitField['TimestampPath']}`;
740740
throw new this.serverless.classes.Error(error);
741741
}
742-
targetTime = moment(event[timestampPath]);
742+
targetTime = dayjs(event[timestampPath]);
743743
timeDiff = targetTime.diff(currentTime, 'seconds');
744744
if (timeDiff > 0) waitTimer = timeDiff;
745745
break;

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,11 +5194,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
51945194
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
51955195
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
51965196

5197-
5198-
version "2.29.3"
5199-
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3"
5200-
integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==
5201-
52025197
52035198
version "2.0.0"
52045199
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"

0 commit comments

Comments
 (0)