standard-log 9.1.6 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/cjs/console.js +1 -1
  2. package/cjs/console.js.map +1 -1
  3. package/cjs/console.spec.js +8 -0
  4. package/cjs/console.spec.js.map +1 -1
  5. package/cjs/formatter.d.ts +11 -1
  6. package/cjs/formatter.d.ts.map +1 -1
  7. package/cjs/formatter.js +15 -1
  8. package/cjs/formatter.js.map +1 -1
  9. package/cjs/logger.d.ts +1 -1
  10. package/cjs/logger.d.ts.map +1 -1
  11. package/cjs/logger.js.map +1 -1
  12. package/cjs/standardLog.d.ts +2 -2
  13. package/cjs/standardLog.d.ts.map +1 -1
  14. package/cjs/standardLog.js.map +1 -1
  15. package/cjs/standardLog.spec.js +2 -2
  16. package/cjs/standardLog.spec.js.map +1 -1
  17. package/cjs/types.d.ts +3 -3
  18. package/cjs/types.js.map +1 -1
  19. package/dist/standard-log.es5.js +181 -51
  20. package/dist/standard-log.es5.js.gz +0 -0
  21. package/dist/standard-log.es5.js.map +1 -1
  22. package/dist/standard-log.es5.js.map.gz +0 -0
  23. package/dist/standard-log.esm.js +59 -3
  24. package/dist/standard-log.esm.js.gz +0 -0
  25. package/dist/standard-log.esm.js.map +1 -1
  26. package/dist/standard-log.esm.js.map.gz +0 -0
  27. package/esm/console.js +3 -3
  28. package/esm/console.js.map +1 -1
  29. package/esm/console.spec.js +8 -0
  30. package/esm/console.spec.js.map +1 -1
  31. package/esm/formatter.d.ts +11 -1
  32. package/esm/formatter.d.ts.map +1 -1
  33. package/esm/formatter.js +12 -0
  34. package/esm/formatter.js.map +1 -1
  35. package/esm/logger.d.ts +1 -1
  36. package/esm/logger.d.ts.map +1 -1
  37. package/esm/logger.js.map +1 -1
  38. package/esm/standardLog.d.ts +2 -2
  39. package/esm/standardLog.d.ts.map +1 -1
  40. package/esm/standardLog.js.map +1 -1
  41. package/esm/standardLog.spec.js +2 -2
  42. package/esm/standardLog.spec.js.map +1 -1
  43. package/esm/types.d.ts +3 -3
  44. package/esm/types.js.map +1 -1
  45. package/package.json +6 -6
  46. package/ts/console.ts +3 -3
  47. package/ts/formatter.ts +14 -1
  48. package/ts/logger.ts +3 -3
  49. package/ts/standardLog.ts +1 -1
  50. package/ts/types.ts +3 -3
package/cjs/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface LoggerOptions extends StackTraceMeta {
8
8
  level?: number;
9
9
  writeTo?: LogReporter | ReporterFilter;
10
10
  }
