Skip to content

Commit

Permalink
export default for ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed May 11, 2022
1 parent ae3699f commit a378a14
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/inward.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/inward.ts
Expand Up @@ -204,6 +204,7 @@ function inward_validate_msg(spec: any) {
// TODO: gubu option to provide Error without throwing
// TODO: how to expose gubu builders, Required, etc?
// TODO: use original msg for error

try {
data.msg = ctx.actdef.gubu(msg)
} catch (e) {
Expand Down
3 changes: 2 additions & 1 deletion seneca.d.ts
@@ -1 +1,2 @@
export {};
declare function init(seneca_options?: any, more_options?: any): any;
export default init;
11 changes: 7 additions & 4 deletions seneca.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion seneca.js.map

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions seneca.ts
Expand Up @@ -226,9 +226,11 @@ const option_defaults = {

// System wide functionality.
system: {
// TODO: use Func shape

// Function to exit the process.
exit: () => process.exit,
exit: (...args: any[]) => {
process.exit(...args)
},

// Close instance on these signals, if true.
close_signals: {
Expand Down Expand Up @@ -425,7 +427,7 @@ Seneca.prototype.toJSON = function toJSON() {
Seneca.prototype[Util.inspect.custom] = Seneca.prototype.toJSON

// Create a Seneca instance.
module.exports = function init(seneca_options?: any, more_options?: any) {
function init(seneca_options?: any, more_options?: any) {
var initial_opts =
'string' === typeof seneca_options
? deep({}, { from: seneca_options }, more_options)
Expand Down Expand Up @@ -469,9 +471,13 @@ module.exports = function init(seneca_options?: any, more_options?: any) {
return seneca
}

module.exports = init

// Expose Seneca prototype for easier monkey-patching
module.exports.Seneca = Seneca

export default init

// To reference builtin loggers when defining logging options.
module.exports.loghandler = Legacy.loghandler

Expand Down

0 comments on commit a378a14

Please sign in to comment.