21 lines
506 B
JavaScript
21 lines
506 B
JavaScript
|
|
// turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by
|
|
// `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2}
|
|
|
|
'use strict';
|
|
|
|
exports.__esModule = true;
|
|
exports['default'] = stripStyle;
|
|
|
|
function stripStyle(style) {
|
|
var ret = {};
|
|
for (var key in style) {
|
|
if (!Object.prototype.hasOwnProperty.call(style, key)) {
|
|
continue;
|
|
}
|
|
ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
module.exports = exports['default']; |