11
- export declare type Logger<T extends string = LogMethodNames> = {
11
+ export declare type Logger<N extends string = LogMethodNames> = {
12
12
  readonly id: string;
13
13
  /**
14
14
  * Logger local log level.
@@ -19,13 +19,13 @@ export declare type Logger<T extends string = LogMethodNames> = {
19
19
  * This is useful during debugging to check for steps executed.
20
20
  */
21
21
  count(...args: any[]): void;
22
- on(level: number | T, logFunction: LogFunction): void;
22
+ on(level: number | N, logFunction: LogFunction): void;
23
23
  /**
24
24
  * Write custom log entries.
25
25
  */
26
26
  write(entry: LogEntry): void;
27
27
  } & {
28
- [k in T]: LogMethod;
28
+ [k in N]: LogMethod;
29
29
  };
30
30
  /**
31
31
  * Names of the standard log methods.
package/cjs/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StackTraceMeta } from '@just-func/types'\n\nexport type StandardLogOptions<CustomLevelNames extends string = LogMethodNames> = {\n customLevels?: Record<CustomLevelNames, number>,\n logLevel?: number,\n reporters?: LogReporter[]\n}\n\nexport interface LoggerOptions extends StackTraceMeta {\n level?: number,\n writeTo?: LogReporter | ReporterFilter\n}\n\nexport type Logger<T extends string = LogMethodNames> = {\n readonly id: string,\n /**\n * Logger local log level.\n */\n level?: number,\n /**\n * Logs with an increment counter.\n * This is useful during debugging to check for steps executed.\n */\n count(...args: any[]): void,\n on(level: number | T, logFunction: LogFunction): void,\n /**\n * Write custom log entries.\n */\n write(entry: LogEntry): void\n} & { [k in T]: LogMethod }\n\n/**\n * Names of the standard log methods.\n */\nexport type LogMethodNames = 'emergency' | 'alert' | 'critical' | 'error' | 'warn' | 'notice' | 'info' | 'debug' | 'trace' | 'planck'\n\nexport type LogEntry = {\n id: string,\n level: number,\n // args instead of messages because it is `any[]` instead of `string[]`\n args: any[],\n timestamp: Date\n}\n\nexport type LogMethod = (...args: any[]) => void\n\nexport type LogFunction = ((log: LogMethod) => void) | (() => string)\n\nexport type ReporterFilter = string | RegExp | ((reporterId: string) => boolean)\n\n/**\n * Formats a log entry.\n * Depends on the reporter, it can expect a different return type.\n * By default the return type is `any[]` which the `console` accepts.\n */\nexport type LogFormatter<T = any[]> = (entry: LogEntry) => T\n\n/**\n * Determines whether the entry should be written.\n */\nexport type LogFilter = (entry: LogEntry) => boolean\n\nexport type LogLevelEntry = { name: string, level: number }\n\nexport interface LogReporter<T = any> {\n readonly id: string,\n /**\n * Specifies the formatter to be used by the reporter.\n * Using this you can customize how the reporter writes the log entry.\n */\n readonly formatter: LogFormatter<T>,\n /**\n * Specifies a filter to determine should the log be written.\n */\n readonly filter?: LogFilter,\n /**\n * Indicate if this is a console reporter.\n * There is only one console reporter can be present in the system.\n */\n readonly isConsoleReporter?: boolean,\n write(entry: LogEntry): void\n}\n\nexport type LogReporterOptions<T = any> = {\n id?: string,\n /**\n * Specifies the formatter to be used by the reporter.\n * Using this you can customize how the reporter writes the log entry.\n */\n formatter?: LogFormatter<T>,\n /**\n * Specifies a filter to determine should the log be written.\n */\n filter?: LogFilter\n}\n\nexport type LogLevel = number\n\nexport interface ConsoleLike {\n debug(...args: any[]): void,\n info(...args: any[]): void,\n warn(...args: any[]): void,\n error(...args: any[]): void,\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StackTraceMeta } from '@just-func/types'\n\nexport type StandardLogOptions<CustomLevelNames extends string = LogMethodNames> = {\n customLevels?: Record<CustomLevelNames, number>,\n logLevel?: number,\n reporters?: LogReporter[]\n}\n\nexport interface LoggerOptions extends StackTraceMeta {\n level?: number,\n writeTo?: LogReporter | ReporterFilter\n}\n\nexport type Logger<N extends string = LogMethodNames> = {\n readonly id: string,\n /**\n * Logger local log level.\n */\n level?: number,\n /**\n * Logs with an increment counter.\n * This is useful during debugging to check for steps executed.\n */\n count(...args: any[]): void,\n on(level: number | N, logFunction: LogFunction): void,\n /**\n * Write custom log entries.\n */\n write(entry: LogEntry): void\n} & { [k in N]: LogMethod }\n\n/**\n * Names of the standard log methods.\n */\nexport type LogMethodNames = 'emergency' | 'alert' | 'critical' | 'error' | 'warn' | 'notice' | 'info' | 'debug' | 'trace' | 'planck'\n\nexport type LogEntry = {\n id: string,\n level: number,\n // args instead of messages because it is `any[]` instead of `string[]`\n args: any[],\n timestamp: Date\n}\n\nexport type LogMethod = (...args: any[]) => void\n\nexport type LogFunction = ((log: LogMethod) => void) | (() => string)\n\nexport type ReporterFilter = string | RegExp | ((reporterId: string) => boolean)\n\n/**\n * Formats a log entry.\n * Depends on the reporter, it can expect a different return type.\n * By default the return type is `any[]` which the `console` accepts.\n */\nexport type LogFormatter<T = any[]> = (entry: LogEntry) => T\n\n/**\n * Determines whether the entry should be written.\n */\nexport type LogFilter = (entry: LogEntry) => boolean\n\nexport type LogLevelEntry = { name: string, level: number }\n\nexport interface LogReporter<T = any> {\n readonly id: string,\n /**\n * Specifies the formatter to be used by the reporter.\n * Using this you can customize how the reporter writes the log entry.\n */\n readonly formatter: LogFormatter<T>,\n /**\n * Specifies a filter to determine should the log be written.\n */\n readonly filter?: LogFilter,\n /**\n * Indicate if this is a console reporter.\n * There is only one console reporter can be present in the system.\n */\n readonly isConsoleReporter?: boolean,\n write(entry: LogEntry): void\n}\n\nexport type LogReporterOptions<T = any> = {\n id?: string,\n /**\n * Specifies the formatter to be used by the reporter.\n * Using this you can customize how the reporter writes the log entry.\n */\n formatter?: LogFormatter<T>,\n /**\n * Specifies a filter to determine should the log be written.\n */\n filter?: LogFilter\n}\n\nexport type LogLevel = number\n\nexport interface ConsoleLike {\n debug(...args: any[]): void,\n info(...args: any[]): void,\n warn(...args: any[]): void,\n error(...args: any[]): void,\n}\n"]}
@@ -5872,7 +5872,7 @@ function buildFn(name) {
5872
5872
  };
5873
5873
  }
