@nu-art/ts-common 0.203.117 → 0.203.118

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.
@@ -87,6 +87,9 @@ export declare const HttpCodes: {
87
87
  readonly IM_A_TEAPOT: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
88
88
  code: number;
89
89
  };
90
+ readonly FAILED_VALIDATION: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
91
+ code: number;
92
+ };
90
93
  readonly MISDIRECTED_REQUEST: ((userMessage: string, debugMessage?: string, cause?: Error) => ApiException<ApiError_GeneralErrorMessage>) & {
91
94
  code: number;
92
95
  };
@@ -166,7 +169,7 @@ export declare const HttpCodes: {
166
169
  };
167
170
  readonly DEBUG_WHO_CALLED_THIS: 555;
168
171
  readonly BAD_IMPLEMENTATION: 560;
169
- readonly IMPLEMENTATION_MISSION: 561;
172
+ readonly IMPLEMENTATION_MISSING: 561;
170
173
  readonly SHOULD_NOT_HAPPENED: 598;
171
174
  readonly MUST_NEVER_HAPPENED: 599;
172
175
  };
@@ -58,6 +58,7 @@ exports.HttpCodes = {
58
58
  RANGE_NOT_SATISFIABLE: createGeneralError(416),
59
59
  EXPECTATION_FAILED: createGeneralError(417),
60
60
  IM_A_TEAPOT: createGeneralError(418),
61
+ FAILED_VALIDATION: createGeneralError(420),
61
62
  MISDIRECTED_REQUEST: createGeneralError(421),
62
63
  UNPROCESSABLE_ENTITY: createGeneralError(422),
63
64
  LOCKED: createGeneralError(423),
@@ -89,7 +90,7 @@ exports.HttpCodes = {
89
90
  //custom
90
91
  DEBUG_WHO_CALLED_THIS: 555,
91
92
  BAD_IMPLEMENTATION: 560,
92
- IMPLEMENTATION_MISSION: 561,
93
+ IMPLEMENTATION_MISSING: 561,
93
94
  SHOULD_NOT_HAPPENED: 598,
94
95
  MUST_NEVER_HAPPENED: 599,
95
96
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/ts-common",
3
- "version": "0.203.117",
3
+ "version": "0.203.118",
4
4
  "description": "js and ts infra",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -1,4 +1,5 @@
1
- import { TS_Object } from './types';
1
+ import { DotNotation, TS_Object } from './types';
2
+ export declare function getDotNotatedValue<T extends object>(key: DotNotation<T>, dotNotatedObject: T): any;
2
3
  export declare function deepClone<T>(obj: T | Readonly<T>): T;
3
4
  export declare function _keys<T extends {
4
5
  [k: string]: any;
@@ -17,9 +17,16 @@
17
17
  * limitations under the License.
18
18
  */
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.filterKeys = exports.assert = exports.compare = exports.partialCompare = exports.cloneObj = exports.cloneArr = exports._setTypedProp = exports._values = exports._keys = exports.deepClone = void 0;
20
+ exports.filterKeys = exports.assert = exports.compare = exports.partialCompare = exports.cloneObj = exports.cloneArr = exports._setTypedProp = exports._values = exports._keys = exports.deepClone = exports.getDotNotatedValue = void 0;
21
21
  const exceptions_1 = require("../core/exceptions/exceptions");
22
22
  const array_tools_1 = require("./array-tools");
23
+ function getDotNotatedValue(key, dotNotatedObject) {
24
+ const pathParts = key.split('.');
25
+ return pathParts.reduce((value, _pathPart) => {
26
+ return value[_pathPart];
27
+ }, dotNotatedObject);
28
+ }
29
+ exports.getDotNotatedValue = getDotNotatedValue;
23
30
  function deepClone(obj) {
24
31
  if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || typeof obj === 'undefined' || obj === null)
25
32
  return obj;