-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: updated getUserAgentIntegration
- Loading branch information
Egor Didenko
committed
Apr 29, 2024
1 parent
a840e90
commit b343069
Showing
5 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/react-uploader/src/utils/getUserAgentIntegration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getUserAgentIntegration = void 0; | ||
var package_json_1 = require("../../package.json"); | ||
var react_1 = require("react"); | ||
var blocks_1 = require("@uploadcare/blocks"); | ||
var LIBRARY_NAME = blocks_1.PACKAGE_NAME; | ||
var LIBRARY_VERSIONS = blocks_1.PACKAGE_VERSION; | ||
var getUserAgentIntegration = function (publicKey) { | ||
return "".concat(LIBRARY_NAME, "/").concat(LIBRARY_VERSIONS, "/").concat(publicKey, " (JavaScript; React/").concat(react_1.version, "; ").concat(package_json_1.name, "/").concat(package_json_1.version, ")"); | ||
}; | ||
exports.getUserAgentIntegration = getUserAgentIntegration; | ||
(0, exports.getUserAgentIntegration)('12'); |
10 changes: 7 additions & 3 deletions
10
packages/react-uploader/src/utils/getUserAgentIntegration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { version, name } from "../../package.json"; | ||
import { | ||
version as reactUploaderVersion, | ||
name as reactUploaderName, | ||
} from "../../package.json"; | ||
import { version } from "react"; | ||
|
||
export const getUserAgentIntegration = (pubkey: string) => { | ||
return `${name}/${version}/${pubkey} (JavaScript; React;)`; | ||
export const getUserAgentIntegration = () => { | ||
return `React/${version}; ${reactUploaderName}/${reactUploaderVersion}`; | ||
}; |