5874
5874
  function createConsoleLogReporter(options) {
5875
- var _a = (0, type_plus_1.required)({ id: 'console', formatter: formatter_js_1.plainLogFormatter }, options), id = _a.id, formatter = _a.formatter, filter = _a.filter;
5875
+ var _a = (0, type_plus_1.unpartial)({ id: 'console', formatter: formatter_js_1.consoleFormatter }, options), id = _a.id, formatter = _a.formatter, filter = _a.filter;
5876
5876
  if (!platform_js_1.polyfill.console)
5877
5877
  platform_js_1.polyfill.console = buildPolyfillConsole();
5878
5878
  return Object.freeze({
@@ -5970,7 +5970,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5970
5970
  return (mod && mod.__esModule) ? mod : { "default": mod };
5971
5971
  };
5972
5972
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5973
- exports.plainLogFormatter = exports.formatLogLevel = exports.createTimestampFormatter = void 0;
5973
+ exports.consoleFormatter = exports.plainLogFormatter = exports.formatLogLevel = exports.createTimestampFormatter = void 0;
5974
5974
  var ms_1 = __importDefault(__webpack_require__(/*! ms */ "../../node_modules/ms/index.js"));
5975
5975
  var upper_case_1 = __webpack_require__(/*! upper-case */ "../../node_modules/upper-case/dist/index.js");
5976
5976
  var logLevels_js_1 = __webpack_require__(/*! ./logLevels.js */ "./ts/logLevels.ts");
@@ -5996,11 +5996,25 @@ function formatLogLevel(level) {
5996
5996
  return "(".concat((0, upper_case_1.upperCase)((0, logLevels_js_1.toLogLevelName)(level)), ")");
5997
5997
  }
5998
5998
  exports.formatLogLevel = formatLogLevel;
5999
+ /**
6000
+ * Formats log entry as plain text with the following format:
6001
+ * `timestamp id level ...args`
6002
+ *
6003
+ * This is typically useful for writing logs to file
6004
+ */
5999
6005
  function plainLogFormatter(_a) {
6000
6006
  var id = _a.id, level = _a.level, args = _a.args, timestamp = _a.timestamp;
6001
6007
  return __spreadArray([timestamp.toISOString(), id, formatLogLevel(level)], args, true);
6002
6008
  }
6003
6009
  exports.plainLogFormatter = plainLogFormatter;
6010
+ /**
6011
+ * Formats log entry like default console log.
6012
+ */
6013
+ function consoleFormatter(_a) {
6014
+ var args = _a.args;
6015
+ return args;
6016
+ }
6017
+ exports.consoleFormatter = consoleFormatter;
6004
6018
 
6005
6019
 
6006
6020
  /***/ }),
