@ryuzaki13/react-foundation-lib 1.1.4 → 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 +5 -122
|
@@ -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",
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"types": "./dist/file/index.d.ts",
|
|
84
84
|
"import": "./dist/file/index.js"
|
|
85
85
|
},
|
|
86
|
+
"./fingerprint": {
|
|
87
|
+
"types": "./dist/fingerprint/index.d.ts",
|
|
88
|
+
"import": "./dist/fingerprint/index.js"
|
|
89
|
+
},
|
|
86
90
|
"./form": {
|
|
87
91
|
"types": "./dist/form/index.d.ts",
|
|
88
92
|
"import": "./dist/form/index.js"
|
|
@@ -189,127 +193,6 @@
|
|
|
189
193
|
},
|
|
190
194
|
"./package.json": "./package.json"
|
|
191
195
|
},
|
|
192
|
-
"typesVersions": {
|
|
193
|
-
"*": {
|
|
194
|
-
"array": [
|
|
195
|
-
"dist/array/index.d.ts"
|
|
196
|
-
],
|
|
197
|
-
"binary": [
|
|
198
|
-
"dist/binary/index.d.ts"
|
|
199
|
-
],
|
|
200
|
-
"bounded-copy-stack": [
|
|
201
|
-
"dist/bounded-copy-stack/index.d.ts"
|
|
202
|
-
],
|
|
203
|
-
"context-menu": [
|
|
204
|
-
"dist/context-menu/index.d.ts"
|
|
205
|
-
],
|
|
206
|
-
"copy": [
|
|
207
|
-
"dist/copy/index.d.ts"
|
|
208
|
-
],
|
|
209
|
-
"crypto": [
|
|
210
|
-
"dist/crypto/index.d.ts"
|
|
211
|
-
],
|
|
212
|
-
"currency": [
|
|
213
|
-
"dist/currency/index.d.ts"
|
|
214
|
-
],
|
|
215
|
-
"date-segments": [
|
|
216
|
-
"dist/date-segments/index.d.ts"
|
|
217
|
-
],
|
|
218
|
-
"dom": [
|
|
219
|
-
"dist/dom/index.d.ts"
|
|
220
|
-
],
|
|
221
|
-
"error": [
|
|
222
|
-
"dist/error/index.d.ts"
|
|
223
|
-
],
|
|
224
|
-
"error-report": [
|
|
225
|
-
"dist/error-report/index.d.ts"
|
|
226
|
-
],
|
|
227
|
-
"excel": [
|
|
228
|
-
"dist/excel/index.d.ts"
|
|
229
|
-
],
|
|
230
|
-
"file": [
|
|
231
|
-
"dist/file/index.d.ts"
|
|
232
|
-
],
|
|
233
|
-
"form": [
|
|
234
|
-
"dist/form/index.d.ts"
|
|
235
|
-
],
|
|
236
|
-
"formatters": [
|
|
237
|
-
"dist/formatters/index.d.ts"
|
|
238
|
-
],
|
|
239
|
-
"formulas": [
|
|
240
|
-
"dist/formulas/index.d.ts"
|
|
241
|
-
],
|
|
242
|
-
"hooks": [
|
|
243
|
-
"dist/hooks/index.d.ts"
|
|
244
|
-
],
|
|
245
|
-
"http": [
|
|
246
|
-
"dist/http/index.d.ts"
|
|
247
|
-
],
|
|
248
|
-
"media": [
|
|
249
|
-
"dist/media/index.d.ts"
|
|
250
|
-
],
|
|
251
|
-
"notifications": [
|
|
252
|
-
"dist/notifications/index.d.ts"
|
|
253
|
-
],
|
|
254
|
-
"number-scale": [
|
|
255
|
-
"dist/number-scale/index.d.ts"
|
|
256
|
-
],
|
|
257
|
-
"odata": [
|
|
258
|
-
"dist/odata/index.d.ts"
|
|
259
|
-
],
|
|
260
|
-
"odata-service": [
|
|
261
|
-
"dist/odata-service/index.d.ts"
|
|
262
|
-
],
|
|
263
|
-
"presets": [
|
|
264
|
-
"dist/presets/index.d.ts"
|
|
265
|
-
],
|
|
266
|
-
"pwa": [
|
|
267
|
-
"dist/pwa/index.d.ts"
|
|
268
|
-
],
|
|
269
|
-
"pwa/sw-cache-policy": [
|
|
270
|
-
"dist/pwa/swCachePolicy.d.ts"
|
|
271
|
-
],
|
|
272
|
-
"query-client": [
|
|
273
|
-
"dist/query-client/index.d.ts"
|
|
274
|
-
],
|
|
275
|
-
"range-output": [
|
|
276
|
-
"dist/range-output/index.d.ts"
|
|
277
|
-
],
|
|
278
|
-
"seo": [
|
|
279
|
-
"dist/seo/index.d.ts"
|
|
280
|
-
],
|
|
281
|
-
"session-storage": [
|
|
282
|
-
"dist/session-storage/index.d.ts"
|
|
283
|
-
],
|
|
284
|
-
"string-comparison": [
|
|
285
|
-
"dist/string-comparison/index.d.ts"
|
|
286
|
-
],
|
|
287
|
-
"table": [
|
|
288
|
-
"dist/table/index.d.ts"
|
|
289
|
-
],
|
|
290
|
-
"three-scene": [
|
|
291
|
-
"dist/three-scene/index.d.ts"
|
|
292
|
-
],
|
|
293
|
-
"tree-table": [
|
|
294
|
-
"dist/tree-table/index.d.ts"
|
|
295
|
-
],
|
|
296
|
-
"types": [
|
|
297
|
-
"dist/types/index.d.ts"
|
|
298
|
-
],
|
|
299
|
-
"utils": [
|
|
300
|
-
"dist/utils/index.d.ts"
|
|
301
|
-
],
|
|
302
|
-
"validators": [
|
|
303
|
-
"dist/validators/index.d.ts"
|
|
304
|
-
],
|
|
305
|
-
"virtualizer": [
|
|
306
|
-
"dist/virtualizer/index.d.ts"
|
|
307
|
-
],
|
|
308
|
-
"xml": [
|
|
309
|
-
"dist/xml/index.d.ts"
|
|
310
|
-
]
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
196
|
"scripts": {
|
|
314
197
|
"build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
315
198
|
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|