@salesforce/ts-types 1.5.21 → 1.7.1

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.
@@ -1,4 +1,4 @@
1
- import { AnyArray, AnyConstructor, AnyFunction, Dictionary, Many, Nullable, Optional, View } from '../types';
1
+ import { AnyConstructor, Dictionary, Nullable, Optional, View } from '../types';
2
2
  /**
3
3
  * @ignore
4
4
  */
@@ -26,51 +26,7 @@ export declare function is<T extends object>(obj: Nullable<object>, shape: Objec
26
26
  * @ignore
27
27
  */
28
28
  export declare function as<T extends object>(obj: Nullable<object>, shape: ObjectShape): Optional<T>;
29
- /**
30
- * A view over an `object` with constrainable, optional properties.
31
- *
32
- * @ignore
33
- */
34
- export declare type ViewOptional<K extends string, V = unknown> = {
35
- [_ in K]?: V;
36
- };
37
29
  /**
38
30
  * @ignore
39
31
  */
40
32
  export declare function hasNull<T, K extends string>(value: T, key: K): value is T & View<K, string>;
41
- /**
42
- * @ignore
43
- */
44
- export declare function view<T, K extends string>(value: Nullable<T>, keys: Many<K>): Optional<T & ViewOptional<K>>;
45
- /**
46
- * @ignore
47
- */
48
- export declare function viewString<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, string>>;
49
- /**
50
- * @ignore
51
- */
52
- export declare function viewNumber<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, number>>;
53
- /**
54
- * @ignore
55
- */
56
- export declare function viewBoolean<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, boolean>>;
57
- /**
58
- * @ignore
59
- */
60
- export declare function viewObject<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, object>>;
61
- /**
62
- * @ignore
63
- */
64
- export declare function viewPlainObject<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, object>>;
65
- /**
66
- * @ignore
67
- */
68
- export declare function viewInstance<T, K extends string, C extends AnyConstructor>(value: Nullable<T>, key: K, ctor: C): Optional<T & ViewOptional<K, InstanceType<C>>>;
69
- /**
70
- * @ignore
71
- */
72
- export declare function viewArray<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, AnyArray>>;
73
- /**
74
- * @ignore
75
- */
76
- export declare function viewFunction<T, K extends string>(value: Nullable<T>, key: K): Optional<T & ViewOptional<K, AnyFunction>>;
@@ -6,7 +6,7 @@
6
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.viewFunction = exports.viewArray = exports.viewInstance = exports.viewPlainObject = exports.viewObject = exports.viewBoolean = exports.viewNumber = exports.viewString = exports.view = exports.hasNull = exports.as = exports.is = void 0;
9
+ exports.hasNull = exports.as = exports.is = void 0;
10
10
  /**
11
11
  * A staging area for either introducing or removing type and functions, incrementally.
12
12
  */
@@ -15,15 +15,15 @@ const narrowing_1 = require("../narrowing");
15
15
  * @ignore
16
16
  */
17
17
  function is(obj, shape) {
18
- const isVerifiable = (v) => narrowing_1.isString(v) || narrowing_1.isFunction(v);
18
+ const isVerifiable = (v) => (0, narrowing_1.isString)(v) || (0, narrowing_1.isFunction)(v);
19
19
  return (!obj ||
20
- narrowing_1.definiteEntriesOf(shape)
20
+ (0, narrowing_1.definiteEntriesOf)(shape)
21
21
  .map(([k, v]) => ({
22
22
  key: k,
23
23
  ...(isVerifiable(v) ? { type: v, optional: false } : v),
24
24
  }))
25
25
  .every(({ key, type, optional }) => (optional && !(key in obj)) ||
26
- (narrowing_1.isString(type) ? typeof narrowing_1.get(obj, key) === type : narrowing_1.get(obj, key) instanceof type)));
26
+ ((0, narrowing_1.isString)(type) ? typeof (0, narrowing_1.get)(obj, key) === type : (0, narrowing_1.get)(obj, key) instanceof type)));
27
27
  }
28
28
  exports.is = is;
29
29
  /**
@@ -41,77 +41,7 @@ exports.as = as;
41
41
  * @ignore
42
42
  */
43
43
  function hasNull(value, key) {
44
- return narrowing_1.has(value, key) && value[key] == null;
44
+ return (0, narrowing_1.has)(value, key) && value[key] == null;
45
45
  }
46
46
  exports.hasNull = hasNull;
47
- /**
48
- * @ignore
49
- */
50
- function view(value, keys) {
51
- return narrowing_1.has(value, keys) ? value : undefined;
52
- }
53
- exports.view = view;
54
- /**
55
- * @ignore
56
- */
57
- function viewOptional(value, key, hasType) {
58
- return hasType(value, key) ? value : hasNull(value, key) ? value : undefined;
59
- }
60
- /**
61
- * @ignore
62
- */
63
- function viewString(value, key) {
64
- return viewOptional(value, key, narrowing_1.hasString);
65
- }
66
- exports.viewString = viewString;
67
- /**
68
- * @ignore
69
- */
70
- function viewNumber(value, key) {
71
- return viewOptional(value, key, narrowing_1.hasNumber);
72
- }
73
- exports.viewNumber = viewNumber;
74
- /**
75
- * @ignore
76
- */
77
- function viewBoolean(value, key) {
78
- return viewOptional(value, key, narrowing_1.hasBoolean);
79
- }
80
- exports.viewBoolean = viewBoolean;
81
- /**
82
- * @ignore
83
- */
84
- function viewObject(value, key) {
85
- return viewOptional(value, key, narrowing_1.hasObject);
86
- }
87
- exports.viewObject = viewObject;
88
- /**
89
- * @ignore
90
- */
91
- function viewPlainObject(value, key) {
92
- return viewOptional(value, key, narrowing_1.hasPlainObject);
93
- }
94
- exports.viewPlainObject = viewPlainObject;
95
- /**
96
- * @ignore
97
- */
98
- function viewInstance(value, key, ctor) {
99
- const hasType = (v, k) => narrowing_1.hasInstance(v, k, ctor);
100
- return viewOptional(value, key, hasType);
101
- }
102
- exports.viewInstance = viewInstance;
103
- /**
104
- * @ignore
105
- */
106
- function viewArray(value, key) {
107
- return viewOptional(value, key, narrowing_1.hasArray);
108
- }
109
- exports.viewArray = viewArray;
110
- /**
111
- * @ignore
112
- */
113
- function viewFunction(value, key) {
114
- return viewOptional(value, key, narrowing_1.hasFunction);
115
- }
116
- exports.viewFunction = viewFunction;
117
47
  //# sourceMappingURL=index.js.map
package/lib/index.js CHANGED
@@ -7,7 +7,11 @@
7
7
  */
8
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
9
  if (k2 === undefined) k2 = k;
10
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
11
15
  }) : (function(o, m, k, k2) {
12
16
  if (k2 === undefined) k2 = k;
13
17
  o[k2] = m[k];
@@ -10,57 +10,57 @@ exports.asJsonArray = exports.asJsonMap = exports.asFunction = exports.asArray =
10
10
  const is_1 = require("./is");
11
11
  // underlying function
12
12
  function asString(value, defaultValue) {
13
- return is_1.isString(value) ? value : defaultValue;
13
+ return (0, is_1.isString)(value) ? value : defaultValue;
14
14
  }
15
15
  exports.asString = asString;
16
16
  // underlying function
17
17
  function asNumber(value, defaultValue) {
18
- return is_1.isNumber(value) ? value : defaultValue;
18
+ return (0, is_1.isNumber)(value) ? value : defaultValue;
19
19
  }
20
20
  exports.asNumber = asNumber;
21
21
  // underlying function
22
22
  function asBoolean(value, defaultValue) {
23
- return is_1.isBoolean(value) ? value : defaultValue;
23
+ return (0, is_1.isBoolean)(value) ? value : defaultValue;
24
24
  }
25
25
  exports.asBoolean = asBoolean;
26
26
  // underlying function
27
27
  function asObject(value, defaultValue) {
28
- return is_1.isObject(value) ? value : defaultValue;
28
+ return (0, is_1.isObject)(value) ? value : defaultValue;
29
29
  }
30
30
  exports.asObject = asObject;
31
31
  // underlying function
32
32
  function asPlainObject(value, defaultValue) {
33
- return is_1.isPlainObject(value) ? value : defaultValue;
33
+ return (0, is_1.isPlainObject)(value) ? value : defaultValue;
34
34
  }
35
35
  exports.asPlainObject = asPlainObject;
36
36
  // underlying function
37
37
  function asDictionary(value, defaultValue) {
38
- return is_1.isDictionary(value) ? value : defaultValue;
38
+ return (0, is_1.isDictionary)(value) ? value : defaultValue;
39
39
  }
40
40
  exports.asDictionary = asDictionary;
41
41
  // underlying function
42
42
  function asInstance(value, ctor, defaultValue) {
43
- return is_1.isInstance(value, ctor) ? value : defaultValue;
43
+ return (0, is_1.isInstance)(value, ctor) ? value : defaultValue;
44
44
  }
45
45
  exports.asInstance = asInstance;
46
46
  // underlying function
47
47
  function asArray(value, defaultValue) {
48
- return is_1.isArray(value) ? value : defaultValue;
48
+ return (0, is_1.isArray)(value) ? value : defaultValue;
49
49
  }
50
50
  exports.asArray = asArray;
51
51
  // underlying function
52
52
  function asFunction(value, defaultValue) {
53
- return is_1.isFunction(value) ? value : defaultValue;
53
+ return (0, is_1.isFunction)(value) ? value : defaultValue;
54
54
  }
55
55
  exports.asFunction = asFunction;
56
56
  // underlying function
57
57
  function asJsonMap(value, defaultValue) {
58
- return is_1.isJsonMap(value) ? value : defaultValue;
58
+ return (0, is_1.isJsonMap)(value) ? value : defaultValue;
59
59
  }
60
60
  exports.asJsonMap = asJsonMap;
61
61
  // underlying function
62
62
  function asJsonArray(value, defaultValue) {
63
- return is_1.isJsonArray(value) ? value : defaultValue;
63
+ return (0, is_1.isJsonArray)(value) ? value : defaultValue;
64
64
  }
65
65
  exports.asJsonArray = asJsonArray;
66
66
  //# sourceMappingURL=as.js.map
@@ -19,7 +19,7 @@ const to_1 = require("./to");
19
19
  */
20
20
  function assert(condition, message) {
21
21
  if (!condition) {
22
- throw new errors_1.AssertionFailedError(message || 'Assertion condition was false');
22
+ throw new errors_1.AssertionFailedError(message ?? 'Assertion condition was false');
23
23
  }
24
24
  }
25
25
  exports.assert = assert;
@@ -39,7 +39,7 @@ exports.assert = assert;
39
39
  * @throws {@link AssertionFailedError} If the value was undefined.
40
40
  */
41
41
  function assertNonNull(value, message) {
42
- assert(value != null, message || 'Value is not defined');
42
+ assert(value != null, message ?? 'Value is not defined');
43
43
  }
44
44
  exports.assertNonNull = assertNonNull;
45
45
  /**
@@ -50,7 +50,7 @@ exports.assertNonNull = assertNonNull;
50
50
  * @throws {@link AssertionFailedError} If the value was undefined.
51
51
  */
52
52
  function assertString(value, message) {
53
- assertNonNull(as_1.asString(value), message || 'Value is not a string');
53
+ assertNonNull((0, as_1.asString)(value), message ?? 'Value is not a string');
54
54
  }
55
55
  exports.assertString = assertString;
56
56
  /**
@@ -61,7 +61,7 @@ exports.assertString = assertString;
61
61
  * @throws {@link AssertionFailedError} If the value was undefined.
62
62
  */
63
63
  function assertNumber(value, message) {
64
- assertNonNull(as_1.asNumber(value), message || 'Value is not a number');
64
+ assertNonNull((0, as_1.asNumber)(value), message ?? 'Value is not a number');
65
65
  }
66
66
  exports.assertNumber = assertNumber;
67
67
  /**
@@ -72,7 +72,7 @@ exports.assertNumber = assertNumber;
72
72
  * @throws {@link AssertionFailedError} If the value was undefined.
73
73
  */
74
74
  function assertBoolean(value, message) {
75
- assertNonNull(as_1.asBoolean(value), message || 'Value is not a boolean');
75
+ assertNonNull((0, as_1.asBoolean)(value), message ?? 'Value is not a boolean');
76
76
  }
77
77
  exports.assertBoolean = assertBoolean;
78
78
  /**
@@ -83,7 +83,7 @@ exports.assertBoolean = assertBoolean;
83
83
  * @throws {@link AssertionFailedError} If the value was undefined.
84
84
  */
85
85
  function assertObject(value, message) {
86
- assertNonNull(as_1.asObject(value), message || 'Value is not an object');
86
+ assertNonNull((0, as_1.asObject)(value), message ?? 'Value is not an object');
87
87
  }
88
88
  exports.assertObject = assertObject;
89
89
  /**
@@ -95,7 +95,7 @@ exports.assertObject = assertObject;
95
95
  * @throws {@link AssertionFailedError} If the value was undefined.
96
96
  */
97
97
  function assertPlainObject(value, message) {
98
- assertNonNull(as_1.asPlainObject(value), message || 'Value is not a plain object');
98
+ assertNonNull((0, as_1.asPlainObject)(value), message ?? 'Value is not a plain object');
99
99
  }
100
100
  exports.assertPlainObject = assertPlainObject;
101
101
  /**
@@ -107,7 +107,7 @@ exports.assertPlainObject = assertPlainObject;
107
107
  * @throws {@link AssertionFailedError} If the value was undefined.
108
108
  */
109
109
  function assertDictionary(value, message) {
110
- assertNonNull(as_1.asDictionary(value), message || 'Value is not a dictionary object');
110
+ assertNonNull((0, as_1.asDictionary)(value), message ?? 'Value is not a dictionary object');
111
111
  }
112
112
  exports.assertDictionary = assertDictionary;
113
113
  /**
@@ -119,7 +119,7 @@ exports.assertDictionary = assertDictionary;
119
119
  * @throws {@link AssertionFailedError} If the value was undefined.
120
120
  */
121
121
  function assertInstance(value, ctor, message) {
122
- assertNonNull(as_1.asInstance(value, ctor), message || `Value is not an instance of ${ctor.name}`);
122
+ assertNonNull((0, as_1.asInstance)(value, ctor), message ?? `Value is not an instance of ${ctor.name}`);
123
123
  }
124
124
  exports.assertInstance = assertInstance;
125
125
  /**
@@ -130,7 +130,7 @@ exports.assertInstance = assertInstance;
130
130
  * @throws {@link AssertionFailedError} If the value was undefined.
131
131
  */
132
132
  function assertArray(value, message) {
133
- assertNonNull(as_1.asArray(value), message || 'Value is not an array');
133
+ assertNonNull((0, as_1.asArray)(value), message ?? 'Value is not an array');
134
134
  }
135
135
  exports.assertArray = assertArray;
136
136
  /**
@@ -141,7 +141,7 @@ exports.assertArray = assertArray;
141
141
  * @throws {@link AssertionFailedError} If the value was undefined.
142
142
  */
143
143
  function assertFunction(value, message) {
144
- assertNonNull(as_1.asFunction(value), message || 'Value is not a function');
144
+ assertNonNull((0, as_1.asFunction)(value), message ?? 'Value is not a function');
145
145
  }
146
146
  exports.assertFunction = assertFunction;
147
147
  /**
@@ -154,7 +154,7 @@ exports.assertFunction = assertFunction;
154
154
  * @throws {@link AssertionFailedError} If the value was not a JSON value type.
155
155
  */
156
156
  function assertAnyJson(value, message) {
157
- assertNonNull(to_1.toAnyJson(value), message || 'Value is not a JSON-compatible value type');
157
+ assertNonNull((0, to_1.toAnyJson)(value), message ?? 'Value is not a JSON-compatible value type');
158
158
  }
159
159
  exports.assertAnyJson = assertAnyJson;
160
160
  /**
@@ -165,7 +165,7 @@ exports.assertAnyJson = assertAnyJson;
165
165
  * @throws {@link AssertionFailedError} If the value was undefined.
166
166
  */
167
167
  function assertJsonMap(value, message) {
168
- assertNonNull(as_1.asJsonMap(value), message || 'Value is not a JsonMap');
168
+ assertNonNull((0, as_1.asJsonMap)(value), message ?? 'Value is not a JsonMap');
169
169
  }
170
170
  exports.assertJsonMap = assertJsonMap;
171
171
  /**
@@ -176,7 +176,7 @@ exports.assertJsonMap = assertJsonMap;
176
176
  * @throws {@link AssertionFailedError} If the value was undefined.
177
177
  */
178
178
  function assertJsonArray(value, message) {
179
- assertNonNull(as_1.asJsonArray(value), message || 'Value is not a JsonArray');
179
+ assertNonNull((0, as_1.asJsonArray)(value), message ?? 'Value is not a JsonArray');
180
180
  }
181
181
  exports.assertJsonArray = assertJsonArray;
182
182
  //# sourceMappingURL=assert.js.map
@@ -30,7 +30,7 @@ export declare function coerceJsonMap<T extends object>(value: Nullable<T>): Opt
30
30
  * Narrows an object of type `T` to a `JsonMap` using a shallow type-compatibility check. Use this when the source of
31
31
  * the object is known to be JSON-compatible and you want simple type coercion to a `JsonMap`. Use {@link toJsonMap}
32
32
  * instead when the `value` object _cannot_ be guaranteed to be JSON-compatible and you want an assurance of runtime
33
- * type safety. This is a shortcut for writing `asJsonMap(coerceAnyJson(value)) || defaultValue`.
33
+ * type safety. This is a shortcut for writing `asJsonMap(coerceAnyJson(value)) ?? defaultValue`.
34
34
  *
35
35
  * @param value The object to coerce.
36
36
  * @param defaultValue The default to return if `value` was not defined.
@@ -49,7 +49,7 @@ export declare function coerceJsonArray<T>(value: Nullable<T[]>): Optional<JsonA
49
49
  * Narrows an array of type `T` to a `JsonArray` using a shallow type-compatibility check. Use this when the source of
50
50
  * the array is known to be JSON-compatible and you want simple type coercion to a `JsonArray`. Use {@link toJsonArray}
51
51
  * instead when the `value` array _cannot_ be guaranteed to be JSON-compatible and you want an assurance of runtime
52
- * type safety. This is a shortcut for writing `asJsonArray(coerceAnyJson(value)) || defaultValue`.
52
+ * type safety. This is a shortcut for writing `asJsonArray(coerceAnyJson(value)) ?? defaultValue`.
53
53
  *
54
54
  * @param value The array to coerce.
55
55
  * @param defaultValue The default to return if `value` was not defined.
@@ -11,17 +11,17 @@ const as_1 = require("./as");
11
11
  const is_1 = require("./is");
12
12
  // underlying function
13
13
  function coerceAnyJson(value, defaultValue) {
14
- return is_1.isAnyJson(value) ? value : defaultValue;
14
+ return (0, is_1.isAnyJson)(value) ? value : defaultValue;
15
15
  }
16
16
  exports.coerceAnyJson = coerceAnyJson;
17
17
  // underlying function
18
18
  function coerceJsonMap(value, defaultValue) {
19
- return as_1.asJsonMap(coerceAnyJson(value)) || defaultValue;
19
+ return (0, as_1.asJsonMap)(coerceAnyJson(value)) ?? defaultValue;
20
20
  }
21
21
  exports.coerceJsonMap = coerceJsonMap;
22
22
  // underlying method
23
23
  function coerceJsonArray(value, defaultValue) {
24
- return as_1.asJsonArray(coerceAnyJson(value)) || defaultValue;
24
+ return (0, as_1.asJsonArray)(coerceAnyJson(value)) ?? defaultValue;
25
25
  }
26
26
  exports.coerceJsonArray = coerceJsonArray;
27
27
  //# sourceMappingURL=coerce.js.map
@@ -27,7 +27,7 @@ const to_1 = require("./to");
27
27
  */
28
28
  function ensure(value, message) {
29
29
  if (value == null) {
30
- throw new errors_1.UnexpectedValueTypeError(message || 'Value is not defined');
30
+ throw new errors_1.UnexpectedValueTypeError(message ?? 'Value is not defined');
31
31
  }
32
32
  return value;
33
33
  }
@@ -40,7 +40,7 @@ exports.ensure = ensure;
40
40
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
41
41
  */
42
42
  function ensureString(value, message) {
43
- return ensure(as_1.asString(value), message || 'Value is not a string');
43
+ return ensure((0, as_1.asString)(value), message ?? 'Value is not a string');
44
44
  }
45
45
  exports.ensureString = ensureString;
46
46
  /**
@@ -51,7 +51,7 @@ exports.ensureString = ensureString;
51
51
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
52
52
  */
53
53
  function ensureNumber(value, message) {
54
- return ensure(as_1.asNumber(value), message || 'Value is not a number');
54
+ return ensure((0, as_1.asNumber)(value), message ?? 'Value is not a number');
55
55
  }
56
56
  exports.ensureNumber = ensureNumber;
57
57
  /**
@@ -62,7 +62,7 @@ exports.ensureNumber = ensureNumber;
62
62
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
63
63
  */
64
64
  function ensureBoolean(value, message) {
65
- return ensure(as_1.asBoolean(value), message || 'Value is not a boolean');
65
+ return ensure((0, as_1.asBoolean)(value), message ?? 'Value is not a boolean');
66
66
  }
67
67
  exports.ensureBoolean = ensureBoolean;
68
68
  /**
@@ -73,7 +73,7 @@ exports.ensureBoolean = ensureBoolean;
73
73
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
74
74
  */
75
75
  function ensureObject(value, message) {
76
- return ensure(as_1.asObject(value), message || 'Value is not an object');
76
+ return ensure((0, as_1.asObject)(value), message ?? 'Value is not an object');
77
77
  }
78
78
  exports.ensureObject = ensureObject;
79
79
  /**
@@ -85,7 +85,7 @@ exports.ensureObject = ensureObject;
85
85
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
86
86
  */
87
87
  function ensurePlainObject(value, message) {
88
- return ensure(as_1.asPlainObject(value), message || 'Value is not a plain object');
88
+ return ensure((0, as_1.asPlainObject)(value), message ?? 'Value is not a plain object');
89
89
  }
90
90
  exports.ensurePlainObject = ensurePlainObject;
91
91
  /**
@@ -97,7 +97,7 @@ exports.ensurePlainObject = ensurePlainObject;
97
97
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
98
98
  */
99
99
  function ensureDictionary(value, message) {
100
- return ensure(as_1.asDictionary(value), message || 'Value is not a dictionary object');
100
+ return ensure((0, as_1.asDictionary)(value), message ?? 'Value is not a dictionary object');
101
101
  }
102
102
  exports.ensureDictionary = ensureDictionary;
103
103
  /**
@@ -109,7 +109,7 @@ exports.ensureDictionary = ensureDictionary;
109
109
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
110
110
  */
111
111
  function ensureInstance(value, ctor, message) {
112
- return ensure(as_1.asInstance(value, ctor), message || `Value is not an instance of ${ctor.name}`);
112
+ return ensure((0, as_1.asInstance)(value, ctor), message ?? `Value is not an instance of ${ctor.name}`);
113
113
  }
114
114
  exports.ensureInstance = ensureInstance;
115
115
  /**
@@ -120,7 +120,7 @@ exports.ensureInstance = ensureInstance;
120
120
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
121
121
  */
122
122
  function ensureArray(value, message) {
123
- return ensure(as_1.asArray(value), message || 'Value is not an array');
123
+ return ensure((0, as_1.asArray)(value), message ?? 'Value is not an array');
124
124
  }
125
125
  exports.ensureArray = ensureArray;
126
126
  /**
@@ -131,7 +131,7 @@ exports.ensureArray = ensureArray;
131
131
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
132
132
  */
133
133
  function ensureFunction(value, message) {
134
- return ensure(as_1.asFunction(value), message || 'Value is not a function');
134
+ return ensure((0, as_1.asFunction)(value), message ?? 'Value is not a function');
135
135
  }
136
136
  exports.ensureFunction = ensureFunction;
137
137
  /**
@@ -144,7 +144,7 @@ exports.ensureFunction = ensureFunction;
144
144
  * @throws {@link UnexpectedValueTypeError} If the value was not a JSON value type.
145
145
  */
146
146
  function ensureAnyJson(value, message) {
147
- return ensure(to_1.toAnyJson(value), message || 'Value is not a JSON-compatible value type');
147
+ return ensure((0, to_1.toAnyJson)(value), message ?? 'Value is not a JSON-compatible value type');
148
148
  }
149
149
  exports.ensureAnyJson = ensureAnyJson;
150
150
  /**
@@ -155,7 +155,7 @@ exports.ensureAnyJson = ensureAnyJson;
155
155
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
156
156
  */
157
157
  function ensureJsonMap(value, message) {
158
- return ensure(as_1.asJsonMap(value), message || 'Value is not a JsonMap');
158
+ return ensure((0, as_1.asJsonMap)(value), message ?? 'Value is not a JsonMap');
159
159
  }
160
160
  exports.ensureJsonMap = ensureJsonMap;
161
161
  /**
@@ -166,7 +166,7 @@ exports.ensureJsonMap = ensureJsonMap;
166
166
  * @throws {@link UnexpectedValueTypeError} If the value was undefined.
167
167
  */
168
168
  function ensureJsonArray(value, message) {
169
- return ensure(as_1.asJsonArray(value), message || 'Value is not a JsonArray');
169
+ return ensure((0, as_1.asJsonArray)(value), message ?? 'Value is not a JsonArray');
170
170
  }
171
171
  exports.ensureJsonArray = ensureJsonArray;
172
172
  //# sourceMappingURL=ensure.js.map
@@ -35,73 +35,73 @@ const internal_1 = require("./internal");
35
35
  * @param defaultValue The default to return if the query result was not defined.
36
36
  */
37
37
  function get(from, path, defaultValue) {
38
- return internal_1.valueOrDefault(path
38
+ return (0, internal_1.valueOrDefault)(path
39
39
  // keep values in quotes together
40
40
  .split(/['"]/)
41
41
  // values in quotes will always be odd indexes, split the non-quotes values as normal
42
42
  .reduce((r, p, index) => (index % 2 === 1 ? [...r, p] : [...r, ...p.split(/[.[\]]/)]), [])
43
43
  .filter((p) => !!p)
44
- .reduce((r, p) => (has_1.has(r, p) ? r[p] : undefined), from), defaultValue);
44
+ .reduce((r, p) => ((0, has_1.has)(r, p) ? r[p] : undefined), from), defaultValue);
45
45
  }
46
46
  exports.get = get;
47
47
  // underlying function
48
48
  function getString(from, path, defaultValue) {
49
- return internal_1.valueOrDefault(as_1.asString(get(from, path)), defaultValue);
49
+ return (0, internal_1.valueOrDefault)((0, as_1.asString)(get(from, path)), defaultValue);
50
50
  }
51
51
  exports.getString = getString;
52
52
  // underlying function
53
53
  function getNumber(from, path, defaultValue) {
54
- return internal_1.valueOrDefault(as_1.asNumber(get(from, path)), defaultValue);
54
+ return (0, internal_1.valueOrDefault)((0, as_1.asNumber)(get(from, path)), defaultValue);
55
55
  }
56
56
  exports.getNumber = getNumber;
57
57
  // underlying function
58
58
  function getBoolean(from, path, defaultValue) {
59
- return internal_1.valueOrDefault(as_1.asBoolean(get(from, path)), defaultValue);
59
+ return (0, internal_1.valueOrDefault)((0, as_1.asBoolean)(get(from, path)), defaultValue);
60
60
  }
61
61
  exports.getBoolean = getBoolean;
62
62
  // underlying function
63
63
  function getObject(from, path, defaultValue) {
64
- return internal_1.valueOrDefault(as_1.asObject(get(from, path)), defaultValue);
64
+ return (0, internal_1.valueOrDefault)((0, as_1.asObject)(get(from, path)), defaultValue);
65
65
  }
66
66
  exports.getObject = getObject;
67
67
  // underlying function
68
68
  function getPlainObject(from, path, defaultValue) {
69
- return internal_1.valueOrDefault(as_1.asPlainObject(get(from, path)), defaultValue);
69
+ return (0, internal_1.valueOrDefault)((0, as_1.asPlainObject)(get(from, path)), defaultValue);
70
70
  }
71
71
  exports.getPlainObject = getPlainObject;
72
72
  // underlying function
73
73
  function getDictionary(from, path, defaultValue) {
74
- return internal_1.valueOrDefault(as_1.asDictionary(get(from, path)), defaultValue);
74
+ return (0, internal_1.valueOrDefault)((0, as_1.asDictionary)(get(from, path)), defaultValue);
75
75
  }
76
76
  exports.getDictionary = getDictionary;
77
77
  // underlying function
78
78
  function getInstance(from, path, ctor, defaultValue) {
79
- return internal_1.valueOrDefault(as_1.asInstance(get(from, path), ctor), defaultValue);
79
+ return (0, internal_1.valueOrDefault)((0, as_1.asInstance)(get(from, path), ctor), defaultValue);
80
80
  }
81
81
  exports.getInstance = getInstance;
82
82
  // underlying function
83
83
  function getArray(from, path, defaultValue) {
84
- return internal_1.valueOrDefault(as_1.asArray(get(from, path)), defaultValue);
84
+ return (0, internal_1.valueOrDefault)((0, as_1.asArray)(get(from, path)), defaultValue);
85
85
  }
86
86
  exports.getArray = getArray;
87
87
  // underlying function
88
88
  function getFunction(from, path, defaultValue) {
89
- return internal_1.valueOrDefault(as_1.asFunction(get(from, path)), defaultValue);
89
+ return (0, internal_1.valueOrDefault)((0, as_1.asFunction)(get(from, path)), defaultValue);
90
90
  }
91
91
  exports.getFunction = getFunction;
92
92
  // underlying function
93
93
  function getAnyJson(from, path, defaultValue) {
94
- return internal_1.valueOrDefault(coerce_1.coerceAnyJson(get(from, path)), defaultValue);
94
+ return (0, internal_1.valueOrDefault)((0, coerce_1.coerceAnyJson)(get(from, path)), defaultValue);
95
95
  }
96
96
  exports.getAnyJson = getAnyJson;
97
97
  // underlying function
98
98
  function getJsonMap(from, path, defaultValue) {
99
- return internal_1.valueOrDefault(as_1.asJsonMap(getAnyJson(from, path)), defaultValue);
99
+ return (0, internal_1.valueOrDefault)((0, as_1.asJsonMap)(getAnyJson(from, path)), defaultValue);
100
100
  }
101
101
  exports.getJsonMap = getJsonMap;
102
102
  // underlying function
103
103
  function getJsonArray(from, path, defaultValue) {
104
- return internal_1.valueOrDefault(as_1.asJsonArray(getAnyJson(from, path)), defaultValue);
104
+ return (0, internal_1.valueOrDefault)((0, as_1.asJsonArray)(getAnyJson(from, path)), defaultValue);
105
105
  }
106
106
  exports.getJsonArray = getJsonArray;
107
107
  //# sourceMappingURL=get.js.map
@@ -20,7 +20,7 @@ import { AnyArray, AnyConstructor, AnyFunction, AnyJson, JsonArray, JsonMap, Man
20
20
  * @param value The value to test.
21
21
  * @param keys One or more `string` keys to check for existence.
22
22
  */
23
- export declare function has<T extends unknown, K extends string>(value: T, keys: Many<K>): value is T & object & View<K>;
23
+ export declare function has<T, K extends string>(value: T, keys: Many<K>): value is T & object & View<K>;
24
24
  /**
25
25
  * Tests whether a value of type `T` contains a property `key` of type `string`. If so, the type of the tested value is
26
26
  * narrowed to reflect the existence of that key for convenient access in the same scope. Returns `false` if the
@@ -39,7 +39,7 @@ export declare function has<T extends unknown, K extends string>(value: T, keys:
39
39
  * @param value The value to test.
40
40
  * @param keys A `string` key to check for existence.
41
41
  */
42
- export declare function hasString<T extends unknown, K extends string>(value: T, key: K): value is T & object & View<K, string>;
42
+ export declare function hasString<T, K extends string>(value: T, key: K): value is T & object & View<K, string>;
43
43
  /**
44
44
  * Tests whether a value of type `T` contains a property `key` of type `number`. If so, the type of the tested value is
45
45
  * narrowed to reflect the existence of that key for convenient access in the same scope. Returns `false` if the
@@ -58,7 +58,7 @@ export declare function hasString<T extends unknown, K extends string>(value: T,
58
58
  * @param value The value to test.
59
59
  * @param keys A `number` key to check for existence.
60
60
  */
61
- export declare function hasNumber<T extends unknown, K extends string>(value: T, key: K): value is T & object & View<K, number>;
61
+ export declare function hasNumber<T, K extends string>(value: T, key: K): value is T & object & View<K, number>;
62
62
  /**
63
63
  * Tests whether a value of type `T` contains a property `key` of type `boolean`. If so, the type of the tested value is
64
64
  * narrowed to reflect the existence of that key for convenient access in the same scope. Returns `false` if the
@@ -77,7 +77,7 @@ export declare function hasNumber<T extends unknown, K extends string>(value: T,
77
77
  * @param value The value to test.
78
78
  * @param keys A `boolean` key to check for existence.
79
79
  */
80
- export declare function hasBoolean<T extends unknown, K extends string>(value: T, key: K): value is T & object & View<K, boolean>;
80
+ export declare function hasBoolean<T, K extends string>(value: T, key: K): value is T & object & View<K, boolean>;
81
81
  /**
82
82
  * Tests whether a value of type `T` contains a property `key` of type `object`. If so, the type of the tested value is
83
83
  * narrowed to reflect the existence of that key for convenient access in the same scope. Returns `false` if the
@@ -98,7 +98,7 @@ export declare function hasBoolean<T extends unknown, K extends string>(value: T
98
98
  * @param value The value to test.
99
99
  * @param keys An `object` key to check for existence.
100
100
  */
101
- export declare function hasObject<V extends object = object, T extends unknown = unknown, K extends string = string>(value: T, key: K): value is T & object & View<K, V>;
101
+ export declare function hasObject<V extends object = object, T = unknown, K extends string = string>(value: T, key: K): value is T & object & View<K, V>;
102
102
  /**
103
103
  * Tests whether a value of type `T` contains a property `key` whose type tests positively when tested with
104
104
  * {@link isPlainObject}. If so, the type of the tested value is narrowed to reflect the existence of that key for
@@ -120,7 +120,7 @@ export declare function hasObject<V extends object = object, T extends unknown =
120
120
  * @param value The value to test.
121
121
  * @param keys A "plain" `object` key to check for existence.
122
122
  */
123
- export declare function hasPlainObject<V extends object = object, T extends unknown = unknown, K extends string = string>(value: T, key: K): value is T & object & View<K, V>;
123
+ export declare function hasPlainObject<V extends object = object, T = unknown, K extends string = string>(value: T, key: K): value is T & object & View<K, V>;
124
124
  /**
125
125
  * Tests whether a value of type `T` contains a property `key` whose type tests positively when tested with
126
126
  * {@link isDictionary}. If so, the type of the tested value is narrowed to reflect the existence of that key for
@@ -142,7 +142,7 @@ export declare function hasPlainObject<V extends object = object, T extends unkn
142
142
  * @param value The value to test.
143
143
  * @param keys A "dictionary" `object` key to check for existence.
144
144
  */
145
- export declare function hasDictionary<V = unknown, T extends unknown = unknown, K extends string = string>(value: T, key: K): value is T & object & View<K, Dictionary<V>>;
145
+ export declare function hasDictionary<V = unknown, T = unknown, K extends string = string>(value: T, key: K): value is T & object & View<K, Dictionary<V>>;
146
146
  /**
147
147
  * Tests whether a value of type `T` contains a property `key` whose type tests positively when tested with
148
148
  * {@link isInstance} when compared with the given constructor type `C`. If so, the type of the tested value is
@@ -165,7 +165,7 @@ export declare function hasDictionary<V = unknown, T extends unknown = unknown,
165
165
  * @param value The value to test.
166
166
  * @param keys An instance of type `C` key to check for existence.
167
167
  */
168
- export declare function hasInstance<T extends unknown, K extends string, C extends AnyConstructor>(value: Optional<T>, key: K, ctor: C): value is T & View<K, InstanceType<C>>;
168
+ export declare function hasInstance<T, K extends string, C extends AnyConstructor>(value: Optional<T>, key: K, ctor: C): value is T & View<K, InstanceType<C>>;
169
169
  /**
170
170
  * Tests whether a value of type `T` contains a property `key` of type {@link AnyArray}. If so, the type of the tested
171
171
  * value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns `false` if
@@ -184,7 +184,7 @@ export declare function hasInstance<T extends unknown, K extends string, C exten
184
184
  * @param value The value to test.
185
185
  * @param keys An `AnyArray` key to check for existence.
186
186
  */
187
- export declare function hasArray<T extends unknown, K extends string>(value: Optional<T>, key: K): value is T & object & View<K, AnyArray>;
187
+ export declare function hasArray<T, K extends string>(value: Optional<T>, key: K): value is T & object & View<K, AnyArray>;
188
188
  /**
189
189
  * Tests whether a value of type `T` contains a property `key` of type {@link AnyFunction}. If so, the type of the
190
190
  * tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns
@@ -202,7 +202,7 @@ export declare function hasArray<T extends unknown, K extends string>(value: Opt
202
202
  * @param value The value to test.
203
203
  * @param keys An `AnyFunction` key to check for existence.
204
204
  */
205
- export declare function hasFunction<T extends unknown, K extends string>(value: Optional<T>, key: K): value is T & object & View<K, AnyFunction>;
205
+ export declare function hasFunction<T, K extends string>(value: Optional<T>, key: K): value is T & object & View<K, AnyFunction>;
206
206
  /**
207
207
  * Tests whether a value of type `T` contains a property `key` of type {@link AnyJson}, _using a shallow test for
208
208
  * `AnyJson` compatibility_ (see {@link isAnyJson} for more information). If so, the type of the
@@ -220,7 +220,7 @@ export declare function hasFunction<T extends unknown, K extends string>(value:
220
220
  * @param value The value to test.
221
221
  * @param keys An `AnyJson` key to check for existence.
222
222
  */
223
- export declare function hasAnyJson<T extends unknown, K extends string>(value: Optional<T>, key: K): value is T & object & View<K, AnyJson>;
223
+ export declare function hasAnyJson<T, K extends string>(value: Optional<T>, key: K): value is T & object & View<K, AnyJson>;
224
224
  /**
225
225
  * Tests whether a value of type `T extends AnyJson` contains a property `key` of type {@link JsonMap}. If so, the type
226
226
  * of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns
@@ -30,7 +30,7 @@ const is_1 = require("./is");
30
30
  * @param keys One or more `string` keys to check for existence.
31
31
  */
32
32
  function has(value, keys) {
33
- return is_1.isObject(value) && (is_1.isArray(keys) ? keys.every((k) => k in value) : keys in value);
33
+ return (0, is_1.isObject)(value) && ((0, is_1.isArray)(keys) ? keys.every((k) => k in value) : keys in value);
34
34
  }
35
35
  exports.has = has;
36
36
  /**
@@ -52,7 +52,7 @@ exports.has = has;
52
52
  * @param keys A `string` key to check for existence.
53
53
  */
54
54
  function hasString(value, key) {
55
- return has(value, key) && is_1.isString(value[key]);
55
+ return has(value, key) && (0, is_1.isString)(value[key]);
56
56
  }
57
57
  exports.hasString = hasString;
58
58
  /**
@@ -74,7 +74,7 @@ exports.hasString = hasString;
74
74
  * @param keys A `number` key to check for existence.
75
75
  */
76
76
  function hasNumber(value, key) {
77
- return has(value, key) && is_1.isNumber(value[key]);
77
+ return has(value, key) && (0, is_1.isNumber)(value[key]);
78
78
  }
79
79
  exports.hasNumber = hasNumber;
80
80
  /**
@@ -96,7 +96,7 @@ exports.hasNumber = hasNumber;
96
96
  * @param keys A `boolean` key to check for existence.
97
97
  */
98
98
  function hasBoolean(value, key) {
99
- return has(value, key) && is_1.isBoolean(value[key]);
99
+ return has(value, key) && (0, is_1.isBoolean)(value[key]);
100
100
  }
101
101
  exports.hasBoolean = hasBoolean;
102
102
  /**
@@ -120,7 +120,7 @@ exports.hasBoolean = hasBoolean;
120
120
  * @param keys An `object` key to check for existence.
121
121
  */
122
122
  function hasObject(value, key) {
123
- return has(value, key) && is_1.isObject(value[key]);
123
+ return has(value, key) && (0, is_1.isObject)(value[key]);
124
124
  }
125
125
  exports.hasObject = hasObject;
126
126
  /**
@@ -145,7 +145,7 @@ exports.hasObject = hasObject;
145
145
  * @param keys A "plain" `object` key to check for existence.
146
146
  */
147
147
  function hasPlainObject(value, key) {
148
- return has(value, key) && is_1.isPlainObject(value[key]);
148
+ return has(value, key) && (0, is_1.isPlainObject)(value[key]);
149
149
  }
150
150
  exports.hasPlainObject = hasPlainObject;
151
151
  /**
@@ -170,7 +170,7 @@ exports.hasPlainObject = hasPlainObject;
170
170
  * @param keys A "dictionary" `object` key to check for existence.
171
171
  */
172
172
  function hasDictionary(value, key) {
173
- return has(value, key) && is_1.isDictionary(value[key]);
173
+ return has(value, key) && (0, is_1.isDictionary)(value[key]);
174
174
  }
175
175
  exports.hasDictionary = hasDictionary;
176
176
  /**
@@ -218,7 +218,7 @@ exports.hasInstance = hasInstance;
218
218
  * @param keys An `AnyArray` key to check for existence.
219
219
  */
220
220
  function hasArray(value, key) {
221
- return has(value, key) && is_1.isArray(value[key]);
221
+ return has(value, key) && (0, is_1.isArray)(value[key]);
222
222
  }
223
223
  exports.hasArray = hasArray;
224
224
  /**
@@ -239,7 +239,7 @@ exports.hasArray = hasArray;
239
239
  * @param keys An `AnyFunction` key to check for existence.
240
240
  */
241
241
  function hasFunction(value, key) {
242
- return has(value, key) && is_1.isFunction(value[key]);
242
+ return has(value, key) && (0, is_1.isFunction)(value[key]);
243
243
  }
244
244
  exports.hasFunction = hasFunction;
245
245
  /**
@@ -260,7 +260,7 @@ exports.hasFunction = hasFunction;
260
260
  * @param keys An `AnyJson` key to check for existence.
261
261
  */
262
262
  function hasAnyJson(value, key) {
263
- return has(value, key) && is_1.isAnyJson(value[key]);
263
+ return has(value, key) && (0, is_1.isAnyJson)(value[key]);
264
264
  }
265
265
  exports.hasAnyJson = hasAnyJson;
266
266
  /**
@@ -280,7 +280,7 @@ exports.hasAnyJson = hasAnyJson;
280
280
  * @param keys A `JsonMap` key to check for existence.
281
281
  */
282
282
  function hasJsonMap(value, key) {
283
- return hasAnyJson(value, key) && is_1.isJsonMap(value[key]);
283
+ return hasAnyJson(value, key) && (0, is_1.isJsonMap)(value[key]);
284
284
  }
285
285
  exports.hasJsonMap = hasJsonMap;
286
286
  /**
@@ -300,7 +300,7 @@ exports.hasJsonMap = hasJsonMap;
300
300
  * @param keys A `JsonArray` key to check for existence.
301
301
  */
302
302
  function hasJsonArray(value, key) {
303
- return hasAnyJson(value, key) && is_1.isJsonArray(value[key]);
303
+ return hasAnyJson(value, key) && (0, is_1.isJsonArray)(value[key]);
304
304
  }
305
305
  exports.hasJsonArray = hasJsonArray;
306
306
  //# sourceMappingURL=has.js.map
@@ -7,7 +7,11 @@
7
7
  */
8
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
9
  if (k2 === undefined) k2 = k;
10
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
11
15
  }) : (function(o, m, k, k2) {
12
16
  if (k2 === undefined) k2 = k;
13
17
  o[k2] = m[k];
@@ -36,7 +36,7 @@ exports.definiteValuesOf = exports.definiteKeysOf = exports.definiteEntriesOf =
36
36
  * @param obj The object of interest.
37
37
  */
38
38
  function keysOf(obj) {
39
- return Object.keys(obj || {});
39
+ return Object.keys(obj ?? {});
40
40
  }
41
41
  exports.keysOf = keysOf;
42
42
  /**
@@ -68,7 +68,7 @@ exports.keysOf = keysOf;
68
68
  * @param obj The object of interest.
69
69
  */
70
70
  function entriesOf(obj) {
71
- return Object.entries(obj || {});
71
+ return Object.entries(obj ?? {});
72
72
  }
73
73
  exports.entriesOf = entriesOf;
74
74
  /**
@@ -100,7 +100,7 @@ exports.entriesOf = entriesOf;
100
100
  * @param obj The object of interest.
101
101
  */
102
102
  function valuesOf(obj) {
103
- return Object.values(obj || {});
103
+ return Object.values(obj ?? {});
104
104
  }
105
105
  exports.valuesOf = valuesOf;
106
106
  /**
@@ -21,12 +21,12 @@ function toAnyJson(value, defaultValue) {
21
21
  exports.toAnyJson = toAnyJson;
22
22
  // underlying function
23
23
  function toJsonMap(value, defaultValue) {
24
- return as_1.asJsonMap(toAnyJson(value)) || defaultValue;
24
+ return (0, as_1.asJsonMap)(toAnyJson(value)) ?? defaultValue;
25
25
  }
26
26
  exports.toJsonMap = toJsonMap;
27
27
  // underlying method
28
28
  function toJsonArray(value, defaultValue) {
29
- return as_1.asJsonArray(toAnyJson(value)) || defaultValue;
29
+ return (0, as_1.asJsonArray)(toAnyJson(value)) ?? defaultValue;
30
30
  }
31
31
  exports.toJsonArray = toJsonArray;
32
32
  //# sourceMappingURL=to.js.map
@@ -7,7 +7,11 @@
7
7
  */
8
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
9
  if (k2 === undefined) k2 = k;
10
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
11
15
  }) : (function(o, m, k, k2) {
12
16
  if (k2 === undefined) k2 = k;
13
17
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ts-types",
3
- "version": "1.5.21",
3
+ "version": "1.7.1",
4
4
  "description": "Types and related utilities for TypeScript",
5
5
  "main": "lib/index.js",
6
6
  "repository": "forcedotcom/ts-types",
@@ -14,8 +14,8 @@
14
14
  "scripts": {
15
15
  "build": "sf-build",
16
16
  "ci-docs": "yarn sf-ci-docs",
17
- "clean-all": "sf-clean all",
18
17
  "clean": "sf-clean",
18
+ "clean-all": "sf-clean all",
19
19
  "compile": "sf-compile",
20
20
  "docs": "sf-docs",
21
21
  "format": "sf-format",
@@ -26,32 +26,31 @@
26
26
  "test": "sf-test"
27
27
  },
28
28
  "dependencies": {
29
- "tslib": "^2.2.0"
29
+ "tslib": "^2.4.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@salesforce/dev-config": "^3.0.0",
33
- "@salesforce/dev-scripts": "^2.0.0",
33
+ "@salesforce/dev-scripts": "^3.1.0",
34
34
  "@salesforce/prettier-config": "^0.0.2",
35
- "@typescript-eslint/eslint-plugin": "^4.2.0",
36
- "@typescript-eslint/parser": "^4.2.0",
35
+ "@typescript-eslint/eslint-plugin": "^5.41.0",
36
+ "@typescript-eslint/parser": "^5.41.0",
37
37
  "chai": "^4.2.0",
38
- "eslint": "^7.27.0",
39
- "eslint-config-prettier": "^6.11.0",
40
- "eslint-config-salesforce": "^0.1.6",
38
+ "eslint": "^8.26.0",
39
+ "eslint-config-prettier": "^8.5.0",
40
+ "eslint-config-salesforce": "^1.1.0",
41
41
  "eslint-config-salesforce-license": "^0.1.6",
42
- "eslint-config-salesforce-typescript": "^0.2.7",
42
+ "eslint-config-salesforce-typescript": "^1.1.1",
43
43
  "eslint-plugin-header": "^3.0.0",
44
44
  "eslint-plugin-import": "2.26.0",
45
- "eslint-plugin-jsdoc": "^35.1.2",
45
+ "eslint-plugin-jsdoc": "^39.3.25",
46
46
  "eslint-plugin-prefer-arrow": "^1.2.1",
47
- "eslint-plugin-prettier": "^3.1.3",
48
47
  "husky": "^7.0.4",
49
48
  "mocha": "^9.1.3",
50
49
  "nyc": "^15.1.0",
51
- "prettier": "^2.0.5",
50
+ "prettier": "^2.7.1",
52
51
  "pretty-quick": "^3.1.0",
53
52
  "sinon": "10.0.0",
54
53
  "ts-node": "^10.0.0",
55
- "typescript": "^4.1.3"
54
+ "typescript": "^4.8.4"
56
55
  }
57
- }
56
+ }
package/CHANGELOG.md DELETED
@@ -1,188 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### 1.5.21 (2022-09-16)
6
-
7
- ### Features
8
-
9
- - code refactoring ([4a4efbb](https://github.com/forcedotcom/ts-types/commit/4a4efbb62ea58bb4396839449182be4217dbcbf2))
10
-
11
- ### Bug Fixes
12
-
13
- - publish api docs ([533448e](https://github.com/forcedotcom/ts-types/commit/533448e70c5416a974340e7449077a0f3288358d))
14
- - updated nycrc ([6f1df04](https://github.com/forcedotcom/ts-types/commit/6f1df04ffcc8c8bcdc4cf9d890d911ba938386d3))
15
-
16
- ## [1.5.20](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.19...@salesforce/ts-types@1.5.20) (2021-07-09)
17
-
18
- **Note:** Version bump only for package @salesforce/ts-types
19
-
20
- ## [1.5.19](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.18...@salesforce/ts-types@1.5.19) (2021-07-08)
21
-
22
- **Note:** Version bump only for package @salesforce/ts-types
23
-
24
- ## [1.5.18](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.17...@salesforce/ts-types@1.5.18) (2021-07-08)
25
-
26
- **Note:** Version bump only for package @salesforce/ts-types
27
-
28
- ## [1.5.17](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.16...@salesforce/ts-types@1.5.17) (2021-06-07)
29
-
30
- ### Bug Fixes
31
-
32
- - pin typedoc at v0.18.0 due to breaking changes ([#164](https://github.com/forcedotcom/sfdx-dev-packages/issues/164)) ([dd7f90c](https://github.com/forcedotcom/sfdx-dev-packages/commit/dd7f90cb7b5c9a2508ac0f10ba4b6ec54d262165))
33
-
34
- ## [1.5.16](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.15...@salesforce/ts-types@1.5.16) (2021-06-07)
35
-
36
- **Note:** Version bump only for package @salesforce/ts-types
37
-
38
- ## [1.5.15](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.14...@salesforce/ts-types@1.5.15) (2021-06-04)
39
-
40
- **Note:** Version bump only for package @salesforce/ts-types
41
-
42
- ## [1.5.14](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.13...@salesforce/ts-types@1.5.14) (2021-06-03)
43
-
44
- **Note:** Version bump only for package @salesforce/ts-types
45
-
46
- ## [1.5.13](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.12...@salesforce/ts-types@1.5.13) (2021-05-20)
47
-
48
- ### Bug Fixes
49
-
50
- - allow periods in key names @W-9225317@ ([#129](https://github.com/forcedotcom/sfdx-dev-packages/issues/129)) ([e5817a0](https://github.com/forcedotcom/sfdx-dev-packages/commit/e5817a0624b15e6b353c610e92205426af773884))
51
-
52
- ## [1.5.12](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.11...@salesforce/ts-types@1.5.12) (2021-05-12)
53
-
54
- **Note:** Version bump only for package @salesforce/ts-types
55
-
56
- ## [1.5.11](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.10...@salesforce/ts-types@1.5.11) (2021-05-11)
57
-
58
- **Note:** Version bump only for package @salesforce/ts-types
59
-
60
- ## [1.5.10](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.9...@salesforce/ts-types@1.5.10) (2021-05-11)
61
-
62
- **Note:** Version bump only for package @salesforce/ts-types
63
-
64
- ## [1.5.9](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.8...@salesforce/ts-types@1.5.9) (2021-04-29)
65
-
66
- **Note:** Version bump only for package @salesforce/ts-types
67
-
68
- ## [1.5.8](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.7...@salesforce/ts-types@1.5.8) (2021-04-29)
69
-
70
- **Note:** Version bump only for package @salesforce/ts-types
71
-
72
- ## [1.5.7](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.6...@salesforce/ts-types@1.5.7) (2021-04-29)
73
-
74
- **Note:** Version bump only for package @salesforce/ts-types
75
-
76
- ## [1.5.6](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.5-testing...@salesforce/ts-types@1.5.6) (2021-04-19)
77
-
78
- **Note:** Version bump only for package @salesforce/ts-types
79
-
80
- ## [1.5.5](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.4...@salesforce/ts-types@1.5.5) (2021-02-26)
81
-
82
- **Note:** Version bump only for package @salesforce/ts-types
83
-
84
- ## [1.5.4](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.3...@salesforce/ts-types@1.5.4) (2021-02-26)
85
-
86
- **Note:** Version bump only for package @salesforce/ts-types
87
-
88
- ## [1.5.3](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.2...@salesforce/ts-types@1.5.3) (2021-02-19)
89
-
90
- **Note:** Version bump only for package @salesforce/ts-types
91
-
92
- ## [1.5.2](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.1...@salesforce/ts-types@1.5.2) (2021-02-19)
93
-
94
- **Note:** Version bump only for package @salesforce/ts-types
95
-
96
- ## [1.5.1](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.5.0...@salesforce/ts-types@1.5.1) (2021-02-19)
97
-
98
- **Note:** Version bump only for package @salesforce/ts-types
99
-
100
- # [1.5.0](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.4.4...@salesforce/ts-types@1.5.0) (2021-01-28)
101
-
102
- ### Features
103
-
104
- - update typescript version ([#109](https://github.com/forcedotcom/sfdx-dev-packages/issues/109)) ([399a0b0](https://github.com/forcedotcom/sfdx-dev-packages/commit/399a0b03aa831f25511bb3391702c10dc5c4a488))
105
-
106
- ## [1.4.4](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.4.3...@salesforce/ts-types@1.4.4) (2021-01-22)
107
-
108
- **Note:** Version bump only for package @salesforce/ts-types
109
-
110
- ## [1.4.3](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.4.2...@salesforce/ts-types@1.4.3) (2020-09-14)
111
-
112
- **Note:** Version bump only for package @salesforce/ts-types
113
-
114
- ## [1.4.2](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.4.1...@salesforce/ts-types@1.4.2) (2020-07-23)
115
-
116
- **Note:** Version bump only for package @salesforce/ts-types
117
-
118
- ## [1.4.1](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.4.0...@salesforce/ts-types@1.4.1) (2020-07-21)
119
-
120
- ### Bug Fixes
121
-
122
- - correct some dictionary typings, more complete object fns and typings ([aef5822](https://github.com/forcedotcom/sfdx-dev-packages/commit/aef5822ea24b15a4a2f40612ef5e7f6a71a9397a))
123
- - export assert lib from ts-types ([d72ef50](https://github.com/forcedotcom/sfdx-dev-packages/commit/d72ef50b32ad2055b1175dd61499a649f4d18ac2))
124
-
125
- # [1.4.0](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.3.0...@salesforce/ts-types@1.4.0) (2020-07-21)
126
-
127
- ### Features
128
-
129
- - add eslint and use it in all packages ([0165cc8](https://github.com/forcedotcom/sfdx-dev-packages/commit/0165cc8853079c7f987dddfb60ced3efb00deea0))
130
- - add javascipt eslint rules that typescript extends ([135ac73](https://github.com/forcedotcom/sfdx-dev-packages/commit/135ac73b8c513d8950ac69373349361d9f600a8c))
131
- - add salesforce license linting ([3213135](https://github.com/forcedotcom/sfdx-dev-packages/commit/3213135f34956335ef2c123ec680c2de2bc7f10f))
132
-
133
- # [1.3.0](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.2.2...@salesforce/ts-types@1.3.0) (2020-07-02)
134
-
135
- ### Features
136
-
137
- - add conveniences to ts-types ([b1814d6](https://github.com/forcedotcom/sfdx-dev-packages/commit/b1814d6))
138
-
139
- ## [1.2.2](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.2.1...@salesforce/ts-types@1.2.2) (2020-03-03)
140
-
141
- **Note:** Version bump only for package @salesforce/ts-types
142
-
143
- ## [1.2.1](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.2.0...@salesforce/ts-types@1.2.1) (2019-08-30)
144
-
145
- **Note:** Version bump only for package @salesforce/ts-types
146
-
147
- # [1.2.0](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.1.4...@salesforce/ts-types@1.2.0) (2019-07-17)
148
-
149
- ### Features
150
-
151
- - package updates ([69f3d02](https://github.com/forcedotcom/sfdx-dev-packages/commit/69f3d02))
152
-
153
- ## [1.1.4](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.1.3...@salesforce/ts-types@1.1.4) (2019-05-01)
154
-
155
- **Note:** Version bump only for package @salesforce/ts-types
156
-
157
- ## [1.1.3](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.1.2...@salesforce/ts-types@1.1.3) (2019-03-22)
158
-
159
- **Note:** Version bump only for package @salesforce/ts-types
160
-
161
- ## [1.1.2](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.1.1...@salesforce/ts-types@1.1.2) (2019-03-12)
162
-
163
- **Note:** Version bump only for package @salesforce/ts-types
164
-
165
- ## [1.1.1](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.1.0...@salesforce/ts-types@1.1.1) (2019-01-31)
166
-
167
- **Note:** Version bump only for package @salesforce/ts-types
168
-
169
- # [1.1.0](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.0.1...@salesforce/ts-types@1.1.0) (2019-01-09)
170
-
171
- ### Features
172
-
173
- - **ts-types:** add isTypeOf and fix isObject ([e9a5314](https://github.com/forcedotcom/sfdx-dev-packages/commit/e9a5314))
174
- - **ts-types:** use more explicit name for isType; update docs ([60453cf](https://github.com/forcedotcom/sfdx-dev-packages/commit/60453cf))
175
-
176
- ## [1.0.1](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@1.0.0...@salesforce/ts-types@1.0.1) (2018-12-21)
177
-
178
- **Note:** Version bump only for package @salesforce/ts-types
179
-
180
- # [1.0.0](https://github.com/forcedotcom/sfdx-dev-packages/compare/@salesforce/ts-types@0.20.2...@salesforce/ts-types@1.0.0) (2018-12-21)
181
-
182
- ### Features
183
-
184
- - **ts-types:** bump to v1 ([ae694bd](https://github.com/forcedotcom/sfdx-dev-packages/commit/ae694bd))
185
-
186
- ### BREAKING CHANGES
187
-
188
- - **ts-types:** bumping to v1.0.0