@@ -8873,6 +8887,134 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
8873
8887
 
8874
8888
  /***/ }),
8875
8889
 
8890
+ /***/ "../../node_modules/tersify/node_modules/unpartial/cjs/index.js":
8891
+ /*!**********************************************************************!*\
8892
+ !*** ../../node_modules/tersify/node_modules/unpartial/cjs/index.js ***!
8893
+ \**********************************************************************/
8894
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8895
+
8896
+ "use strict";
8897
+
8898
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8899
+ if (k2 === undefined) k2 = k;
8900
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8901
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8902
+ desc = { enumerable: true, get: function() { return m[k]; } };
8903
+ }
8904
+ Object.defineProperty(o, k2, desc);
8905
+ }) : (function(o, m, k, k2) {
8906
+ if (k2 === undefined) k2 = k;
8907
+ o[k2] = m[k];
8908
+ }));
8909
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
8910
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
8911
+ };
8912
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
8913
+ __exportStar(__webpack_require__(/*! ./required.js */ "../../node_modules/tersify/node_modules/unpartial/cjs/required.js"), exports);
8914
+ __exportStar(__webpack_require__(/*! ./unpartial.js */ "../../node_modules/tersify/node_modules/unpartial/cjs/unpartial.js"), exports);
8915
+ //# sourceMappingURL=index.js.map
8916
+
8917
+ /***/ }),
8918
+
8919
+ /***/ "../../node_modules/tersify/node_modules/unpartial/cjs/required.js":
8920
+ /*!*************************************************************************!*\
8921
+ !*** ../../node_modules/tersify/node_modules/unpartial/cjs/required.js ***!
8922
+ \*************************************************************************/
8923
+ /***/ (function(__unused_webpack_module, exports) {
8924
+
8925
+ "use strict";
8926
+
8927
+ var __assign = (this && this.__assign) || function () {
8928
+ __assign = Object.assign || function(t) {
8929
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8930
+ s = arguments[i];
8931
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8932
+ t[p] = s[p];
8933
+ }
8934
+ return t;
8935
+ };
8936
+ return __assign.apply(this, arguments);
8937
+ };
8938
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
8939
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8940
+ if (ar || !(i in from)) {
8941
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
8942
+ ar[i] = from[i];
8943
+ }
8944
+ }
8945
+ return to.concat(ar || Array.prototype.slice.call(from));
8946
+ };
8947
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
8948
+ exports.requiredDeep = exports.required = void 0;
8949
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
8950
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
8951
+ function required(source1, source2, source3) {
8952
+ return merge([source1, source2, source3], function (p, e) { return (__assign(__assign({}, p), e)); });
8953
+ }
8954
+ exports.required = required;
8955
+ function requiredDeep(source1, source2, source3) {
8956
+ return merge([source1, source2, source3], function (p, e) { return deepmerge(p, e); });
8957
+ }
8958
+ exports.requiredDeep = requiredDeep;
8959
+ function merge(entries, reducer) {
8960
+ if (entries[0] === undefined || entries[0] === null)
8961
+ return entries[0];
8962
+ return entries.filter(function (x) { return !!x; }).reduce(reducer, {});
8963
+ }
8964
+ function deepmerge(source1, source2) {
8965
+ if (typeof source1 !== 'object' || source1 === null)
8966
+ return source2 !== undefined ? source2 : source1;
8967
+ if (Array.isArray(source1)) {
8968
+ if (Array.isArray(source2))
8969
+ return source2;
8970
+ if (source2 === undefined)
8971
+ return __spreadArray([], source1, true);
8972
+ return __spreadArray(__spreadArray([], source1, true), [source2], false);
8973
+ }
8974
+ return getAllKeys(source1).concat(getAllKeys(source2)).reduce(function (p, k) {
8975
+ // @ts-ignore
8976
+ p[k] = deepmerge(source1[k], source2 && source2[k]);
8977
+ return p;
8978
+ }, {});
8979
+ }
8980
+ function getAllKeys(subject, internal) {
8981
+ if (internal === void 0) { internal = false; }
8982
+ if (typeof subject !== 'object')
8983
+ return [];
8984
+ var propertyNames = Object.getOwnPropertyNames(subject);
8985
+ var keys = internal ? propertyNames.filter(function (n) { return n !== 'constructor'; }) : propertyNames;
8986
+ var proto = Object.getPrototypeOf(subject);
8987
+ return proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;
8988
+ }
8989
+ //# sourceMappingURL=required.js.map
8990
+
8991
+ /***/ }),
8992
+
8993
+ /***/ "../../node_modules/tersify/node_modules/unpartial/cjs/unpartial.js":
8994
+ /*!**************************************************************************!*\
8995
+ !*** ../../node_modules/tersify/node_modules/unpartial/cjs/unpartial.js ***!
8996
+ \**************************************************************************/
8997
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8998
+
8999
+ "use strict";
9000
+
9001
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
9002
+ exports.unpartialRecursively = exports.unpartial = void 0;
9003
+ var required_js_1 = __webpack_require__(/*! ./required.js */ "../../node_modules/tersify/node_modules/unpartial/cjs/required.js");
9004
+ function unpartial(arg1, arg2, arg3) {
9005
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9006
+ return (0, required_js_1.required)(arg1, arg2, arg3);
9007
+ }
9008
+ exports.unpartial = unpartial;
9009
+ function unpartialRecursively(arg1, arg2, arg3) {
9010
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9011
+ return (0, required_js_1.requiredDeep)(arg1, arg2, arg3);
9012
+ }
9013
+ exports.unpartialRecursively = unpartialRecursively;
9014
+ //# sourceMappingURL=unpartial.js.map
9015
+
9016
+ /***/ }),
9017
+
8876
9018
  /***/ "../../node_modules/type-plus/cjs/JSONTypes.js":
