Add new helpers submodule

This commit is contained in:
Faisal Salman
2023-10-24 11:14:28 +07:00
parent 17f0c1e1cd
commit f8f71c65d4
4 changed files with 41 additions and 0 deletions

11
src/helpers/ua-parser-helpers.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.1
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>
import { IResult } from "../main/ua-parser";
declare function isAppleSilicon(res:IResult): boolean;
export {
isAppleSilicon
}

View File

@@ -0,0 +1,20 @@
///////////////////////////////////////////////
/* Helpers for UAParser.js v2.0.0-beta.1
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
AGPLv3 License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
const { CPU, OS } = require('../enums/ua-parser-enums');
const isAppleSilicon = function (res) {
return res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM);
}
module.exports = {
isAppleSilicon
}
// TODO: create test