Comparing version 2.1.2 to 2.1.3
14
index.js
@@ -343,16 +343,2 @@ 'use strict'; | ||
/** | ||
* Get string representation. | ||
* | ||
* @returns {String} | ||
* @api public | ||
*/ | ||
Device.prototype.toString = function toString() { | ||
var output = this.family | ||
, version = this.toVersion(); | ||
if (version) output += ' '+ version; | ||
return output; | ||
}; | ||
/** | ||
* Outputs a JSON string of the Device, values are defaulted to undefined so they | ||
@@ -359,0 +345,0 @@ * are not outputed in the stringify. |
@@ -23,22 +23,27 @@ 'use strict'; | ||
exports.update = function update(callback) { | ||
// Fetch the remote resource as that is frequently updated | ||
request(exports.remote, function downloading(err, res, remote) { | ||
// Prepend local additions that are missing from the source | ||
fs.readFile(exports.before, 'utf8', function reading(err, before) { | ||
if (err) return callback(err); | ||
if (res.statusCode !== 200) return callback(new Error('Invalid statusCode returned')); | ||
// Also get some local additions that are missing from the source | ||
fs.readFile(exports.local, 'utf8', function reading(err, local) { | ||
// Fetch the remote resource as that is frequently updated | ||
request(exports.remote, function downloading(err, res, remote) { | ||
if (err) return callback(err); | ||
if (res.statusCode !== 200) return callback(new Error('Invalid statusCode returned')); | ||
// Parse the contents | ||
exports.parse([ remote, local ], function parsing(err, results, source) { | ||
callback(err, results); | ||
// Append get some local additions that are missing from the source | ||
fs.readFile(exports.after, 'utf8', function reading(err, after) { | ||
if (err) return callback(err); | ||
if (source && !err) { | ||
fs.writeFile(exports.output, source, function idk(err) { | ||
if (err) { | ||
console.error('Failed to save the generated file due to reasons', err); | ||
} | ||
}); | ||
} | ||
// Parse the contents | ||
exports.parse([ before, remote, after ], function parsing(err, results, source) { | ||
callback(err, results); | ||
if (source && !err) { | ||
fs.writeFile(exports.output, source, function idk(err) { | ||
if (err) { | ||
console.error('Failed to save the generated file due to reasons', err); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
@@ -212,3 +217,3 @@ }); | ||
/** | ||
* The location of our local regexes yaml file. | ||
* The locations of our local regexes yaml files. | ||
* | ||
@@ -218,3 +223,4 @@ * @type {String} | ||
*/ | ||
exports.local = path.resolve(__dirname, '..', 'static', 'user_agent.after.yaml'); | ||
exports.before = path.resolve(__dirname, '..', 'static', 'user_agent.before.yaml'); | ||
exports.after = path.resolve(__dirname, '..', 'static', 'user_agent.after.yaml'); | ||
@@ -221,0 +227,0 @@ /** |
{ | ||
"name": "useragent", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Fastest, most accurate & effecient user agent string parser, uses Browserscope's research for parsing", | ||
@@ -5,0 +5,0 @@ "author": "Arnout Kazemier", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2334862
24
3926