Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Jun 14, 2021
1 parent 28238a6 commit 7e94eca
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 43 deletions.
97 changes: 55 additions & 42 deletions react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@

var React__default = 'default' in React ? React['default'] : React;

function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);

if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);

if (enumerableOnly) {
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
}

keys.push.apply(keys, symbols);
}

return keys;
}

function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};

if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}

return target;
}

function _typeof(obj) {
"@babel/helpers - typeof";

Expand Down Expand Up @@ -59,40 +97,6 @@
return obj;
}

function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);

if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}

return keys;
}

function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};

if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}

return target;
}

function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
Expand Down Expand Up @@ -138,14 +142,17 @@
}

function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);

if (_i == null) return;
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;

var _s, _e;

try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);

if (i && _arr.length === i) break;
Expand Down Expand Up @@ -467,6 +474,9 @@
return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
}

var _excluded = ["format"],
_excluded2 = ["children", "count", "parent", "i18nKey", "tOptions", "values", "defaults", "components", "ns", "i18n", "t"];

function hasChildren(node, checkLength) {
if (!node) return false;
var base = node.props ? node.props.children : node.children;
Expand Down Expand Up @@ -526,7 +536,7 @@
warn("Trans: the passed in value is invalid - seems you passed in a null child.");
} else if (_typeof(child) === 'object') {
var format = child.format,
clone = _objectWithoutProperties(child, ["format"]);
clone = _objectWithoutProperties(child, _excluded);

var keys = Object.keys(clone);

Expand Down Expand Up @@ -676,7 +686,7 @@
ns = _ref.ns,
i18nFromProps = _ref.i18n,
tFromProps = _ref.t,
additionalProps = _objectWithoutProperties(_ref, ["children", "count", "parent", "i18nKey", "tOptions", "values", "defaults", "components", "ns", "i18n", "t"]);
additionalProps = _objectWithoutProperties(_ref, _excluded2);

var _ref2 = React.useContext(I18nContext) || {},
i18nFromContext = _ref2.i18n,
Expand Down Expand Up @@ -815,12 +825,13 @@
});
}

var _excluded$1 = ["forwardedRef"];
function withTranslation(ns) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function Extend(WrappedComponent) {
function I18nextWithTranslation(_ref) {
var forwardedRef = _ref.forwardedRef,
rest = _objectWithoutProperties(_ref, ["forwardedRef"]);
rest = _objectWithoutProperties(_ref, _excluded$1);

var _useTranslation = useTranslation(ns, rest),
_useTranslation2 = _slicedToArray(_useTranslation, 3),
Expand Down Expand Up @@ -856,10 +867,11 @@
};
}

var _excluded$2 = ["ns", "children"];
function Translation(props) {
var ns = props.ns,
children = props.children,
options = _objectWithoutProperties(props, ["ns", "children"]);
options = _objectWithoutProperties(props, _excluded$2);

var _useTranslation = useTranslation(ns, options),
_useTranslation2 = _slicedToArray(_useTranslation, 3),
Expand Down Expand Up @@ -916,12 +928,13 @@
}
}

var _excluded$3 = ["initialI18nStore", "initialLanguage"];
function withSSR() {
return function Extend(WrappedComponent) {
function I18nextWithSSR(_ref) {
var initialI18nStore = _ref.initialI18nStore,
initialLanguage = _ref.initialLanguage,
rest = _objectWithoutProperties(_ref, ["initialI18nStore", "initialLanguage"]);
rest = _objectWithoutProperties(_ref, _excluded$3);

useSSR(initialI18nStore, initialLanguage);
return React__default.createElement(WrappedComponent, _objectSpread2({}, rest));
Expand Down
Loading

0 comments on commit 7e94eca

Please sign in to comment.