expose cobie utilities for browser
This commit is contained in:
@@ -163,7 +163,7 @@ function formatCobieTimestamp(cobiets) {
|
||||
return sign + rawDateHex + '.' + paddedTimeHex;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
const Cobie = {
|
||||
COBIE_EPOCH,
|
||||
COBIE_UNITS,
|
||||
floorDiv,
|
||||
@@ -171,5 +171,15 @@ module.exports = {
|
||||
getTAIOffsetAt,
|
||||
toCobiets,
|
||||
fromCobiets,
|
||||
formatCobieTimestamp
|
||||
formatCobieTimestamp,
|
||||
breakdownNonNeg
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = Cobie;
|
||||
}
|
||||
|
||||
// Expose globally when loaded in a browser environment
|
||||
if (typeof window !== 'undefined') {
|
||||
window.Cobie = Cobie;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user