Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
# Bowser Changelog | ||
### 2.0.0-alpha.3 (July 22, 2018) | ||
- [CHANGE] Rename split and rename `compiled.js` to `es5.js` and `bundled.js` (#231, #236, #237) | ||
- [ADD] Add `Parser.some` (#235) | ||
### 2.0.0-alpha.2 (July 17, 2018) | ||
@@ -4,0 +8,0 @@ - [CHANGE] Make `src/bowser` main file instead of the bundled one |
{ | ||
"name": "bowser", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"description": "Lightweight browser detector", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -29,2 +29,12 @@ ## Bowser | ||
By default, `require('bowser')` requires the *ES6 version of files*, which | ||
**do not** include any polyfills. | ||
In case if you don't use your own `babel-polyfill` you may need to have pre-built bundle with all needed polyfills. | ||
So, for you it's suitable to require bowser like this: `require('bowser/bundled')`. | ||
As the result, you get a ES5 version of bowser with `babel-polyfill` bundled together. | ||
If you use bowser for Node.js, you'd better use `require('bowser/es5')`, | ||
since source files have `import` statements, which are not compatible with Node.js yet. | ||
## Browser props detection | ||
@@ -114,9 +124,2 @@ | ||
# Advanced Usage | ||
By default, `require('bowser')` requires the *ES6 version of files*, which | ||
**don't** include any polyfills. In case if you don't use your own `babel-polyfill` | ||
you may need to have pre-built bundle with all needed polyfills. | ||
It's possible requiring bowser like that: `require('bowser/compiled');` | ||
As result you get a ES5 file with `babel-polyfill` bundled in it. | ||
# Contributing | ||
@@ -123,0 +126,0 @@ If you'd like to contribute a change to bowser, modify the files in `src/`, then run the following (you'll need node + npm installed): |
@@ -430,4 +430,13 @@ import browserParsersList from './parser-browsers'; | ||
} | ||
/** | ||
* Check if any of the given values satifies this.is(anything) | ||
* @param {String[]} anythings | ||
* @returns {Boolean} | ||
*/ | ||
some(anythings = []) { | ||
return anythings.some(anything => this.is(anything)); | ||
} | ||
} | ||
export default Parser; |
@@ -6,3 +6,6 @@ const path = require('path'); | ||
// Chosen mode tells webpack to use its built-in optimizations accordingly. | ||
entry: ['babel-polyfill', './src/bowser.js'], // string | object | array | ||
entry: { | ||
bundled: ['babel-polyfill', './src/bowser.js'], | ||
es5: './src/bowser.js', | ||
}, // string | object | array | ||
// defaults to ./src | ||
@@ -16,3 +19,3 @@ // Here the application starts executing | ||
// must be an absolute path (use the Node.js path module) | ||
filename: 'compiled.js', // string | ||
filename: '[name].js', // string | ||
// the filename template for entry chunks | ||
@@ -19,0 +22,0 @@ library: 'bowser', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2175
142
305520
29