Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alternative-facts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alternative-facts - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

src/work.js

80

index.js

@@ -1,8 +0,13 @@

'use strict';
"use strict";
var shuffle = require('shuffle-words');
var scramble = require('scramble');
require('./tools/array');
var blacklist = [];
var fuxor = require('fuxor');
var Stochator = require('stochator');

@@ -25,32 +30,39 @@

if (typeof module[prop] === 'function' && blacklist.includes(prop)) {
(function () {
var origMethod = module[prop];
module[prop] = function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var origMethod = module[prop];
var result = origMethod.apply(this, args);
if (!blacklist.includes(prop)) {
return result;
}
if (typeof result === 'string') {
return result + scramble(result);
}
if (typeof result === 'array') {
return scramble(result);
}
if (typeof result === 'array') {
return scramble(result);
}
if (typeof result === 'boolean') {
return !result;
}
if (typeof result === 'number') {
return numberGen(result);
}
module[prop] = function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var result = origMethod.apply(this, args);
if (!blacklist.includes(prop)) {
return result;
};
})();
}
if (typeof result === 'string') {
return result + scramble(result);
}
if (typeof result === 'array') {
return scramble(result);
}
if (typeof result === 'array') {
return scramble(result);
}
if (typeof result === 'boolean') {
return !result;
}
if (typeof result === 'number') {
return numberGen(result);
}
return result;
};
}
if (typeof module[prop] === 'string' && blacklist.includes(prop)) {

@@ -65,2 +77,3 @@ if (!trumpedProperties.has(prop)) {

}
if (typeof module[prop] === 'number' && blacklist.includes(prop)) {

@@ -71,2 +84,3 @@ if (!trumpedProperties.has(prop)) {

var newNumber = numberGen(_origProp);
if (newNumber !== _origProp) {

@@ -81,2 +95,3 @@ module[prop] = newNumber;

}
if (typeof module[prop] === 'boolean' && blacklist.includes(prop)) {

@@ -97,4 +112,6 @@ if (!trumpedProperties.has(prop)) {

}
return module;
};
fuxor.wrap(wrapper);

@@ -106,8 +123,5 @@

};
var af = function af() {
for (var _len2 = arguments.length, methodsToChange = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
methodsToChange[_key2] = arguments[_key2];
}
blacklist.push.apply(blacklist, methodsToChange);
blacklist.push.apply(blacklist, arguments);
return {

@@ -114,0 +128,0 @@ reset: function reset() {

{
"name": "alternative-facts",
"version": "1.0.3",
"version": "2.0.0",
"description": "JS lib that intercepts code and delivers incorrect values",

@@ -8,4 +8,4 @@ "main": "index.js",

"build": "babel ./src -d .",
"test": "ava",
"watch": "ava --watch"
"test": "mocha",
"watch": "mocha --watch"
},

@@ -25,6 +25,6 @@ "repository": {

},
"homepage": "https://github.com/Kevnz/alternative-facts#readme",
"homepage": "http://kevinisom.info/alternative-facts/",
"dependencies": {
"fuxor": "^2.2.1",
"randomatic": "^1.1.6",
"fuxor": "^2.2.2",
"randomatic": "^3.1.1",
"scramble": "0.0.4",

@@ -35,6 +35,11 @@ "shuffle-words": "^0.1.2",

"devDependencies": {
"ava": "^0.18.1",
"babel-cli": "^6.22.2",
"babel-preset-env": "^1.1.8"
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"@kev_nz/eslint-config": "^3.2.0",
"@kev_nz/publisher": "^1.0.1",
"chai": "^4.2.0",
"eslint": "^5.14.1",
"mocha": "^6.0.0"
}
}

@@ -0,3 +1,5 @@

# Alternative-Facts
[![Build Status](https://travis-ci.org/Kevnz/fuxor.png?branch=master)](https://travis-ci.org/Kevnz/alternative-facts)
# alternative-facts
## When you want to make the truth false.

@@ -8,7 +10,9 @@

### API
#### Setup
```:javascript
```js
// require
const alternativeFacts = require('alternative-facts')
const af = alternativeFacts('format');
const af = alternativeFacts('format');
//override any method or property named format

@@ -22,3 +26,4 @@ const util = require('util');

#### reset
```:javascript
```js
af.reset();

@@ -31,3 +36,3 @@ const util2 = require('util');

#### init
```:javascript
```js
af.reset();

@@ -39,3 +44,1 @@ af.init('format');

```

@@ -20,4 +20,6 @@ const shuffle = require('shuffle-words');

const wrapper = (module) => {
for (let prop in module) {
if (module.hasOwnProperty(prop)) {
if (typeof module[prop] === 'function' && blacklist.includes(prop)) {

@@ -48,2 +50,3 @@ const origMethod = module[prop];

}
if (typeof module[prop] === 'string' && blacklist.includes(prop)) {

@@ -50,0 +53,0 @@ if (!trumpedProperties.has(prop)) {

@@ -1,2 +0,2 @@

'use strict';
"use strict";

@@ -9,9 +9,13 @@ if (!Array.prototype.includes) {

}
var o = Object(this);
var len = o.length >>> 0;
if (len === 0) {
return false;
}
var n = fromIndex | 0;
var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
while (k < len) {

@@ -21,4 +25,6 @@ if (o[k] === searchElement) {

}
k++;
}
return false;

@@ -25,0 +31,0 @@ }

@@ -1,4 +0,5 @@

'use strict';
"use strict";
var util = require('util');
module.exports = {

@@ -5,0 +6,0 @@ xformat: function xformat(base, arg1, arg2) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc