@codeleap/types 6.8.0 → 7.0.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.
- package/dist/appSettings.js +2 -0
- package/dist/appSettings.js.map +1 -0
- package/dist/common.js +2 -0
- package/dist/common.js.map +1 -0
- package/dist/google-places.js +2 -0
- package/dist/google-places.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/pathMapping.js +2 -0
- package/dist/pathMapping.js.map +1 -0
- package/dist/react-native-masked-text.js +2 -0
- package/dist/react-native-masked-text.js.map +1 -0
- package/dist/typeGuards.js +54 -0
- package/dist/typeGuards.js.map +1 -0
- package/dist/utility.js +2 -0
- package/dist/utility.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSettings.js","sourceRoot":"","sources":["../src/appSettings.ts"],"names":[],"mappings":""}
|
package/dist/common.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-places.js","sourceRoot":"","sources":["../src/google-places.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './google-places';
|
|
2
|
+
export * from './pathMapping';
|
|
3
|
+
export * from './utility';
|
|
4
|
+
export * from './common';
|
|
5
|
+
export * as TypeGuards from './typeGuards';
|
|
6
|
+
export * from './appSettings';
|
|
7
|
+
export * as RNMaskedTextTypes from './react-native-masked-text';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAC1C,cAAc,eAAe,CAAA;AAC7B,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathMapping.js","sourceRoot":"","sources":["../src/pathMapping.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-masked-text.js","sourceRoot":"","sources":["../src/react-native-masked-text.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function isNumber(x) {
|
|
3
|
+
return typeof x === 'number';
|
|
4
|
+
}
|
|
5
|
+
export function isString(x) {
|
|
6
|
+
return typeof x === 'string';
|
|
7
|
+
}
|
|
8
|
+
/** Returns `true` for any value whose `typeof` is `'object'`, including `null`. Pair with `isNil` when null must be excluded. */
|
|
9
|
+
export function isObject(x) {
|
|
10
|
+
return typeof x === 'object';
|
|
11
|
+
}
|
|
12
|
+
export function isBoolean(x) {
|
|
13
|
+
return typeof x === 'boolean';
|
|
14
|
+
}
|
|
15
|
+
export function isFunction(x) {
|
|
16
|
+
return typeof x === 'function';
|
|
17
|
+
}
|
|
18
|
+
/** Checks callable shape only — does not distinguish between regular functions and class constructors. Use `isConstructor` when the `new` signature matters. */
|
|
19
|
+
export function isConstructor(x) {
|
|
20
|
+
return typeof x === 'function';
|
|
21
|
+
}
|
|
22
|
+
export function isArray(x) {
|
|
23
|
+
return Array.isArray(x);
|
|
24
|
+
}
|
|
25
|
+
export function isUndefined(x) {
|
|
26
|
+
return typeof x === 'undefined';
|
|
27
|
+
}
|
|
28
|
+
export function isNull(x) {
|
|
29
|
+
return x === null;
|
|
30
|
+
}
|
|
31
|
+
export function isNil(x) {
|
|
32
|
+
return isNull(x) || isUndefined(x);
|
|
33
|
+
}
|
|
34
|
+
/** Checks membership of `x` in the `Enum` array — useful for narrowing to a specific string/number literal union at runtime. */
|
|
35
|
+
export function is(x, Enum) {
|
|
36
|
+
return Enum.includes(x);
|
|
37
|
+
}
|
|
38
|
+
/** Works for both concrete classes and abstract classes via the `Abstract<T>` branch. */
|
|
39
|
+
export function isInstance(x, cls) {
|
|
40
|
+
return x instanceof cls;
|
|
41
|
+
}
|
|
42
|
+
/** Delegates to `React.isValidElement` — returns `true` for JSX elements but `false` for plain components (functions/classes). */
|
|
43
|
+
export function isElement(x) {
|
|
44
|
+
return React.isValidElement(x);
|
|
45
|
+
}
|
|
46
|
+
/** Accepts both a component type (function/class) and a rendered element — use when a prop can receive either form. */
|
|
47
|
+
export function isComponentOrElement(x) {
|
|
48
|
+
return isFunction(x) || isElement(x);
|
|
49
|
+
}
|
|
50
|
+
/** Duck-types against `.then` and `.catch` rather than `instanceof Promise`, so it works across realms and custom thenables. */
|
|
51
|
+
export function isPromise(x) {
|
|
52
|
+
return isFunction(x === null || x === void 0 ? void 0 : x.then) && isFunction(x === null || x === void 0 ? void 0 : x.catch);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=typeGuards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeGuards.js","sourceRoot":"","sources":["../src/typeGuards.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAA;AAC9B,CAAC;AAED,iIAAiI;AACjI,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,CAAU;IAClC,OAAO,OAAO,CAAC,KAAK,SAAS,CAAA;AAC/B,CAAC;AAED,MA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AAC,uBAAD,CAAC,CAAU,KAAK,CAAC,CAAA;AACtE,CAAC"}
|
package/dist/utility.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/types",
|
|
3
|
-
"version": "
|
|
4
|
-
"main": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"directory": "packages/types"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@codeleap/config": "
|
|
25
|
+
"@codeleap/config": "7.0.1",
|
|
26
26
|
"ts-node-dev": "1.1.8"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|