Skip to content

Commit 116f8e7

Browse files
committed
Remove Object.keys ponyfill, since this library was never intended to support IE8
1 parent 9fba820 commit 116f8e7

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { objectKeys, encodeEntities, indent, isLargeString, styleObjToCss, assign, getNodeProps } from './util';
1+
import { encodeEntities, indent, isLargeString, styleObjToCss, assign, getNodeProps } from './util';
22

33
const SHALLOW = { shallow: true };
44

@@ -88,7 +88,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode) {
8888
let s = '', html;
8989

9090
if (attributes) {
91-
let attrs = objectKeys(attributes);
91+
let attrs = Object.keys(attributes);
9292

9393
// allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai)
9494
if (opts && opts.sortAttributes===true) attrs.sort();

src/util.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
// DOM properties that should NOT have "px" added when numeric
22
export const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;
33

4-
export const objectKeys = Object.keys || (obj => {
5-
let keys = [];
6-
for (let i in obj) if (obj.hasOwnProperty(i)) keys.push(i);
7-
return keys;
8-
});
9-
104
export let encodeEntities = s => String(s)
115
.replace(/&/g, '&')
126
.replace(/</g, '&lt;')

0 commit comments

Comments
 (0)