Skip to content

Commit

Permalink
fix: add .js file extensions on imports to support node ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleRoss committed Nov 18, 2021
1 parent 551e43d commit 2fcf770
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/LambdaLog.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import EventEmitter from 'events';
import { LambdaLogOptions, Message, GenericRecord, LogLevels, LogObject, Tag, ConsoleObject } from './typings';
import LogMessage from './LogMessage';
import { toBool } from './utils';
import { LambdaLogOptions, Message, GenericRecord, LogLevels, LogObject, Tag, ConsoleObject } from './typings.js';
import LogMessage from './LogMessage.js';
import { toBool } from './utils.js';


const levels = [{
Expand Down
4 changes: 2 additions & 2 deletions src/LogMessage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import stringify from 'fast-safe-stringify';
import { LambdaLogOptions, Message, LogObject, Tag, GenericRecord, Formatter, StubbedError, Empty } from './typings';
import { isError, stubError } from './utils';
import { LambdaLogOptions, Message, LogObject, Tag, GenericRecord, Formatter, StubbedError, Empty } from './typings.js';
import { isError, stubError } from './utils.js';

export interface ILogMessage {
readonly __opts: LambdaLogOptions;
Expand Down
10 changes: 2 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import LambdaLog from './LambdaLog';
import LogMessage from './LogMessage';
import LambdaLog from './LambdaLog.js';
import LogMessage from './LogMessage.js';

/**
* Instance of the LambdaLog class which is exported when calling `require('lambda-log')`. For more
* advanced usage, you can create a new instance of the LambdaLog class via `new log.LambdaLog()`.
* @type {LambdaLog}
*/
export default new LambdaLog();
export { LambdaLog, LogMessage };
export * from './typings';
2 changes: 1 addition & 1 deletion src/typings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LogMessage from './LogMessage';
import LogMessage from './LogMessage.js';
import stringify from 'fast-safe-stringify';

export type GenericRecord<K extends string | number = string | number, V = unknown> = Record<K, V>;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GenericRecord, StubbedError } from './typings';
import { GenericRecord, StubbedError } from './typings.js';

/**
* Checks if value is an Error or Error-like object
Expand Down

0 comments on commit 2fcf770

Please sign in to comment.