New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-diff-sync

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-diff-sync - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+178
index.es.js
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
class AbstractRepo {
submit(revs) {
return _asyncToGenerator(function* () {})();
}
pull(revId) {
return _asyncToGenerator(function* () {})();
}
}
class IdGenerator {
constructor() {
this.prefix = 'o';
this.index = 1;
}
genId() {
var index = this.index;
this.index++;
return "".concat(this.prefix).concat(index);
}
}
class Revision {
constructor(data) {
this.history = [];
Object.assign(this, data);
}
add(key, value) {
this.history.push({
op: '+',
key,
value
});
}
remove(key) {
this.history.push({
op: '-',
key
});
}
}
class MockRepo extends AbstractRepo {
constructor() {
super(...arguments);
this.revs = [];
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
_this.revs.push.apply(_this.revs, revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
if (revId) {
var index = _this2.revs.findIndex(e => {
return e.id === revId;
});
return _this2.revs.slice(index + 1);
} else {
return _this2.revs;
}
})();
}
getRevisions() {
return this.revs;
}
}
var Repo = {
AbstractRepo,
createMockRepo: function createMockRepo() {
return new MockRepo();
}
};
class DiffSync {
constructor() {
this.latestRevisionId = '';
this.revIdGenerator = new IdGenerator();
this.repo = Repo.createMockRepo();
}
setRepo(repo) {
this.repo = repo;
}
createRevision() {
var newId = this.revIdGenerator.genId();
return new Revision({
id: newId
});
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
yield _this.repo.submit(revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
return yield _this2.repo.pull(revId);
})();
}
update() {
var _this3 = this;
return _asyncToGenerator(function* () {
var changedRevs = yield _this3.pull(_this3.latestRevisionId);
if (changedRevs.length > 0) {
_this3.latestRevisionId = changedRevs[changedRevs.length - 1].id;
}
return changedRevs;
})();
}
}
export { AbstractRepo, DiffSync };
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
class AbstractRepo {
submit(revs) {
return _asyncToGenerator(function* () {})();
}
pull(revId) {
return _asyncToGenerator(function* () {})();
}
}
class IdGenerator {
constructor() {
this.prefix = 'o';
this.index = 1;
}
genId() {
var index = this.index;
this.index++;
return "".concat(this.prefix).concat(index);
}
}
class Revision {
constructor(data) {
this.history = [];
Object.assign(this, data);
}
add(key, value) {
this.history.push({
op: '+',
key,
value
});
}
remove(key) {
this.history.push({
op: '-',
key
});
}
}
class MockRepo extends AbstractRepo {
constructor() {
super(...arguments);
this.revs = [];
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
_this.revs.push.apply(_this.revs, revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
if (revId) {
var index = _this2.revs.findIndex(e => {
return e.id === revId;
});
return _this2.revs.slice(index + 1);
} else {
return _this2.revs;
}
})();
}
getRevisions() {
return this.revs;
}
}
var Repo = {
AbstractRepo,
createMockRepo: function createMockRepo() {
return new MockRepo();
}
};
class DiffSync {
constructor() {
this.latestRevisionId = '';
this.revIdGenerator = new IdGenerator();
this.repo = Repo.createMockRepo();
}
setRepo(repo) {
this.repo = repo;
}
createRevision() {
var newId = this.revIdGenerator.genId();
return new Revision({
id: newId
});
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
yield _this.repo.submit(revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
return yield _this2.repo.pull(revId);
})();
}
update() {
var _this3 = this;
return _asyncToGenerator(function* () {
var changedRevs = yield _this3.pull(_this3.latestRevisionId);
if (changedRevs.length > 0) {
_this3.latestRevisionId = changedRevs[changedRevs.length - 1].id;
}
return changedRevs;
})();
}
}
exports.AbstractRepo = AbstractRepo;
exports.DiffSync = DiffSync;
+0
-0

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ MIT License

