First upload version 0.0.1
This commit is contained in:
27
node_modules/universal-user-agent/.github/workflows/release.yml
generated
vendored
Normal file
27
node_modules/universal-user-agent/.github/workflows/release.yml
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
- beta
|
||||
- "*.x"
|
||||
jobs:
|
||||
release:
|
||||
permissions:
|
||||
contents: write # to be able to publish a GitHub release
|
||||
issues: write # to be able to comment on released issues
|
||||
pull-requests: write # to be able to comment on released pull requests
|
||||
id-token: write # to enable use of OIDC for npm provenance
|
||||
name: release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: lts/*
|
||||
- run: npm ci
|
||||
- run: npx semantic-release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
66
node_modules/universal-user-agent/.github/workflows/test.yml
generated
vendored
Normal file
66
node_modules/universal-user-agent/.github/workflows/test.yml
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
test-deno:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test-node
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x # Run with latest stable Deno.
|
||||
- run: deno install
|
||||
- run: deno test
|
||||
|
||||
test-bun:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test-node
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- run: bun install
|
||||
- run: bun test
|
||||
|
||||
test-node:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node_version:
|
||||
- 12
|
||||
- 14
|
||||
- 16
|
||||
- 18
|
||||
- 20
|
||||
- 22
|
||||
- 24
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run test:node
|
||||
|
||||
test-types:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test-node
|
||||
- test-deno
|
||||
- test-bun
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run test:types
|
||||
25
node_modules/universal-user-agent/.github/workflows/update-prettier.yml
generated
vendored
Normal file
25
node_modules/universal-user-agent/.github/workflows/update-prettier.yml
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Update Prettier
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- renovate/prettier-*
|
||||
jobs:
|
||||
update_prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
version: 12
|
||||
cache: npm
|
||||
node-version: 16
|
||||
- run: npm ci
|
||||
- run: npm run lint:fix
|
||||
- uses: gr2m/create-or-update-pull-request-action@v1.x
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
title: Prettier updated
|
||||
body: An update to prettier required updates to your code.
|
||||
branch: ${{ github.ref }}
|
||||
commit-message: "style: prettier"
|
||||
74
node_modules/universal-user-agent/CODE_OF_CONDUCT.md
generated
vendored
Normal file
74
node_modules/universal-user-agent/CODE_OF_CONDUCT.md
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at opensource+coc@martynus.net. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [https://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: https://contributor-covenant.org
|
||||
[version]: https://contributor-covenant.org/version/1/4/
|
||||
7
node_modules/universal-user-agent/LICENSE.md
generated
vendored
Normal file
7
node_modules/universal-user-agent/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018-2021, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
19
node_modules/universal-user-agent/README.md
generated
vendored
Normal file
19
node_modules/universal-user-agent/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# universal-user-agent
|
||||
|
||||
> Get a user agent string across all JavaScript Runtime Environments
|
||||
|
||||
[](https://www.npmjs.com/package/universal-user-agent)
|
||||
[](https://github.com/gr2m/universal-user-agent/actions/workflows/test.yml?query=workflow%3ATest)
|
||||
|
||||
```js
|
||||
import { getUserAgent } from "universal-user-agent";
|
||||
|
||||
const userAgent = getUserAgent();
|
||||
// userAgent will look like this
|
||||
// in browser: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
|
||||
// in node: Node.js/v8.9.4 (macOS High Sierra; x64)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[ISC](LICENSE.md)
|
||||
5
node_modules/universal-user-agent/SECURITY.md
generated
vendored
Normal file
5
node_modules/universal-user-agent/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
4
node_modules/universal-user-agent/index.d.ts
generated
vendored
Normal file
4
node_modules/universal-user-agent/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Returns a User Agent String based on the current environment (Browser, Node, Deno, etc).
|
||||
*/
|
||||
export function getUserAgent(): string;
|
||||
13
node_modules/universal-user-agent/index.js
generated
vendored
Normal file
13
node_modules/universal-user-agent/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export function getUserAgent() {
|
||||
if (typeof navigator === "object" && "userAgent" in navigator) {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
|
||||
if (typeof process === "object" && process.version !== undefined) {
|
||||
return `Node.js/${process.version.substr(1)} (${process.platform}; ${
|
||||
process.arch
|
||||
})`;
|
||||
}
|
||||
|
||||
return "<environment undetectable>";
|
||||
}
|
||||
5
node_modules/universal-user-agent/index.test-d.ts
generated
vendored
Normal file
5
node_modules/universal-user-agent/index.test-d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { expectType } from "tsd";
|
||||
|
||||
import { getUserAgent } from "./index.js";
|
||||
|
||||
expectType<string>(getUserAgent());
|
||||
40
node_modules/universal-user-agent/index.test.js
generated
vendored
Normal file
40
node_modules/universal-user-agent/index.test.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import { getUserAgent } from "./index.js";
|
||||
|
||||
if (getUserAgent instanceof Function === false) {
|
||||
throw new Error("getUserAgent is not a function");
|
||||
}
|
||||
|
||||
if (typeof getUserAgent() !== "string") {
|
||||
throw new Error("getUserAgent does not return a string");
|
||||
}
|
||||
|
||||
if ("Deno" in globalThis) {
|
||||
if (/Deno\//.test(getUserAgent()) === false) {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for Deno"
|
||||
);
|
||||
}
|
||||
} else if ("Bun" in globalThis) {
|
||||
if (/Bun\//.test(getUserAgent()) === false) {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for Bun"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (/Node\.js\//.test(getUserAgent()) === false) {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for Node.js"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
delete globalThis.navigator;
|
||||
delete globalThis.process;
|
||||
|
||||
if (getUserAgent() !== "<environment undetectable>") {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for undetectable environment"
|
||||
);
|
||||
}
|
||||
|
||||
console.info("getUserAgent test passed");
|
||||
28
node_modules/universal-user-agent/package.json
generated
vendored
Normal file
28
node_modules/universal-user-agent/package.json
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "universal-user-agent",
|
||||
"version": "7.0.3",
|
||||
"type": "module",
|
||||
"description": "Get a user agent string across all JavaScript Runtime Environments",
|
||||
"exports": "./index.js",
|
||||
"types": "index.d.ts",
|
||||
"repository": "github:gr2m/universal-user-agent",
|
||||
"keywords": [],
|
||||
"author": "Gregor Martynus (https://github.com/gr2m)",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"lint": "prettier --check '*.{js,json,md}'",
|
||||
"lint:fix": "prettier --write '*.{js,json,md}'",
|
||||
"test": "npm run test:node && npm run test:types",
|
||||
"test:bun": "bun test",
|
||||
"test:node": "node index.test.js",
|
||||
"test:deno": "deno test",
|
||||
"test:types": "tsd"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^2.0.0",
|
||||
"tsd": "^0.17.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"provenance": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user