@powerlines/plugin-cloudflare 0.2.19 → 0.2.21
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/README.md +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/components/cloudflare-builtin.cjs +225 -224
- package/dist/components/cloudflare-builtin.d.cts.map +1 -1
- package/dist/components/cloudflare-builtin.d.mts +2 -2
- package/dist/components/cloudflare-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.cjs +10 -9
- package/dist/components/env-builtin.d.cts +2 -2
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/worker-entry.cjs +45 -44
- package/dist/components/worker-entry.d.cts +0 -1
- package/dist/components/worker-entry.d.cts.map +1 -1
- package/dist/components/worker-entry.d.mts +0 -1
- package/dist/components/worker-entry.d.mts.map +1 -1
- package/dist/index.cjs +30 -31
- package/dist/index.d.cts +0 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +27 -24
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.cjs +0 -38
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs +0 -38
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.cjs +0 -33
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs +0 -34
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.cjs +0 -25
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs +0 -26
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-cloudflare",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.2.21",
|
|
4
|
+
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin that provides integration with Cloudflare services.",
|
|
6
|
+
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
7
|
+
"homepage": "https://stormsoftware.com",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://stormsoftware.com/support",
|
|
10
|
+
"email": "support@stormsoftware.com"
|
|
11
|
+
},
|
|
6
12
|
"repository": {
|
|
7
13
|
"type": "github",
|
|
8
14
|
"url": "https://github.com/storm-software/powerlines.git",
|
|
9
15
|
"directory": "packages/plugin-cloudflare"
|
|
10
16
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"url": "https://
|
|
14
|
-
"email": "support@stormsoftware.com"
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
15
20
|
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
16
22
|
"author": {
|
|
17
23
|
"name": "Storm Software",
|
|
18
24
|
"email": "contact@stormsoftware.com",
|
|
@@ -32,12 +38,7 @@
|
|
|
32
38
|
"url": "https://stormsoftware.com"
|
|
33
39
|
}
|
|
34
40
|
],
|
|
35
|
-
"
|
|
36
|
-
"type": "github",
|
|
37
|
-
"url": "https://github.com/sponsors/storm-software"
|
|
38
|
-
},
|
|
39
|
-
"license": "Apache-2.0",
|
|
40
|
-
"private": false,
|
|
41
|
+
"type": "module",
|
|
41
42
|
"exports": {
|
|
42
43
|
".": {
|
|
43
44
|
"require": {
|
|
@@ -53,7 +54,6 @@
|
|
|
53
54
|
"default": "./dist/index.mjs"
|
|
54
55
|
}
|
|
55
56
|
},
|
|
56
|
-
"./*": "./*",
|
|
57
57
|
"./components": {
|
|
58
58
|
"require": {
|
|
59
59
|
"types": "./dist/components/index.d.cts",
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"default": "./dist/components/worker-entry.mjs"
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
+
"./package.json": "./package.json",
|
|
113
114
|
"./types": {
|
|
114
115
|
"require": {
|
|
115
116
|
"types": "./dist/types/index.d.cts",
|
|
@@ -139,30 +140,32 @@
|
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
},
|
|
143
|
+
"main": "./dist/index.cjs",
|
|
144
|
+
"module": "./dist/index.mjs",
|
|
145
|
+
"types": "./dist/index.d.cts",
|
|
142
146
|
"files": ["dist/**/*"],
|
|
143
|
-
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
144
147
|
"dependencies": {
|
|
145
148
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
146
149
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
147
|
-
"@
|
|
148
|
-
"@powerlines/plugin-env": "^0.16.
|
|
150
|
+
"@cloudflare/workers-types": "^4.20260312.1",
|
|
151
|
+
"@powerlines/plugin-env": "^0.16.61",
|
|
152
|
+
"@powerlines/plugin-pulumi": "^0.5.23",
|
|
149
153
|
"@pulumi/cloudflare": "^6.13.0",
|
|
150
154
|
"@pulumi/pulumi": "^3.225.1",
|
|
151
|
-
"@storm-software/config-tools": "
|
|
155
|
+
"@storm-software/config-tools": "1.189.28",
|
|
152
156
|
"@stryke/hash": "^0.13.10",
|
|
153
157
|
"@stryke/path": "^0.26.19",
|
|
158
|
+
"@stryke/string-format": "^0.17.3",
|
|
159
|
+
"@stryke/type-checks": "^0.5.38",
|
|
154
160
|
"defu": "^6.1.4",
|
|
155
|
-
"powerlines": "^0.41.
|
|
161
|
+
"powerlines": "^0.41.7"
|
|
156
162
|
},
|
|
157
163
|
"devDependencies": {
|
|
158
164
|
"@cloudflare/workers-types": "^4.20260312.1",
|
|
159
|
-
"@powerlines/plugin-alloy": "^0.25.
|
|
160
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
165
|
+
"@powerlines/plugin-alloy": "^0.25.26",
|
|
166
|
+
"@powerlines/plugin-plugin": "^0.12.293",
|
|
161
167
|
"@types/node": "^25.4.0"
|
|
162
168
|
},
|
|
163
169
|
"publishConfig": { "access": "public" },
|
|
164
|
-
"
|
|
165
|
-
"module": "./dist/index.mjs",
|
|
166
|
-
"types": "./dist/index.d.cts",
|
|
167
|
-
"gitHead": "0ed0ad0cd6f440d1584ac705987ef985931161db"
|
|
170
|
+
"gitHead": "2fb48143904805988bac9bdbc04cdc4a35ff398b"
|
|
168
171
|
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs
|
|
3
|
-
/**
|
|
4
|
-
* Regular expression pattern to split strings into words for various case conversions
|
|
5
|
-
*
|
|
6
|
-
* This pattern matches sequences of characters in a string, considering the following case:
|
|
7
|
-
* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)
|
|
8
|
-
* - Sequences of one uppercase letter optionally followed by lowercase letters and digits
|
|
9
|
-
* - Single uppercase letters
|
|
10
|
-
* - Sequences of digits
|
|
11
|
-
*
|
|
12
|
-
* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into
|
|
13
|
-
* a consistent format like snake case.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);
|
|
17
|
-
* // matches: ['camel', 'Case', 'HTTP', 'Request']
|
|
18
|
-
*/
|
|
19
|
-
const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\d+|[A-Z]+(?![a-z])/g;
|
|
20
|
-
const RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\d+|[A-Z/.-]+(?![a-z/.-])/g;
|
|
21
|
-
/**
|
|
22
|
-
* Splits a string into words using a regular expression pattern
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const words = getWords('camelCaseHTTPRequest');
|
|
26
|
-
* // words: ['camel', 'Case', 'HTTP', 'Request']
|
|
27
|
-
*
|
|
28
|
-
* @param str - The string to split into words
|
|
29
|
-
* @param options - Options for splitting the string
|
|
30
|
-
* @returns An array of words
|
|
31
|
-
*/
|
|
32
|
-
function getWords(str, options = {}) {
|
|
33
|
-
if (str.length > 5e3) throw new Error("The regular expression parameter of `get-words` can't handle strings longer than 2000 characters");
|
|
34
|
-
return [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
exports.getWords = getWords;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Regular expression pattern to split strings into words for various case conversions
|
|
4
|
-
*
|
|
5
|
-
* This pattern matches sequences of characters in a string, considering the following case:
|
|
6
|
-
* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)
|
|
7
|
-
* - Sequences of one uppercase letter optionally followed by lowercase letters and digits
|
|
8
|
-
* - Single uppercase letters
|
|
9
|
-
* - Sequences of digits
|
|
10
|
-
*
|
|
11
|
-
* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into
|
|
12
|
-
* a consistent format like snake case.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);
|
|
16
|
-
* // matches: ['camel', 'Case', 'HTTP', 'Request']
|
|
17
|
-
*/
|
|
18
|
-
const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\d+|[A-Z]+(?![a-z])/g;
|
|
19
|
-
const RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\d+|[A-Z/.-]+(?![a-z/.-])/g;
|
|
20
|
-
/**
|
|
21
|
-
* Splits a string into words using a regular expression pattern
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* const words = getWords('camelCaseHTTPRequest');
|
|
25
|
-
* // words: ['camel', 'Case', 'HTTP', 'Request']
|
|
26
|
-
*
|
|
27
|
-
* @param str - The string to split into words
|
|
28
|
-
* @param options - Options for splitting the string
|
|
29
|
-
* @returns An array of words
|
|
30
|
-
*/
|
|
31
|
-
function getWords(str, options = {}) {
|
|
32
|
-
if (str.length > 5e3) throw new Error("The regular expression parameter of `get-words` can't handle strings longer than 2000 characters");
|
|
33
|
-
return [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { getWords };
|
|
38
|
-
//# sourceMappingURL=get-words.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-words.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs"],"sourcesContent":["//#region src/get-words.ts\n/**\n* Regular expression pattern to split strings into words for various case conversions\n*\n* This pattern matches sequences of characters in a string, considering the following case:\n* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n* - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n* - Single uppercase letters\n* - Sequences of digits\n*\n* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n* a consistent format like snake case.\n*\n* @example\n* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n* // matches: ['camel', 'Case', 'HTTP', 'Request']\n*/\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\\d+|[A-Z]+(?![a-z])/g;\nconst RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\\d+|[A-Z/.-]+(?![a-z/.-])/g;\n/**\n* Splits a string into words using a regular expression pattern\n*\n* @example\n* const words = getWords('camelCaseHTTPRequest');\n* // words: ['camel', 'Case', 'HTTP', 'Request']\n*\n* @param str - The string to split into words\n* @param options - Options for splitting the string\n* @returns An array of words\n*/\nfunction getWords(str, options = {}) {\n\tif (str.length > 5e3) throw new Error(\"The regular expression parameter of `get-words` can't handle strings longer than 2000 characters\");\n\treturn [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];\n}\n\n//#endregion\nexport { CASE_SPLIT_PATTERN, RELAXED_SPLIT_PATTERN, getWords };\n//# sourceMappingURL=get-words.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;;;;;;;;;;;;AAY9B,SAAS,SAAS,KAAK,UAAU,EAAE,EAAE;AACpC,KAAI,IAAI,SAAS,IAAK,OAAM,IAAI,MAAM,mGAAmG;AACzI,QAAO,CAAC,GAAG,IAAI,MAAM,QAAQ,UAAU,QAAQ,UAAU,wBAAwB,oBAAoB,IAAI,EAAE,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const require_get_words = require('./get-words.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Check if the input string is in kebab case.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
9
|
-
*
|
|
10
|
-
* @param input - The input string to check.
|
|
11
|
-
* @returns True if the input is in kebab case, false otherwise.
|
|
12
|
-
*/
|
|
13
|
-
function isKebabCase(input) {
|
|
14
|
-
return input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Convert the input string to kebab case.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
21
|
-
*
|
|
22
|
-
* @param input - The input string.
|
|
23
|
-
* @returns The kebab-cased string.
|
|
24
|
-
*/
|
|
25
|
-
function kebabCase(input) {
|
|
26
|
-
if (isKebabCase(input) || input === void 0) return input;
|
|
27
|
-
const parts = input ? require_get_words.getWords(input) : [];
|
|
28
|
-
if (parts.length === 0) return "";
|
|
29
|
-
return parts.join("-").toLowerCase();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.kebabCase = kebabCase;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getWords } from "./get-words.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Check if the input string is in kebab case.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
9
|
-
*
|
|
10
|
-
* @param input - The input string to check.
|
|
11
|
-
* @returns True if the input is in kebab case, false otherwise.
|
|
12
|
-
*/
|
|
13
|
-
function isKebabCase(input) {
|
|
14
|
-
return input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Convert the input string to kebab case.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
21
|
-
*
|
|
22
|
-
* @param input - The input string.
|
|
23
|
-
* @returns The kebab-cased string.
|
|
24
|
-
*/
|
|
25
|
-
function kebabCase(input) {
|
|
26
|
-
if (isKebabCase(input) || input === void 0) return input;
|
|
27
|
-
const parts = input ? getWords(input) : [];
|
|
28
|
-
if (parts.length === 0) return "";
|
|
29
|
-
return parts.join("-").toLowerCase();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
export { kebabCase };
|
|
34
|
-
//# sourceMappingURL=kebab-case.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kebab-case.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs"],"sourcesContent":["import { getWords } from \"./get-words.mjs\";\n\n//#region src/kebab-case.ts\n/**\n* Check if the input string is in kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string to check.\n* @returns True if the input is in kebab case, false otherwise.\n*/\nfunction isKebabCase(input) {\n\treturn input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;\n}\n/**\n* Convert the input string to kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string.\n* @returns The kebab-cased string.\n*/\nfunction kebabCase(input) {\n\tif (isKebabCase(input) || input === void 0) return input;\n\tconst parts = input ? getWords(input) : [];\n\tif (parts.length === 0) return \"\";\n\treturn parts.join(\"-\").toLowerCase();\n}\n\n//#endregion\nexport { isKebabCase, kebabCase };\n//# sourceMappingURL=kebab-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AAYA,SAAS,YAAY,OAAO;AAC3B,QAAO,QAAQ,0BAA0B,KAAK,MAAM,GAAG;;;;;;;;;;;AAWxD,SAAS,UAAU,OAAO;AACzB,KAAI,YAAY,MAAM,IAAI,UAAU,KAAK,EAAG,QAAO;CACnD,MAAM,QAAQ,QAAQ,SAAS,MAAM,GAAG,EAAE;AAC1C,KAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAO,MAAM,KAAK,IAAI,CAAC,aAAa"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
3
|
-
/**
|
|
4
|
-
* Gets the `toStringTag` of `obj`.
|
|
5
|
-
*
|
|
6
|
-
* @param value - The obj to query.
|
|
7
|
-
* @returns Returns the `toStringTag`.
|
|
8
|
-
*/
|
|
9
|
-
const getObjectTag = (value) => {
|
|
10
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
11
|
-
return Object.prototype.toString.call(value);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
exports.getObjectTag = getObjectTag;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Gets the `toStringTag` of `obj`.
|
|
4
|
-
*
|
|
5
|
-
* @param value - The obj to query.
|
|
6
|
-
* @returns Returns the `toStringTag`.
|
|
7
|
-
*/
|
|
8
|
-
const getObjectTag = (value) => {
|
|
9
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
10
|
-
return Object.prototype.toString.call(value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { getObjectTag };
|
|
15
|
-
//# sourceMappingURL=get-object-tag.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-object-tag.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs"],"sourcesContent":["//#region src/get-object-tag.ts\n/**\n* Gets the `toStringTag` of `obj`.\n*\n* @param value - The obj to query.\n* @returns Returns the `toStringTag`.\n*/\nconst getObjectTag = (value) => {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n};\n\n//#endregion\nexport { getObjectTag };\n//# sourceMappingURL=get-object-tag.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,UAAU;AAC/B,KAAI,SAAS,KAAM,QAAO,UAAU,KAAK,IAAI,uBAAuB;AACpE,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const require_get_object_tag = require('./get-object-tag.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs
|
|
4
|
-
function isSyncFunction(value) {
|
|
5
|
-
return require_get_object_tag.getObjectTag(value) === "[object Function]";
|
|
6
|
-
}
|
|
7
|
-
function isAsyncFunction(value) {
|
|
8
|
-
return require_get_object_tag.getObjectTag(value) === "[object AsyncFunction]";
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Check if the provided value's type is `Function`
|
|
12
|
-
*
|
|
13
|
-
* @param value - The value to type check
|
|
14
|
-
* @returns An indicator specifying if the value provided is of type `Function`
|
|
15
|
-
*/
|
|
16
|
-
const isFunction = (value) => {
|
|
17
|
-
try {
|
|
18
|
-
return value instanceof Function || typeof value === "function" || Boolean(value?.constructor && value?.call && value?.apply) || isSyncFunction(value) || isAsyncFunction(value);
|
|
19
|
-
} catch {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
exports.isFunction = isFunction;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { getObjectTag } from "./get-object-tag.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs
|
|
4
|
-
function isSyncFunction(value) {
|
|
5
|
-
return getObjectTag(value) === "[object Function]";
|
|
6
|
-
}
|
|
7
|
-
function isAsyncFunction(value) {
|
|
8
|
-
return getObjectTag(value) === "[object AsyncFunction]";
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Check if the provided value's type is `Function`
|
|
12
|
-
*
|
|
13
|
-
* @param value - The value to type check
|
|
14
|
-
* @returns An indicator specifying if the value provided is of type `Function`
|
|
15
|
-
*/
|
|
16
|
-
const isFunction = (value) => {
|
|
17
|
-
try {
|
|
18
|
-
return value instanceof Function || typeof value === "function" || Boolean(value?.constructor && value?.call && value?.apply) || isSyncFunction(value) || isAsyncFunction(value);
|
|
19
|
-
} catch {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { isFunction };
|
|
26
|
-
//# sourceMappingURL=is-function.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-function.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs"],"sourcesContent":["import { getObjectTag } from \"./get-object-tag.mjs\";\n\n//#region src/is-function.ts\nfunction isSyncFunction(value) {\n\treturn getObjectTag(value) === \"[object Function]\";\n}\nfunction isAsyncFunction(value) {\n\treturn getObjectTag(value) === \"[object AsyncFunction]\";\n}\n/**\n* Check if the provided value's type is `Function`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `Function`\n*/\nconst isFunction = (value) => {\n\ttry {\n\t\treturn value instanceof Function || typeof value === \"function\" || Boolean(value?.constructor && value?.call && value?.apply) || isSyncFunction(value) || isAsyncFunction(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isAsyncFunction, isFunction, isSyncFunction };\n//# sourceMappingURL=is-function.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,SAAS,eAAe,OAAO;AAC9B,QAAO,aAAa,MAAM,KAAK;;AAEhC,SAAS,gBAAgB,OAAO;AAC/B,QAAO,aAAa,MAAM,KAAK;;;;;;;;AAQhC,MAAM,cAAc,UAAU;AAC7B,KAAI;AACH,SAAO,iBAAiB,YAAY,OAAO,UAAU,cAAc,QAAQ,OAAO,eAAe,OAAO,QAAQ,OAAO,MAAM,IAAI,eAAe,MAAM,IAAI,gBAAgB,MAAM;SACzK;AACP,SAAO"}
|