samsung-device-helper 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,94 @@
1
- # TBD
1
+ # Samsung Device Helper
2
+
3
+ `samsung-device-helper` is an npm package designed to provide a comprehensive list of Samsung devices, including phones, tablets, and watches. It offers utility functions to retrieve device names by model and fetch lists of devices by category.
4
+
5
+ ## Installation
6
+
7
+ To install the package, run:
8
+
9
+ ```bash
10
+ npm install samsung-device-helper
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Here's a quick guide on how to use the `samsung-device-helper` package in your project.
16
+
17
+ ### Importing the Package
18
+
19
+ First, import the necessary functions from the package:
20
+
21
+ ```javascript
22
+ const {
23
+ getNameByModel,
24
+ getAllSamsungPhones,
25
+ getAllSamsungTablets,
26
+ getAllSamsungWatches,
27
+ getAllSamsungDevices,
28
+ } = require("samsung-device-helper");
29
+ ```
30
+
31
+ ### Functions
32
+
33
+ #### `getNameByModel(model: string): string`
34
+
35
+ This function takes a device model as an argument and returns the corresponding device name. If the model is not recognized, it returns the model itself.
36
+
37
+ ```javascript
38
+ const deviceName = getNameByModel("SM-G991B");
39
+ console.log(deviceName); // Outputs: "Galaxy S21 5G"
40
+ ```
41
+
42
+ #### `getAllSamsungPhones(): Device[]`
43
+
44
+ Returns an array of all Samsung phones.
45
+
46
+ ```javascript
47
+ const phones = getAllSamsungPhones();
48
+ console.log(phones);
49
+ ```
50
+
51
+ #### `getAllSamsungTablets(): Device[]`
52
+
53
+ Returns an array of all Samsung tablets.
54
+
55
+ ```javascript
56
+ const tablets = getAllSamsungTablets();
57
+ console.log(tablets);
58
+ ```
59
+
60
+ #### `getAllSamsungWatches(): Device[]`
61
+
62
+ Returns an array of all Samsung watches.
63
+
64
+ ```javascript
65
+ const watches = getAllSamsungWatches();
66
+ console.log(watches);
67
+ ```
68
+
69
+ #### `getAllSamsungDevices(): Device[]`
70
+
71
+ Returns an array of all Samsung devices, including phones, tablets, and watches.
72
+
73
+ ```javascript
74
+ const devices = getAllSamsungDevices();
75
+ console.log(devices);
76
+ ```
77
+
78
+ ## Contributing
79
+
80
+ If you'd like to contribute to this project, please submit a pull request or open an issue on GitHub.
81
+
82
+ ## License
83
+
84
+ This project is licensed under the MIT License.
85
+
86
+ ---
87
+
88
+ For more information, visit the [GitHub repository](https://github.com/yourusername/samsung-device-helper).
89
+
90
+ ## Acknowledgments
91
+
92
+ This package is inspired by the need to simplify the retrieval and management of Samsung device data for developers.
93
+
94
+ Happy coding!
@@ -0,0 +1,6 @@
1
+ import { Device } from "./types";
2
+ export declare const getNameByModel: (model: string) => string;
3
+ export declare const getAllSamsungPhones: () => Device[];
4
+ export declare const getAllSamsungTablets: () => Device[];
5
+ export declare const getAllSamsungWatches: () => Device[];
6
+ export declare const getAllSamsungDevices: () => Device[];
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllSamsungDevices = exports.getAllSamsungWatches = exports.getAllSamsungTablets = exports.getAllSamsungPhones = exports.getNameByModel = void 0;
4
+ const getNameByModel = (model) => {
5
+ if (model === "SM-G991B") {
6
+ return "Galaxy S21 5G";
7
+ }
8
+ return model;
9
+ };
10
+ exports.getNameByModel = getNameByModel;
11
+ const getAllSamsungPhones = () => {
12
+ return [
13
+ {
14
+ model: "SM-G991B",
15
+ name: "Galaxy S21 5G",
16
+ releaseDate: "2021-01-29",
17
+ type: "phone",
18
+ },
19
+ // complete full list
20
+ ];
21
+ };
22
+ exports.getAllSamsungPhones = getAllSamsungPhones;
23
+ const getAllSamsungTablets = () => {
24
+ return [
25
+ {
26
+ model: "SM-T970",
27
+ name: "Galaxy Tab S7",
28
+ releaseDate: "2020-08-05",
29
+ type: "tablet",
30
+ },
31
+ // complete full list
32
+ ];
33
+ };
34
+ exports.getAllSamsungTablets = getAllSamsungTablets;
35
+ const getAllSamsungWatches = () => {
36
+ return [
37
+ {
38
+ model: "SM-R800",
39
+ name: "Galaxy Watch",
40
+ releaseDate: "2018-08-24",
41
+ type: "watch",
42
+ },
43
+ // complete full list
44
+ ];
45
+ };
46
+ exports.getAllSamsungWatches = getAllSamsungWatches;
47
+ const getAllSamsungDevices = () => {
48
+ return [
49
+ ...(0, exports.getAllSamsungPhones)(),
50
+ ...(0, exports.getAllSamsungTablets)(),
51
+ ...(0, exports.getAllSamsungWatches)(),
52
+ ];
53
+ };
54
+ exports.getAllSamsungDevices = getAllSamsungDevices;
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const getNameByModel: (model: string) => string;
1
+ export * from "./types";
2
+ export * from "./device-helper";
package/dist/index.js CHANGED
@@ -1,10 +1,18 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNameByModel = void 0;
4
- const getNameByModel = (model) => {
5
- if (model === "SM-G991B") {
6
- return "Galaxy S21 5G";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
7
  }
8
- return model;
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
9
15
  };
10
- exports.getNameByModel = getNameByModel;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./device-helper"), exports);
@@ -0,0 +1,7 @@
1
+ export type DeviceType = "phone" | "tablet" | "watch";
2
+ export type Device = {
3
+ model: string;
4
+ name: string;
5
+ releaseDate: string;
6
+ type: DeviceType;
7
+ };
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "samsung-device-helper",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "A utility to help you identify Samsung devices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,7 +34,6 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/kulcsarrudolf/samsung-device-helper/issues"
36
36
  },
37
- "homepage": "https://kulcsarrudolf.com/samsung-device-helper",
38
37
  "devDependencies": {
39
38
  "@types/chai": "^4.3.5",
40
39
  "@types/mocha": "^10.0.1",