-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create prototype detect Iphone 13 by gpu hash
- Loading branch information
1 parent
d1ed685
commit c52811e
Showing
5 changed files
with
80 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,37 @@ | ||
const AbstractParser = require('../../abstract-parser'); | ||
|
||
class DeviceHint { | ||
class DeviceHint extends AbstractParser { | ||
|
||
constructor() { | ||
super(); | ||
this.fixtureFile = 'device-hint.yml'; | ||
this.loadCollection(); | ||
} | ||
|
||
parse(clientHints = {}){ | ||
if (!clientHints.meta || !clientHints.meta.hashG) { | ||
return {}; | ||
} | ||
|
||
let hash = clientHints.meta.hashG; | ||
let item = this.collection[hash]; | ||
|
||
if (item === void 0) { | ||
return {}; | ||
} | ||
|
||
if (item && !item.devices) { | ||
return { | ||
code: String(item.code), | ||
brand: String(item.brand), | ||
type: String(item.device), | ||
model: String(item.model), | ||
}; | ||
} | ||
|
||
parse(hints = {}){ | ||
return {}; | ||
} | ||
|
||
|
||
} | ||
|
||
module.exports = DeviceHint; |
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
File renamed without changes.