core-js-pure 3.4.5 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
1
  var parent = require('../../es/object');
2
+ require('../../modules/esnext.object.iterate-entries');
3
+ require('../../modules/esnext.object.iterate-keys');
4
+ require('../../modules/esnext.object.iterate-values');
2
5
 
3
6
  module.exports = parent;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.object.iterate-entries');
2
+ var path = require('../../internals/path');
3
+
4
+ module.exports = path.Object.iterateEntries;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.object.iterate-keys');
2
+ var path = require('../../internals/path');
3
+
4
+ module.exports = path.Object.iterateKeys;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.object.iterate-values');
2
+ var path = require('../../internals/path');
3
+
4
+ module.exports = path.Object.iterateValues;
@@ -1,7 +1,12 @@
1
- var shared = require('../internals/shared');
1
+ var store = require('../internals/shared-store');
2
2
 
3
3
  var functionToString = Function.toString;
4
4
 
5
- module.exports = shared('inspectSource', function (it) {
6
- return functionToString.call(it);
7
- });
5
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
6
+ if (typeof store.inspectSource != 'function') {
7
+ store.inspectSource = function (it) {
8
+ return functionToString.call(it);
9
+ };
10
+ }
11
+
12
+ module.exports = store.inspectSource;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+ var InternalStateModule = require('../internals/internal-state');
3
+ var createIteratorConstructor = require('../internals/create-iterator-constructor');
4
+ var has = require('../internals/has');
5
+ var objectKeys = require('../internals/object-keys');
6
+ var toObject = require('../internals/to-object');
7
+
8
+ var OBJECT_ITERATOR = 'Object Iterator';
9
+ var setInternalState = InternalStateModule.set;
10
+ var getInternalState = InternalStateModule.getterFor(OBJECT_ITERATOR);
11
+
12
+ module.exports = createIteratorConstructor(function ObjectIterator(source, mode) {
13
+ var object = toObject(source);
14
+ setInternalState(this, {
15
+ type: OBJECT_ITERATOR,
16
+ mode: mode,
17
+ object: object,
18
+ keys: objectKeys(object),
19
+ index: 0
20
+ });
21
+ }, 'Object', function next() {
22
+ var state = getInternalState(this);
23
+ var keys = state.keys;
24
+ while (true) {
25
+ if (keys === null || state.index >= keys.length) {
26
+ state.object = state.keys = null;
27
+ return { value: undefined, done: true };
28
+ }
29
+ var key = keys[state.index++];
30
+ var object = state.object;
31
+ if (!has(object, key)) continue;
32
+ switch (state.mode) {
33
+ case 'keys': return { value: key, done: false };
34
+ case 'values': return { value: object[key], done: false };
35
+ } /* entries */ return { value: [key, object[key]], done: false };
36
+ }
37
+ });
@@ -4,7 +4,7 @@ var store = require('../internals/shared-store');
4
4
  (module.exports = function (key, value) {
5
5
  return store[key] || (store[key] = value !== undefined ? value : {});
6
6
  })('versions', []).push({
7
- version: '3.4.5',
7
+ version: '3.5.0',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var ObjectIterator = require('../internals/object-iterator');
4
+
5
+ // `Object.iterateEntries` method
6
+ // https://github.com/tc39/proposal-object-iteration
7
+ $({ target: 'Object', stat: true }, {
8
+ iterateEntries: function iterateEntries(object) {
9
+ return new ObjectIterator(object, 'entries');
10
+ }
11
+ });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var ObjectIterator = require('../internals/object-iterator');
4
+
5
+ // `Object.iterateKeys` method
6
+ // https://github.com/tc39/proposal-object-iteration
7
+ $({ target: 'Object', stat: true }, {
8
+ iterateKeys: function iterateKeys(object) {
9
+ return new ObjectIterator(object, 'keys');
10
+ }
11
+ });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var ObjectIterator = require('../internals/object-iterator');
4
+
5
+ // `Object.iterateValues` method
6
+ // https://github.com/tc39/proposal-object-iteration
7
+ $({ target: 'Object', stat: true }, {
8
+ iterateValues: function iterateValues(object) {
9
+ return new ObjectIterator(object, 'values');
10
+ }
11
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.4.5",
4
+ "version": "3.5.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
package/postinstall.js CHANGED
@@ -5,12 +5,19 @@ var path = require('path');
5
5
  var env = process.env;
6
6
 
7
7
  var ADBLOCK = is(env.ADBLOCK);
8
- var CI = is(env.CI);
9
8
  var COLOR = is(env.npm_config_color);
10
9
  var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);
11
10
  var SILENT = ['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel) !== -1;
12
11
  var MINUTE = 60 * 1000;
13
12
 
13
+ // you could add a PR with an env variable for your CI detection
14
+ var CI = [
15
+ 'BUILD_NUMBER',
16
+ 'CI',
17
+ 'CONTINUOUS_INTEGRATION',
18
+ 'RUN_ID'
19
+ ].some(function (it) { return is(env[it]); });
20
+
14
21
  var BANNER = '\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m) for polyfilling JavaScript standard library!\u001B[0m\n\n' +
15
22
  '\u001B[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: \u001B[0m\n' +
16
23
  '\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m\n' +
@@ -0,0 +1,3 @@
1
+ require('../modules/esnext.object.iterate-entries');
2
+ require('../modules/esnext.object.iterate-keys');
3
+ require('../modules/esnext.object.iterate-values');
package/stage/1.js CHANGED
@@ -5,6 +5,7 @@ require('../proposals/keys-composition');
5
5
  require('../proposals/math-extensions');
6
6
  require('../proposals/math-signbit');
7
7
  require('../proposals/number-from-string');
8
+ require('../proposals/object-iteration');
8
9
  require('../proposals/observable');
9
10
  require('../proposals/pattern-matching');
10
11
  require('../proposals/promise-try');