Skip to content

Commit 7a6fda2

Browse files
committed
Convert imports to es module
1 parent fe7257a commit 7a6fda2

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

packages/optimizely-sdk/src/utils/fns/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@
1414
* limitations under the License.
1515
*/
1616
import uuid from 'uuid';
17+
18+
var MAX_SAFE_INTEGER_LIMIT = Math.pow(2, 53);
1719
import { keyBy } from '@optimizely/js-sdk-utils';
18-
const MAX_SAFE_INTEGER_LIMIT = Math.pow(2, 53);
1920

2021
export default {
21-
assign: function (target) {
22+
assign: function(target) {
2223
if (!target) {
2324
return {};
2425
}
2526
if (typeof Object.assign === 'function') {
2627
return Object.assign.apply(Object, arguments);
2728
} else {
28-
let to = Object(target);
29-
for (let index = 1; index < arguments.length; index++) {
30-
let nextSource = arguments[index];
29+
var to = Object(target);
30+
for (var index = 1; index < arguments.length; index++) {
31+
var nextSource = arguments[index];
3132
if (nextSource !== null && nextSource !== undefined) {
32-
for (let nextKey in nextSource) {
33+
for (var nextKey in nextSource) {
3334
// Avoid bugs when hasOwnProperty is shadowed
3435
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
3536
to[nextKey] = nextSource[nextKey];

packages/optimizely-sdk/src/utils/fns/index.tests.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import chai from 'chai';
1818

19-
let assert = chai.assert;
20-
import fns from './index';
19+
var assert = chai.assert;
20+
import fns from '../../../lib/utils/fns';
2121

2222
describe('lib/utils/fns', function() {
2323
describe('APIs', function() {
@@ -43,14 +43,14 @@ describe('lib/utils/fns', function() {
4343

4444
describe('keyBy', function() {
4545
it('should return correct object when a key is provided', function() {
46-
let arr = [
46+
var arr = [
4747
{ key1: 'row1', key2: 'key2row1' },
4848
{ key1: 'row2', key2: 'key2row2' },
4949
{ key1: 'row3', key2: 'key2row3' },
5050
{ key1: 'row4', key2: 'key2row4' },
5151
];
5252

53-
let obj = fns.keyBy(arr, 'key1');
53+
var obj = fns.keyBy(arr, 'key1');
5454

5555
assert.deepEqual(obj, {
5656
row1: { key1: 'row1', key2: 'key2row1' },
@@ -61,7 +61,7 @@ describe('lib/utils/fns', function() {
6161
});
6262

6363
it('should return empty object when first argument is null or undefined', function() {
64-
let obj = fns.keyBy(null, 'key1');
64+
var obj = fns.keyBy(null, 'key1');
6565
assert.isEmpty(obj);
6666

6767
obj = fns.keyBy(undefined, 'key1');

0 commit comments

Comments
 (0)