Skip to content

Commit 63720af

Browse files
authored
prepare 2.1.1 release (#93)
1 parent d84faaf commit 63720af

File tree

10 files changed

+19
-9
lines changed

10 files changed

+19
-9
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
- run: npm install
99
- run: mkdir -p reports/junit
1010
- run: npm run lint:all
11+
- run: npm run build
1112
- run:
1213
command: npm run test:junit
1314
environment:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All notable changes to the LaunchDarkly client-side JavaScript SDK will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org).
55

6+
## [2.1.1] - 2018-06-05
7+
### Fixed:
8+
- Removed two function calls that are not supported in Internet Explorer: `string.startsWith()` and `Object.assign()`.
9+
610
## [2.1.0] - 2018-05-31
711
### Added:
812
- The client now sends the current SDK version to LaunchDarkly in an HTTP header. This information will be visible in a future version of the LaunchDarkly UI.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ldclient-js",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "LaunchDarkly SDK for JavaScript",
55
"author": "LaunchDarkly <[email protected]>",
66
"license": "Apache-2.0",

src/EventProcessor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function EventProcessor(eventsUrl, environmentId, options = {}, e
5454

5555
// Transform an event from its internal format to the format we use when sending a payload.
5656
function makeOutputEvent(e) {
57-
const ret = Object.assign({}, e);
57+
const ret = utils.extend({}, e);
5858
if (inlineUsers || e.kind === 'identify') {
5959
// identify events always have an inline user
6060
ret.user = userFilter.filterUser(e.user);
@@ -94,7 +94,7 @@ export default function EventProcessor(eventsUrl, environmentId, options = {}, e
9494
queue.push(makeOutputEvent(event));
9595
}
9696
if (addDebugEvent) {
97-
const debugEvent = Object.assign({}, event, { kind: 'debug' });
97+
const debugEvent = utils.extend({}, event, { kind: 'debug' });
9898
delete debugEvent['trackEvents'];
9999
delete debugEvent['debugEventsUntilDate'];
100100
delete debugEvent['variation'];

src/Requestor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function fetchJSON(endpoint, body, callback) {
1111
if (
1212
xhr.status === 200 &&
1313
xhr.getResponseHeader('Content-type') &&
14-
xhr.getResponseHeader('Content-Type').startsWith(json)
14+
xhr.getResponseHeader('Content-Type').lastIndexOf(json) === 0
1515
) {
1616
callback(null, JSON.parse(xhr.responseText));
1717
} else {

src/Store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function Store(environment, hash, ident) {
3939

4040
store.saveFlags = function(flags) {
4141
const key = getFlagsKey();
42-
const data = Object.assign({}, flags, { $schema: 1 });
42+
const data = utils.extend({}, flags, { $schema: 1 });
4343
try {
4444
localStorage.setItem(key, JSON.stringify(data));
4545
} catch (ex) {

src/UserFilter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as messages from './messages';
2+
import * as utils from './utils';
23

34
/**
45
* The UserFilter object transforms user objects into objects suitable to be sent as JSON to
@@ -65,11 +66,11 @@ export default function UserFilter(config) {
6566
};
6667
const result = filterAttrs(user, key => allowedTopLevelAttrs[key]);
6768
const filteredProps = result[0];
68-
const removedAttrs = result[1];
69+
let removedAttrs = result[1];
6970
if (user.custom) {
7071
const customResult = filterAttrs(user.custom, () => true);
7172
filteredProps.custom = customResult[0];
72-
Object.assign(removedAttrs, customResult[1]);
73+
removedAttrs = utils.extend({}, removedAttrs, customResult[1]);
7374
}
7475
const removedAttrNames = Object.keys(removedAttrs);
7576
if (removedAttrNames.length) {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function initialize(env, user, options = {}) {
265265
const oldFlag = flags[data.key];
266266
if (!oldFlag || !oldFlag.version || !data.version || oldFlag.version < data.version) {
267267
const mods = {};
268-
const newFlag = Object.assign({}, data);
268+
const newFlag = utils.extend({}, data);
269269
delete newFlag['key'];
270270
flags[data.key] = newFlag;
271271
if (oldFlag) {

src/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,7 @@ export function getLDUserAgentString() {
123123
export function addLDHeaders(xhr) {
124124
xhr.setRequestHeader('X-LaunchDarkly-User-Agent', getLDUserAgentString());
125125
}
126+
127+
export function extend(...objects) {
128+
return objects.reduce((acc, obj) => ({ ...acc, ...obj }), {});
129+
}

0 commit comments

Comments
 (0)