8877
9019
  /*!*****************************************************!*\
8878
9020
  !*** ../../node_modules/type-plus/cjs/JSONTypes.js ***!
@@ -9121,6 +9263,7 @@ assertType.custom = function (validator) {
9121
9263
  return;
9122
9264
  };
9123
9265
  };
9266
+ assertType.as = function (subject) { };
9124
9267
  //# sourceMappingURL=assertType.js.map
9125
9268
 
9126
9269
  /***/ }),
@@ -9304,11 +9447,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
9304
9447
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
9305
9448
  };
9306
9449
  Object.defineProperty(exports, "__esModule", ({ value: true }));
9307
- exports.requiredDeep = exports.required = void 0;
9450
+ exports.unpartial = exports.requiredDeep = exports.required = void 0;
9308
9451
  // import * as types from './types/index.js'
9309
9452
  var unpartial_1 = __webpack_require__(/*! unpartial */ "../../node_modules/unpartial/cjs/index.js");
9310
9453
  Object.defineProperty(exports, "required", ({ enumerable: true, get: function () { return unpartial_1.required; } }));
9311
9454
  Object.defineProperty(exports, "requiredDeep", ({ enumerable: true, get: function () { return unpartial_1.requiredDeep; } }));
9455
+ Object.defineProperty(exports, "unpartial", ({ enumerable: true, get: function () { return unpartial_1.unpartial; } }));
9312
9456
  __exportStar(__webpack_require__(/*! ./array/index.js */ "../../node_modules/type-plus/cjs/array/index.js"), exports);
9313
9457
  __exportStar(__webpack_require__(/*! ./assertion/index.js */ "../../node_modules/type-plus/cjs/assertion/index.js"), exports);
9314
9458
  __exportStar(__webpack_require__(/*! ./class/index.js */ "../../node_modules/type-plus/cjs/class/index.js"), exports);
@@ -10319,7 +10463,9 @@ exports.requiredDeep = exports.required = void 0;
10319
10463
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
10320
10464
  /* eslint-disable @typescript-eslint/no-unsafe-return */
10321
10465
  function required(source1, source2, source3) {
10322
- return merge([source1, source2, source3], function (p, e) { return (__assign(__assign({}, p), e)); });
10466
+ return merge([source1, source2, source3], function (p, e) {
10467
+ return __assign(__assign({}, p), e);
10468
+ });
10323
10469
  }
10324
10470
  exports.required = required;
