@commercetools-test-data/core
Advanced tools
Comparing version 2.1.1 to 2.1.2
# @commercetools-test-data/core | ||
## 2.1.2 | ||
### Patch Changes | ||
- [#52](https://github.com/commercetools/test-data/pull/52) [`54b4586`](https://github.com/commercetools/test-data/commit/54b4586fea89dbef8bd6086eeeaeae52e6a3a394) Thanks [@renovate](https://github.com/apps/renovate)! - chore: update all deps | ||
## 2.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -5,97 +5,51 @@ 'use strict'; | ||
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat'); | ||
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys'); | ||
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols'); | ||
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter'); | ||
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor'); | ||
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each'); | ||
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors'); | ||
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties'); | ||
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property'); | ||
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray'); | ||
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty'); | ||
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes'); | ||
var _defineProperty$1 = require('@babel/runtime-corejs3/helpers/defineProperty'); | ||
var _Object$fromEntries = require('@babel/runtime-corejs3/core-js-stable/object/from-entries'); | ||
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each'); | ||
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map'); | ||
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat'); | ||
var _typeof = require('@babel/runtime-corejs3/helpers/typeof'); | ||
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties'); | ||
require('@babel/runtime-corejs3/core-js-stable/instance/slice'); | ||
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map'); | ||
var _Object$fromEntries = require('@babel/runtime-corejs3/core-js-stable/object/from-entries'); | ||
var _Symbol$toPrimitive = require('@babel/runtime-corejs3/core-js-stable/symbol/to-primitive'); | ||
var testDataBot = require('@jackfranklin/test-data-bot'); | ||
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray'); | ||
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array'); | ||
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries'); | ||
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array'); | ||
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys); | ||
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols); | ||
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty); | ||
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor); | ||
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty); | ||
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors); | ||
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties); | ||
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty); | ||
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty); | ||
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty); | ||
var _toConsumableArray__default = /*#__PURE__*/_interopDefault(_toConsumableArray); | ||
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty); | ||
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty$1); | ||
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty); | ||
var _Object$fromEntries__default = /*#__PURE__*/_interopDefault(_Object$fromEntries); | ||
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty); | ||
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty); | ||
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties); | ||
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray); | ||
var _Symbol$toPrimitive__default = /*#__PURE__*/_interopDefault(_Symbol$toPrimitive); | ||
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray); | ||
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries); | ||
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray); | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object); if (enumerableOnly) symbols = _filterInstanceProperty__default['default'](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default['default'](object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
return obj; | ||
} | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty__default['default'](_context4 = ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default['default']) { _Object$defineProperties__default['default'](target, _Object$getOwnPropertyDescriptors__default['default'](source)); } else { var _context5; _forEachInstanceProperty__default['default'](_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; } | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
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); | ||
} | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[_Symbol$toPrimitive__default['default']]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
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 _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
var isFunction = function isFunction(value) { | ||
@@ -119,4 +73,4 @@ return typeof value === 'function'; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
var deleted = entity[prop], | ||
newState = _objectWithoutProperties__default['default'](entity, _mapInstanceProperty__default['default'](_context2 = [prop]).call(_context2, _toPropertyKey)); | ||
entity[prop]; | ||
var newState = _objectWithoutProperties(entity, _mapInstanceProperty__default['default'](_context2 = [prop]).call(_context2, _toPropertyKey)); | ||
@@ -195,5 +149,5 @@ return newState; | ||
var name = _ref2.name, | ||
remainingOptions = _objectWithoutProperties__default['default'](_ref2, ["name"]); | ||
remainingOptions = _objectWithoutProperties(_ref2, ["name"]); | ||
return _objectSpread2({ | ||
return _objectSpread({ | ||
__typename: "".concat(name, "QueryResult") | ||
@@ -247,2 +201,5 @@ }, toRestPaginatedQueryResult(list, remainingOptions)); | ||
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object); if (enumerableOnly) symbols = _filterInstanceProperty__default['default'](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default['default'](object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty__default['default'](_context4 = ownKeys$1(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default['default']) { _Object$defineProperties__default['default'](target, _Object$getOwnPropertyDescriptors__default['default'](source)); } else { var _context5; _forEachInstanceProperty__default['default'](_context5 = ownKeys$1(Object(source))).call(_context5, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; } | ||
// Therefore, we define a custom constructor that requires a different return type. | ||
@@ -256,3 +213,3 @@ | ||
var state = initial ? _objectSpread2({}, initial) : {}; | ||
var state = initial ? _objectSpread$1({}, initial) : {}; | ||
return { | ||
@@ -263,6 +220,6 @@ get: function get() { | ||
merge: function merge(update) { | ||
state = _objectSpread2(_objectSpread2({}, state), update); | ||
state = _objectSpread$1(_objectSpread$1({}, state), update); | ||
}, | ||
set: function set(prop, value) { | ||
state = _objectSpread2(_objectSpread2({}, state), {}, _defineProperty__default['default']({}, prop, value)); | ||
state = _objectSpread$1(_objectSpread$1({}, state), {}, _defineProperty({}, prop, value)); | ||
} | ||
@@ -372,3 +329,3 @@ }; | ||
return pickMany.apply(void 0, _concatInstanceProperty__default['default'](_context2 = [transformed]).call(_context2, _toConsumableArray__default['default'](keepFields))); | ||
return pickMany.apply(void 0, _concatInstanceProperty__default['default'](_context2 = [transformed]).call(_context2, _toConsumableArray(keepFields))); | ||
} | ||
@@ -379,3 +336,3 @@ | ||
return omitMany.apply(void 0, _concatInstanceProperty__default['default'](_context3 = [transformed]).call(_context3, _toConsumableArray__default['default'](omitFields))); | ||
return omitMany.apply(void 0, _concatInstanceProperty__default['default'](_context3 = [transformed]).call(_context3, _toConsumableArray(omitFields))); | ||
} | ||
@@ -416,5 +373,9 @@ | ||
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object); if (enumerableOnly) symbols = _filterInstanceProperty__default['default'](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default['default'](object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default['default'](_context2 = ownKeys$2(Object(source), true)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default['default']) { _Object$defineProperties__default['default'](target, _Object$getOwnPropertyDescriptors__default['default'](source)); } else { var _context3; _forEachInstanceProperty__default['default'](_context3 = ownKeys$2(Object(source))).call(_context3, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; } | ||
function Transformer(transformType, transformOptions) { | ||
function transform(fields) { | ||
var transformedFields = _objectSpread2({}, fields); | ||
var transformedFields = _objectSpread$2({}, fields); | ||
@@ -431,3 +392,3 @@ var fieldsReplacer = transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.replaceFields; | ||
if (field) { | ||
transformedFields = _objectSpread2(_objectSpread2({}, transformedFields), {}, _defineProperty__default['default']({}, fieldToBuild, _Array$isArray__default['default'](field) ? buildFields(field, transformType, { | ||
transformedFields = _objectSpread$2(_objectSpread$2({}, transformedFields), {}, _defineProperty({}, fieldToBuild, _Array$isArray__default['default'](field) ? buildFields(field, transformType, { | ||
fieldToBuild: fieldToBuild | ||
@@ -471,3 +432,3 @@ }) : buildField(field, transformType, { | ||
_forEachInstanceProperty__default['default'](_context = _Object$entries__default['default'](fieldsToAdd)).call(_context, function (_ref) { | ||
var _ref2 = _slicedToArray__default['default'](_ref, 2), | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
fieldName = _ref2[0], | ||
@@ -477,3 +438,3 @@ fieldValue = _ref2[1]; | ||
if (transformedFields[fieldName]) return; | ||
transformedFields = _objectSpread2(_objectSpread2({}, transformedFields), {}, _defineProperty__default['default']({}, fieldName, fieldValue)); | ||
transformedFields = _objectSpread$2(_objectSpread$2({}, transformedFields), {}, _defineProperty({}, fieldName, fieldValue)); | ||
}); | ||
@@ -480,0 +441,0 @@ } |
@@ -5,97 +5,51 @@ 'use strict'; | ||
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat'); | ||
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys'); | ||
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols'); | ||
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter'); | ||
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor'); | ||
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each'); | ||
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors'); | ||
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties'); | ||
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property'); | ||
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray'); | ||
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty'); | ||
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes'); | ||
var _defineProperty$1 = require('@babel/runtime-corejs3/helpers/defineProperty'); | ||
var _Object$fromEntries = require('@babel/runtime-corejs3/core-js-stable/object/from-entries'); | ||
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each'); | ||
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map'); | ||
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat'); | ||
var _typeof = require('@babel/runtime-corejs3/helpers/typeof'); | ||
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties'); | ||
require('@babel/runtime-corejs3/core-js-stable/instance/slice'); | ||
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map'); | ||
var _Object$fromEntries = require('@babel/runtime-corejs3/core-js-stable/object/from-entries'); | ||
var _Symbol$toPrimitive = require('@babel/runtime-corejs3/core-js-stable/symbol/to-primitive'); | ||
var testDataBot = require('@jackfranklin/test-data-bot'); | ||
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray'); | ||
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array'); | ||
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries'); | ||
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array'); | ||
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys); | ||
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols); | ||
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty); | ||
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor); | ||
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty); | ||
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors); | ||
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties); | ||
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty); | ||
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty); | ||
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty); | ||
var _toConsumableArray__default = /*#__PURE__*/_interopDefault(_toConsumableArray); | ||
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty); | ||
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty$1); | ||
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty); | ||
var _Object$fromEntries__default = /*#__PURE__*/_interopDefault(_Object$fromEntries); | ||
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty); | ||
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty); | ||
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties); | ||
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray); | ||
var _Symbol$toPrimitive__default = /*#__PURE__*/_interopDefault(_Symbol$toPrimitive); | ||
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray); | ||
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries); | ||
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray); | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object); if (enumerableOnly) symbols = _filterInstanceProperty__default['default'](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default['default'](object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
return obj; | ||
} | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty__default['default'](_context4 = ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default['default']) { _Object$defineProperties__default['default'](target, _Object$getOwnPropertyDescriptors__default['default'](source)); } else { var _context5; _forEachInstanceProperty__default['default'](_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; } | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
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); | ||
} | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[_Symbol$toPrimitive__default['default']]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
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 _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
var isFunction = function isFunction(value) { | ||
@@ -119,4 +73,4 @@ return typeof value === 'function'; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
var deleted = entity[prop], | ||
newState = _objectWithoutProperties__default['default'](entity, _mapInstanceProperty__default['default'](_context2 = [prop]).call(_context2, _toPropertyKey)); | ||
entity[prop]; | ||
var newState = _objectWithoutProperties(entity, _mapInstanceProperty__default['default'](_context2 = [prop]).call(_context2, _toPropertyKey)); | ||
@@ -195,5 +149,5 @@ return newState; | ||
var name = _ref2.name, | ||
remainingOptions = _objectWithoutProperties__default['default'](_ref2, ["name"]); | ||
remainingOptions = _objectWithoutProperties(_ref2, ["name"]); | ||
return _objectSpread2({ | ||
return _objectSpread({ | ||
__typename: "".concat(name, "QueryResult") | ||
@@ -247,2 +201,5 @@ }, toRestPaginatedQueryResult(list, remainingOptions)); | ||
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object); if (enumerableOnly) symbols = _filterInstanceProperty__default['default'](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default['default'](object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty__default['default'](_context4 = ownKeys$1(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default['default']) { _Object$defineProperties__default['default'](target, _Object$getOwnPropertyDescriptors__default['default'](source)); } else { var _context5; _forEachInstanceProperty__default['default'](_context5 = ownKeys$1(Object(source))).call(_context5, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; } | ||
// Therefore, we define a custom constructor that requires a different return type. | ||
@@ -256,3 +213,3 @@ | ||
var state = initial ? _objectSpread2({}, initial) : {}; | ||
var state = initial ? _objectSpread$1({}, initial) : {}; | ||
return { | ||
@@ -263,6 +220,6 @@ get: function get() { | ||
merge: function merge(update) { | ||
state = _objectSpread2(_objectSpread2({}, state), update); | ||
state = _objectSpread$1(_objectSpread$1({}, state), update); | ||
}, | ||
set: function set(prop, value) { | ||
state = _objectSpread2(_objectSpread2({}, state), {}, _defineProperty__default['default']({}, prop, value)); | ||
state = _objectSpread$1(_objectSpread$1({}, state), {}, _defineProperty({}, prop, value)); | ||
} | ||
@@ -372,3 +329,3 @@ }; | ||
return pickMany.apply(void 0, _concatInstanceProperty__default['default'](_context2 = [transformed]).call(_context2, _toConsumableArray__default['default'](keepFields))); | ||
return pickMany.apply(void 0, _concatInstanceProperty__default['default'](_context2 = [transformed]).call(_context2, _toConsumableArray(keepFields))); | ||
} | ||
@@ -379,3 +336,3 @@ | ||
return omitMany.apply(void 0, _concatInstanceProperty__default['default'](_context3 = [transformed]).call(_context3, _toConsumableArray__default['default'](omitFields))); | ||
return omitMany.apply(void 0, _concatInstanceProperty__default['default'](_context3 = [transformed]).call(_context3, _toConsumableArray(omitFields))); | ||
} | ||
@@ -416,5 +373,9 @@ | ||
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object); if (enumerableOnly) symbols = _filterInstanceProperty__default['default'](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default['default'](object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default['default'](_context2 = ownKeys$2(Object(source), true)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default['default']) { _Object$defineProperties__default['default'](target, _Object$getOwnPropertyDescriptors__default['default'](source)); } else { var _context3; _forEachInstanceProperty__default['default'](_context3 = ownKeys$2(Object(source))).call(_context3, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; } | ||
function Transformer(transformType, transformOptions) { | ||
function transform(fields) { | ||
var transformedFields = _objectSpread2({}, fields); | ||
var transformedFields = _objectSpread$2({}, fields); | ||
@@ -431,3 +392,3 @@ var fieldsReplacer = transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.replaceFields; | ||
if (field) { | ||
transformedFields = _objectSpread2(_objectSpread2({}, transformedFields), {}, _defineProperty__default['default']({}, fieldToBuild, _Array$isArray__default['default'](field) ? buildFields(field, transformType, { | ||
transformedFields = _objectSpread$2(_objectSpread$2({}, transformedFields), {}, _defineProperty({}, fieldToBuild, _Array$isArray__default['default'](field) ? buildFields(field, transformType, { | ||
fieldToBuild: fieldToBuild | ||
@@ -471,3 +432,3 @@ }) : buildField(field, transformType, { | ||
_forEachInstanceProperty__default['default'](_context = _Object$entries__default['default'](fieldsToAdd)).call(_context, function (_ref) { | ||
var _ref2 = _slicedToArray__default['default'](_ref, 2), | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
fieldName = _ref2[0], | ||
@@ -477,3 +438,3 @@ fieldValue = _ref2[1]; | ||
if (transformedFields[fieldName]) return; | ||
transformedFields = _objectSpread2(_objectSpread2({}, transformedFields), {}, _defineProperty__default['default']({}, fieldName, fieldValue)); | ||
transformedFields = _objectSpread$2(_objectSpread$2({}, transformedFields), {}, _defineProperty({}, fieldName, fieldValue)); | ||
}); | ||
@@ -480,0 +441,0 @@ } |
@@ -0,83 +1,33 @@ | ||
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys'; | ||
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols'; | ||
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter'; | ||
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor'; | ||
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each'; | ||
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors'; | ||
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties'; | ||
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property'; | ||
import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray'; | ||
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty'; | ||
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes'; | ||
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat'; | ||
import _toConsumableArray from '@babel/runtime-corejs3/helpers/toConsumableArray'; | ||
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes'; | ||
import _defineProperty$1 from '@babel/runtime-corejs3/helpers/defineProperty'; | ||
import _typeof from '@babel/runtime-corejs3/helpers/esm/typeof'; | ||
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties'; | ||
import '@babel/runtime-corejs3/core-js-stable/instance/slice'; | ||
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map'; | ||
import _Object$fromEntries from '@babel/runtime-corejs3/core-js-stable/object/from-entries'; | ||
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each'; | ||
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map'; | ||
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties'; | ||
import '@babel/runtime-corejs3/core-js-stable/instance/slice'; | ||
import _Symbol$toPrimitive from '@babel/runtime-corejs3/core-js-stable/symbol/to-primitive'; | ||
import { build } from '@jackfranklin/test-data-bot'; | ||
export { bool, fake, oneOf, sequence } from '@jackfranklin/test-data-bot'; | ||
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray'; | ||
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray'; | ||
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array'; | ||
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries'; | ||
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
return obj; | ||
} | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
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); | ||
} | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[_Symbol$toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
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 _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
var isFunction = function isFunction(value) { | ||
@@ -101,4 +51,4 @@ return typeof value === 'function'; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
var deleted = entity[prop], | ||
newState = _objectWithoutProperties(entity, _mapInstanceProperty(_context2 = [prop]).call(_context2, _toPropertyKey)); | ||
entity[prop]; | ||
var newState = _objectWithoutProperties(entity, _mapInstanceProperty(_context2 = [prop]).call(_context2, _toPropertyKey)); | ||
@@ -179,3 +129,3 @@ return newState; | ||
return _objectSpread2({ | ||
return _objectSpread({ | ||
__typename: "".concat(name, "QueryResult") | ||
@@ -229,2 +179,5 @@ }, toRestPaginatedQueryResult(list, remainingOptions)); | ||
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = ownKeys$1(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = ownKeys$1(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
// Therefore, we define a custom constructor that requires a different return type. | ||
@@ -238,3 +191,3 @@ | ||
var state = initial ? _objectSpread2({}, initial) : {}; | ||
var state = initial ? _objectSpread$1({}, initial) : {}; | ||
return { | ||
@@ -245,6 +198,6 @@ get: function get() { | ||
merge: function merge(update) { | ||
state = _objectSpread2(_objectSpread2({}, state), update); | ||
state = _objectSpread$1(_objectSpread$1({}, state), update); | ||
}, | ||
set: function set(prop, value) { | ||
state = _objectSpread2(_objectSpread2({}, state), {}, _defineProperty$1({}, prop, value)); | ||
state = _objectSpread$1(_objectSpread$1({}, state), {}, _defineProperty({}, prop, value)); | ||
} | ||
@@ -396,5 +349,9 @@ }; | ||
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty(_context2 = ownKeys$2(Object(source), true)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context3; _forEachInstanceProperty(_context3 = ownKeys$2(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function Transformer(transformType, transformOptions) { | ||
function transform(fields) { | ||
var transformedFields = _objectSpread2({}, fields); | ||
var transformedFields = _objectSpread$2({}, fields); | ||
@@ -411,3 +368,3 @@ var fieldsReplacer = transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.replaceFields; | ||
if (field) { | ||
transformedFields = _objectSpread2(_objectSpread2({}, transformedFields), {}, _defineProperty$1({}, fieldToBuild, _Array$isArray(field) ? buildFields(field, transformType, { | ||
transformedFields = _objectSpread$2(_objectSpread$2({}, transformedFields), {}, _defineProperty({}, fieldToBuild, _Array$isArray(field) ? buildFields(field, transformType, { | ||
fieldToBuild: fieldToBuild | ||
@@ -456,3 +413,3 @@ }) : buildField(field, transformType, { | ||
if (transformedFields[fieldName]) return; | ||
transformedFields = _objectSpread2(_objectSpread2({}, transformedFields), {}, _defineProperty$1({}, fieldName, fieldValue)); | ||
transformedFields = _objectSpread$2(_objectSpread$2({}, transformedFields), {}, _defineProperty({}, fieldName, fieldValue)); | ||
}); | ||
@@ -459,0 +416,0 @@ } |
@@ -8,3 +8,3 @@ import type { Json, TReferenceObject, TExpandedReference, TBuilder, TPaginatedQueryResult, TPaginatedQueryResultOptions, TGraphqlPaginatedQueryResult, TGraphqlPaginatedQueryResultOptions, TBuildFieldMeta, TTransformType, TTransformBuildName } from './types'; | ||
declare const lowerFirst: (value: string) => string; | ||
declare const omitMany: <T, K extends keyof T = keyof T>(entity: T, ...props: K[]) => Pick<T, Exclude<keyof T, K>>; | ||
declare const omitMany: <T, K extends keyof T = keyof T>(entity: T, ...props: K[]) => Omit<T, K>; | ||
declare const pickMany: <T, K extends keyof T = keyof T>(entity: T, ...props: K[]) => Pick<T, K>; | ||
@@ -11,0 +11,0 @@ declare const convertBuiltNameToTransformName: (buildName: TTransformBuildName) => TTransformType; |
{ | ||
"name": "@commercetools-test-data/core", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "This package provides the core functions to define the data models", | ||
@@ -29,6 +29,6 @@ "bugs": "https://github.com/commercetools/test-data/issues", | ||
"dependencies": { | ||
"@babel/runtime": "7.12.5", | ||
"@babel/runtime-corejs3": "7.12.5", | ||
"@babel/runtime": "7.13.10", | ||
"@babel/runtime-corejs3": "7.13.10", | ||
"@jackfranklin/test-data-bot": "1.3.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
84197
0
1330
+ Added@babel/runtime@7.13.10(transitive)
+ Added@babel/runtime-corejs3@7.13.10(transitive)
- Removed@babel/runtime@7.12.5(transitive)
- Removed@babel/runtime-corejs3@7.12.5(transitive)
Updated@babel/runtime@7.13.10