Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(datastore): handle rolling up momentjs
fix(datastore): fix datastore stack traces feat(client): datastore typing
- Loading branch information
1 parent
a44549b
commit 01e29eb
Showing
10 changed files
with
173 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Runner } from '@ulixee/datastore'; | ||
import { InvalidSignatureError } from '@ulixee/crypto/lib/errors'; | ||
|
||
export default new Runner({ | ||
async run(ctx) { | ||
const y = await multiply(2); | ||
ctx.Output.emit({ y }); | ||
}, | ||
}); | ||
|
||
const multiply = async (x: number): Promise<number> => { | ||
for (let i = 0; i <= 100; i += 1) { | ||
await new Promise(process.nextTick); | ||
x += i ** 2; | ||
if (i === 99) throw new InvalidSignatureError('ERROR!!!'); | ||
} | ||
return x; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Datastore from '@ulixee/datastore'; | ||
import errorStack from './errorStack'; | ||
|
||
export default new Datastore({ | ||
runners: { | ||
errorStack, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Datastore, { Runner } from '@ulixee/datastore'; | ||
import * as moment from 'moment'; | ||
import { date, string } from '@ulixee/schema'; | ||
|
||
export default new Datastore({ | ||
runners: { | ||
moment: new Runner({ | ||
run(ctx) { | ||
ctx.Output.emit({ date: moment(ctx.input.date).toDate() }); | ||
}, | ||
schema: { | ||
input: { | ||
date: string({ format: 'date' }), | ||
}, | ||
output: { | ||
date: date(), | ||
}, | ||
}, | ||
}), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.