Comparing version 1.0.10 to 1.0.11
@@ -23,7 +23,11 @@ export declare namespace nxLogger { | ||
readonly configuration: Config; | ||
create?: FactoryFn; | ||
create: SimplyFactoryFn; | ||
on: (message: Message, callback: Function) => Function; | ||
} | ||
type FactoryFn = (configuration: ConfigPartial) => Log; | ||
type FactoryCreatorFn = (configuration: Config) => FactoryFn; | ||
type SimplyFactoryFn = (configuration: Config | Namespace) => Log; | ||
type FactoryCreatorFn = (configuration: Config) => SimplyFactoryFn; | ||
interface SimplyFactoryFn { | ||
(configuration: Config): Log; | ||
(...namespace: Namespace): Log; | ||
} | ||
type WriteFn = (configuration: Config) => (...messages: Message[]) => Result; | ||
@@ -33,2 +37,2 @@ type ConfigureFn = (options?: ConfigPartial) => Config; | ||
export declare const configure: nxLogger.ConfigureFn; | ||
export declare const create: nxLogger.FactoryFn; | ||
export declare const create: nxLogger.SimplyFactoryFn; |
@@ -7,3 +7,3 @@ "use strict"; | ||
namespace: [], | ||
transport: () => null, | ||
transport: (config, messages) => console.log(`${config.namespace.join(':')} - ${messages.join(' ')}`), | ||
tty: true, | ||
@@ -37,8 +37,7 @@ }; | ||
}; | ||
const logFactoryCreator = configuration => config => { | ||
const configs = mergeConfigurations(configuration, typeof config === 'string' ? { | ||
namespace: [config], | ||
} : config); | ||
const logFactoryCreator = configuration => (...namespace) => { | ||
const config = namespace[0]; | ||
const configs = mergeConfigurations(configuration, typeof config === 'string' ? { namespace } : config); | ||
return logFactory(configs); | ||
}; | ||
exports.create = logFactory(baseConfiguration).create; |
@@ -33,3 +33,3 @@ { | ||
"types": "dist/log.d.ts", | ||
"version": "1.0.10" | ||
"version": "1.0.11" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3484
77