10325
10471
  function requiredDeep(source1, source2, source3) {
@@ -10368,51 +10514,46 @@ function getAllKeys(subject, internal) {
10368
10514
 
10369
10515
  "use strict";
10370
10516
 
10517
+ var __assign = (this && this.__assign) || function () {
10518
+ __assign = Object.assign || function(t) {
10519
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10520
+ s = arguments[i];
10521
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10522
+ t[p] = s[p];
10523
+ }
10524
+ return t;
10525
+ };
10526
+ return __assign.apply(this, arguments);
10527
+ };
10371
10528
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10372
- exports.unpartialRecursively = exports.unpartial = void 0;
10529
+ exports.unpartial = exports.unpartialRecursively = void 0;
10373
10530
  var required_js_1 = __webpack_require__(/*! ./required.js */ "../../node_modules/unpartial/cjs/required.js");
10374
- function unpartial(arg1, arg2, arg3) {
10375
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
10376
- return (0, required_js_1.required)(arg1, arg2, arg3);
10377
- }
10378
- exports.unpartial = unpartial;
10379
10531
  function unpartialRecursively(arg1, arg2, arg3) {
10380
10532
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
10381
10533
  return (0, required_js_1.requiredDeep)(arg1, arg2, arg3);
10382
10534
  }
10383
10535
  exports.unpartialRecursively = unpartialRecursively;
10536
+ function unpartial(s1, s2, s3) {
10537
+ // defensive check for JS
10538
+ if (s1 === undefined || s1 === null)
10539
+ return s1;
10540
+ return [s1, s2, s3]
10541
+ .filter(notNil)
10542
+ .reduce(function (p, s) { return (__assign(__assign({}, p), trimNilProps(s))); }, {});
10543
+ }
10544
+ exports.unpartial = unpartial;
10545
+ function trimNilProps(value) {
10546
+ return Object.keys(value).reduce(function (p, k) {
10547
+ if (notNil(value[k]))
10548
+ p[k] = value[k];
10549
+ return p;
10550
+ }, {});
10551
+ }
10552
+ function notNil(value) {
10553
+ return value !== null && value !== undefined;
10554
+ }
10384
10555
  //# sourceMappingURL=unpartial.js.map
10385
10556
 
10386
- /***/ }),
10387
-
10388
- /***/ "../../node_modules/tersify/node_modules/unpartial/cjs/index.js":
10389
- /*!**********************************************************************!*\
10390
- !*** ../../node_modules/tersify/node_modules/unpartial/cjs/index.js ***!
10391
- \**********************************************************************/
10392
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
10393
-
10394
- "use strict";
10395
- __webpack_require__.r(__webpack_exports__);
10396
-
10397
- var __createBinding = (undefined && undefined.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10398
- if (k2 === undefined) k2 = k;
10399
- var desc = Object.getOwnPropertyDescriptor(m, k);
10400
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10401
- desc = { enumerable: true, get: function() { return m[k]; } };
10402
- }
10403
- Object.defineProperty(o, k2, desc);
10404
- }) : (function(o, m, k, k2) {
10405
- if (k2 === undefined) k2 = k;
10406
- o[k2] = m[k];
10407
- }));
10408
- var __exportStar = (undefined && undefined.__exportStar) || function(m, exports) {
10409
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
10410
- };
10411
- Object.defineProperty(exports, "__esModule", { value: true });
10412
- __exportStar(require("./required.js"), exports);
10413
- __exportStar(require("./unpartial.js"), exports);
10414
- //# sourceMappingURL=index.js.map
10415
-
10416
10557
  /***/ })
10417
10558
 
10418
10559
  /******/ });
@@ -10454,17 +10595,6 @@ __exportStar(require("./unpartial.js"), exports);
10454
10595
  /******/ })();
10455
10596
  /******/ }();
10456
10597
  /******/
10457
- /******/ /* webpack/runtime/make namespace object */
10458
- /******/ !function() {
10459
- /******/ // define __esModule on exports
10460
- /******/ __webpack_require__.r = function(exports) {
10461
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
10462
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10463
- /******/ }
10464
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
10465
- /******/ };
10466
- /******/ }();
10467
- /******/
10468
10598
  /************************************************************************/
10469
10599
  /******/
10470
10600
  /******/ // startup
Binary file