@ryuzaki13/react-foundation-lib 1.1.5 → 1.1.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/dist/fingerprint/index.js +13 -0
- package/dist/fingerprint/index.js.map +1 -0
- package/package.json +1 -125
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { load as e } from "@fingerprintjs/fingerprintjs";
|
|
2
|
+
//#region src/fingerprint/getClientFingerprint.ts
|
|
3
|
+
var t = null;
|
|
4
|
+
async function n() {
|
|
5
|
+
return typeof window > "u" ? null : (t ||= e().then((e) => e.get()).then((e) => {
|
|
6
|
+
let t = e.visitorId?.trim();
|
|
7
|
+
return t && t.length > 0 ? t : null;
|
|
8
|
+
}).catch(() => null), t);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as getClientFingerprint };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/fingerprint/getClientFingerprint.ts"],"sourcesContent":["import { load as loadFingerprint } from \"@fingerprintjs/fingerprintjs\";\n\nlet fingerprintPromise: Promise<string | null> | null = null;\n\nexport async function getClientFingerprint(): Promise<string | null> {\n\tif (typeof window === \"undefined\") {\n\t\treturn null;\n\t}\n\n\tif (!fingerprintPromise) {\n\t\tfingerprintPromise = loadFingerprint()\n\t\t\t.then((fp) => fp.get())\n\t\t\t.then((result) => {\n\t\t\t\tconst visitorId = result.visitorId?.trim();\n\t\t\t\treturn visitorId && visitorId.length > 0 ? visitorId : null;\n\t\t\t})\n\t\t\t.catch(() => null);\n\t}\n\n\treturn fingerprintPromise;\n}\n"],"mappings":";;AAEA,IAAI,IAAoD;AAExD,eAAsB,IAA+C;CAepE,OAdI,OAAO,SAAW,MACd,QAGR,AACC,MAAqB,EAAgB,CAAC,CACpC,MAAM,MAAO,EAAG,IAAI,CAAC,CAAC,CACtB,MAAM,MAAW;EACjB,IAAM,IAAY,EAAO,WAAW,KAAK;EACzC,OAAO,KAAa,EAAU,SAAS,IAAI,IAAY;CACxD,CAAC,CAAC,CACD,YAAY,IAAI,GAGZ;AACR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuzaki13/react-foundation-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Reusable React and TypeScript foundation utilities, hooks, and primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ryuzaki13",
|
|
@@ -193,130 +193,6 @@
|
|
|
193
193
|
},
|
|
194
194
|
"./package.json": "./package.json"
|
|
195
195
|
},
|
|
196
|
-
"typesVersions": {
|
|
197
|
-
"*": {
|
|
198
|
-
"array": [
|
|
199
|
-
"dist/array/index.d.ts"
|
|
200
|
-
],
|
|
201
|
-
"binary": [
|
|
202
|
-
"dist/binary/index.d.ts"
|
|
203
|
-
],
|
|
204
|
-
"bounded-copy-stack": [
|
|
205
|
-
"dist/bounded-copy-stack/index.d.ts"
|
|
206
|
-
],
|
|
207
|
-
"context-menu": [
|
|
208
|
-
"dist/context-menu/index.d.ts"
|
|
209
|
-
],
|
|
210
|
-
"copy": [
|
|
211
|
-
"dist/copy/index.d.ts"
|
|
212
|
-
],
|
|
213
|
-
"crypto": [
|
|
214
|
-
"dist/crypto/index.d.ts"
|
|
215
|
-
],
|
|
216
|
-
"currency": [
|
|
217
|
-
"dist/currency/index.d.ts"
|
|
218
|
-
],
|
|
219
|
-
"date-segments": [
|
|
220
|
-
"dist/date-segments/index.d.ts"
|
|
221
|
-
],
|
|
222
|
-
"dom": [
|
|
223
|
-
"dist/dom/index.d.ts"
|
|
224
|
-
],
|
|
225
|
-
"error": [
|
|
226
|
-
"dist/error/index.d.ts"
|
|
227
|
-
],
|
|
228
|
-
"error-report": [
|
|
229
|
-
"dist/error-report/index.d.ts"
|
|
230
|
-
],
|
|
231
|
-
"excel": [
|
|
232
|
-
"dist/excel/index.d.ts"
|
|
233
|
-
],
|
|
234
|
-
"file": [
|
|
235
|
-
"dist/file/index.d.ts"
|
|
236
|
-
],
|
|
237
|
-
"fingerprint": [
|
|
238
|
-
"dist/fingerprint/index.d.ts"
|
|
239
|
-
],
|
|
240
|
-
"form": [
|
|
241
|
-
"dist/form/index.d.ts"
|
|
242
|
-
],
|
|
243
|
-
"formatters": [
|
|
244
|
-
"dist/formatters/index.d.ts"
|
|
245
|
-
],
|
|
246
|
-
"formulas": [
|
|
247
|
-
"dist/formulas/index.d.ts"
|
|
248
|
-
],
|
|
249
|
-
"hooks": [
|
|
250
|
-
"dist/hooks/index.d.ts"
|
|
251
|
-
],
|
|
252
|
-
"http": [
|
|
253
|
-
"dist/http/index.d.ts"
|
|
254
|
-
],
|
|
255
|
-
"media": [
|
|
256
|
-
"dist/media/index.d.ts"
|
|
257
|
-
],
|
|
258
|
-
"notifications": [
|
|
259
|
-
"dist/notifications/index.d.ts"
|
|
260
|
-
],
|
|
261
|
-
"number-scale": [
|
|
262
|
-
"dist/number-scale/index.d.ts"
|
|
263
|
-
],
|
|
264
|
-
"odata": [
|
|
265
|
-
"dist/odata/index.d.ts"
|
|
266
|
-
],
|
|
267
|
-
"odata-service": [
|
|
268
|
-
"dist/odata-service/index.d.ts"
|
|
269
|
-
],
|
|
270
|
-
"presets": [
|
|
271
|
-
"dist/presets/index.d.ts"
|
|
272
|
-
],
|
|
273
|
-
"pwa": [
|
|
274
|
-
"dist/pwa/index.d.ts"
|
|
275
|
-
],
|
|
276
|
-
"pwa/sw-cache-policy": [
|
|
277
|
-
"dist/pwa/swCachePolicy.d.ts"
|
|
278
|
-
],
|
|
279
|
-
"query-client": [
|
|
280
|
-
"dist/query-client/index.d.ts"
|
|
281
|
-
],
|
|
282
|
-
"range-output": [
|
|
283
|
-
"dist/range-output/index.d.ts"
|
|
284
|
-
],
|
|
285
|
-
"seo": [
|
|
286
|
-
"dist/seo/index.d.ts"
|
|
287
|
-
],
|
|
288
|
-
"session-storage": [
|
|
289
|
-
"dist/session-storage/index.d.ts"
|
|
290
|
-
],
|
|
291
|
-
"string-comparison": [
|
|
292
|
-
"dist/string-comparison/index.d.ts"
|
|
293
|
-
],
|
|
294
|
-
"table": [
|
|
295
|
-
"dist/table/index.d.ts"
|
|
296
|
-
],
|
|
297
|
-
"three-scene": [
|
|
298
|
-
"dist/three-scene/index.d.ts"
|
|
299
|
-
],
|
|
300
|
-
"tree-table": [
|
|
301
|
-
"dist/tree-table/index.d.ts"
|
|
302
|
-
],
|
|
303
|
-
"types": [
|
|
304
|
-
"dist/types/index.d.ts"
|
|
305
|
-
],
|
|
306
|
-
"utils": [
|
|
307
|
-
"dist/utils/index.d.ts"
|
|
308
|
-
],
|
|
309
|
-
"validators": [
|
|
310
|
-
"dist/validators/index.d.ts"
|
|
311
|
-
],
|
|
312
|
-
"virtualizer": [
|
|
313
|
-
"dist/virtualizer/index.d.ts"
|
|
314
|
-
],
|
|
315
|
-
"xml": [
|
|
316
|
-
"dist/xml/index.d.ts"
|
|
317
|
-
]
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
196
|
"scripts": {
|
|
321
197
|
"build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
322
198
|
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|