+2
-2
{
"name": "react-diff-sync",
"version": "1.0.0",
"description": "The multiple tabs application for React Project",
"version": "1.0.1",
"description": "The diff versioning library for React Project",
"author": "samick17",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -5,3 +5,3 @@ # react-diff-sync

[![NPM](https://img.shields.io/npm/v/reacted.svg)](https://www.npmjs.com/package/reacted) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![NPM](https://img.shields.io/npm/v/react-diff-sync.svg)](https://www.npmjs.com/package/react-diff-sync) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

@@ -21,2 +21,6 @@ ## Support the project

```js
import { DiffSync, AbstractRepo } from 'react-diff-sync';
```
## Import specified module

@@ -23,0 +27,0 @@

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
class AbstractRepo {
submit(revs) {
return _asyncToGenerator(function* () {})();
}
pull(revId) {
return _asyncToGenerator(function* () {})();
}
}
class IdGenerator {
constructor() {
this.prefix = 'o';
this.index = 1;
}
genId() {
var index = this.index;
this.index++;
return "".concat(this.prefix).concat(index);
}
}
class Revision {
constructor(data) {
this.history = [];
Object.assign(this, data);
}
add(key, value) {
this.history.push({
op: '+',
key,
value
});
}
remove(key) {
this.history.push({
op: '-',
key
});
}
}
class MockRepo extends AbstractRepo {
constructor() {
super(...arguments);
this.revs = [];
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
_this.revs.push.apply(_this.revs, revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
if (revId) {
var index = _this2.revs.findIndex(e => {
return e.id === revId;
});
return _this2.revs.slice(index + 1);
} else {
return _this2.revs;
}
})();
}
getRevisions() {
return this.revs;
}
}
var Repo = {
AbstractRepo,
createMockRepo: function createMockRepo() {
return new MockRepo();
}
};
class DiffSync {
constructor() {
this.latestRevisionId = '';
this.revIdGenerator = new IdGenerator();
this.repo = Repo.createMockRepo();
}
setRepo(repo) {
this.repo = repo;
}
createRevision() {
var newId = this.revIdGenerator.genId();
return new Revision({
id: newId
});
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
yield _this.repo.submit(revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
return yield _this2.repo.pull(revId);
})();
}
update() {
var _this3 = this;
return _asyncToGenerator(function* () {
var changedRevs = yield _this3.pull(_this3.latestRevisionId);
if (changedRevs.length > 0) {
_this3.latestRevisionId = changedRevs[changedRevs.length - 1].id;
}
return changedRevs;
})();
}
}
export { AbstractRepo, DiffSync };
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
class AbstractRepo {
submit(revs) {
return _asyncToGenerator(function* () {})();
}
pull(revId) {
return _asyncToGenerator(function* () {})();
}
}
class IdGenerator {
constructor() {
this.prefix = 'o';
this.index = 1;
}
genId() {
var index = this.index;
this.index++;
return "".concat(this.prefix).concat(index);
}
}
class Revision {
constructor(data) {
this.history = [];
Object.assign(this, data);
}
add(key, value) {
this.history.push({
op: '+',
key,
value
});
}
remove(key) {
this.history.push({
op: '-',
key
});
}
}
class MockRepo extends AbstractRepo {
constructor() {
super(...arguments);
this.revs = [];
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
_this.revs.push.apply(_this.revs, revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
if (revId) {
var index = _this2.revs.findIndex(e => {
return e.id === revId;
});
return _this2.revs.slice(index + 1);
} else {
return _this2.revs;
}
})();
}
getRevisions() {
return this.revs;
}
}
var Repo = {
AbstractRepo,
createMockRepo: function createMockRepo() {
return new MockRepo();
}
};
class DiffSync {
constructor() {
this.latestRevisionId = '';
this.revIdGenerator = new IdGenerator();
this.repo = Repo.createMockRepo();
}
setRepo(repo) {
this.repo = repo;
}
createRevision() {
var newId = this.revIdGenerator.genId();
return new Revision({
id: newId
});
}
submit(revs) {
var _this = this;
return _asyncToGenerator(function* () {
yield _this.repo.submit(revs);
})();
}
pull(revId) {
var _this2 = this;
return _asyncToGenerator(function* () {
return yield _this2.repo.pull(revId);
})();
}
update() {
var _this3 = this;
return _asyncToGenerator(function* () {
var changedRevs = yield _this3.pull(_this3.latestRevisionId);
if (changedRevs.length > 0) {
_this3.latestRevisionId = changedRevs[changedRevs.length - 1].id;
}
return changedRevs;
})();
}
}
exports.AbstractRepo = AbstractRepo;
exports.DiffSync = DiffSync;