Skip to content

Commit

Permalink
Add built files
Browse files Browse the repository at this point in the history
  • Loading branch information
smoores-dev committed Oct 1, 2024
1 parent af77f6a commit b449ca0
Show file tree
Hide file tree
Showing 191 changed files with 17,473 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Compiled code
/dist/*
# /dist/*

# We need to check in the package.json for /dist/cjs so that
# consumers know to treat it as cjs
!/dist/cjs
/dist/cjs/*
!/dist/cjs/package.json
# !/dist/cjs
# /dist/cjs/*
# !/dist/cjs/package.json

# Yarn PnP artifacts
.pnp.*
Expand Down
51 changes: 51 additions & 0 deletions dist/cjs/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "browser", {
enumerable: true,
get: ()=>browser
});
const nav = typeof navigator != "undefined" ? navigator : null;
const doc = typeof document != "undefined" ? document : null;
const agent = nav && nav.userAgent || "";
const ie_edge = /Edge\/(\d+)/.exec(agent);
const ie_upto10 = /MSIE \d/.exec(agent);
const ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(agent);
const ie = !!(ie_upto10 || ie_11up || ie_edge);
const ie_version = ie_upto10 ? document.documentMode : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0;
const gecko = !ie && /gecko\/(\d+)/i.test(agent);
const gecko_version = gecko && +(/Firefox\/(\d+)/.exec(agent) || [
0,
0
])[1];
const _chrome = !ie && /Chrome\/(\d+)/.exec(agent);
const chrome = !!_chrome;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const chrome_version = _chrome ? +_chrome[1] : 0;
const safari = !ie && !!nav && /Apple Computer/.test(nav.vendor);
// Is true for both iOS and iPadOS for convenience
const ios = safari && (/Mobile\/\w+/.test(agent) || !!nav && nav.maxTouchPoints > 2);
const mac = ios || (nav ? /Mac/.test(nav.platform) : false);
const windows = nav ? /Win/.test(nav.platform) : false;
const android = /Android \d/.test(agent);
const webkit = !!doc && "webkitFontSmoothing" in doc.documentElement.style;
const webkit_version = webkit ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [
0,
0
])[1] : 0;
const browser = {
ie,
ie_version,
gecko,
gecko_version,
chrome,
chrome_version,
safari,
ios,
mac,
windows,
android,
webkit,
webkit_version
};
Loading

0 comments on commit b449ca0

Please sign in to comment.