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

machinepack-arrays

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

machinepack-arrays - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

upgrade-tests.js

4

package.json
{
"name": "machinepack-arrays",
"version": "4.0.0",
"version": "4.0.1",
"description": "Work with arrays.",

@@ -21,3 +21,3 @@ "scripts": {

"devDependencies": {
"test-machinepack-mocha": "^1.0.0"
"test-machinepack-mocha": "^2.0.0"
},

@@ -24,0 +24,0 @@ "machinepack": {

@@ -5,10 +5,19 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"firstArray": "[{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]",
"secondArray": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}]"
"firstArray": [
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"secondArray": [
{
"name": "Lucy"
},
{
"name": "Ricky"
}
]
},

@@ -33,4 +42,4 @@ "outcome": "success",

"using": {
"firstArray": "[]",
"secondArray": "[]"
"firstArray": [],
"secondArray": []
},

@@ -37,0 +46,0 @@ "outcome": "success"

@@ -5,9 +5,17 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
]
},

@@ -14,0 +22,0 @@ "outcome": "success",

@@ -6,4 +6,27 @@ {

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"rob\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "rob"
}
},

@@ -14,4 +37,27 @@ "outcome": "notFound"

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"mike\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "mike"
}
},

@@ -26,4 +72,27 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"rachael\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "rachael"
}
},

@@ -38,4 +107,27 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"scott\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "scott"
}
},

@@ -50,4 +142,27 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"irl\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "irl"
}
},

@@ -62,4 +177,27 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"cody\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "cody"
}
},

@@ -73,2 +211,2 @@ "outcome": "success",

]
}
}

@@ -6,4 +6,27 @@ {

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"rachael\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "rachael"
}
},

@@ -20,4 +43,27 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}]",
"criteria": "{\"name\":\"rob\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
}
],
"criteria": {
"name": "rob"
}
},

@@ -28,4 +74,31 @@ "outcome": "success"

"using": {
"array": "[{\"name\": \"mike\", \"id\": 1}, {\"name\": \"rachael\", \"id\": 3}, {\"name\": \"cody\", \"id\": 4}, {\"id\": 5, \"name\": \"scott\"}, {\"name\": \"irl\", \"id\": 2}, {\"name\": \"mike\", \"id\": 6}]",
"criteria": "{\"name\":\"mike\"}"
"array": [
{
"name": "mike",
"id": 1
},
{
"name": "rachael",
"id": 3
},
{
"name": "cody",
"id": 4
},
{
"id": 5,
"name": "scott"
},
{
"name": "irl",
"id": 2
},
{
"name": "mike",
"id": 6
}
],
"criteria": {
"name": "mike"
}
},

@@ -45,2 +118,2 @@ "outcome": "success",

]
}
}

@@ -6,5 +6,9 @@ {

"using": {
"array": "[\"a\",\"b\",\"c\"]",
"index": "1",
"value": "x"
"array": [
"a",
"b",
"c"
],
"index": 1,
"value": "\"x\""
},

@@ -21,5 +25,9 @@ "outcome": "success",

"using": {
"array": "[\"a\",\"b\",\"c\"]",
"index": "0",
"value": "x"
"array": [
"a",
"b",
"c"
],
"index": 0,
"value": "\"x\""
},

@@ -36,5 +44,9 @@ "outcome": "success",

"using": {
"array": "[\"a\",\"b\",\"c\"]",
"index": "2",
"value": "x"
"array": [
"a",
"b",
"c"
],
"index": 2,
"value": "\"x\""
},

@@ -51,5 +63,9 @@ "outcome": "success",

"using": {
"array": "[\"a\",\"b\",\"c\"]",
"index": "3",
"value": "x"
"array": [
"a",
"b",
"c"
],
"index": 3,
"value": "\"x\""
},

@@ -66,5 +82,9 @@ "outcome": "success",

"using": {
"array": "[\"a\",\"b\",\"c\"]",
"index": "4",
"value": "x"
"array": [
"a",
"b",
"c"
],
"index": 4,
"value": "\"x\""
},

@@ -74,2 +94,2 @@ "outcome": "notFound"

]
}
}

@@ -5,9 +5,11 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}]"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
}
]
},

@@ -14,0 +16,0 @@ "outcome": "success",

@@ -6,3 +6,16 @@ {

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}, {\"name\": \"Louise\"}, {\"name\": \"Estelle\" }]"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
]
},

@@ -13,2 +26,2 @@ "outcome": "success",

]
}
}

@@ -6,5 +6,10 @@ {

"using": {
"array": "[1,2,3,4]",
"itemExample": "1",
"iteratee": "\"return exits.success(inputs.item + 1);\""
"array": [
1,
2,
3,
4
],
"itemExample": 1,
"iteratee": "return exits.success(inputs.item + 1);"
},

@@ -21,5 +26,12 @@ "outcome": "success",

"using": {
"array": "[1,2,3,4]",
"itemExample": "{ \"id\": 4 }",
"iteratee": "\"return exits.success({id: inputs.item + 1});\""
"array": [
1,
2,
3,
4
],
"itemExample": {
"id": 4
},
"iteratee": "return exits.success({id: inputs.item + 1});"
},

@@ -44,5 +56,9 @@ "outcome": "success",

"using": {
"array": "[10,20,30]",
"itemExample": "1",
"iteratee": "\"return exits.success(inputs.item+inputs.index);\""
"array": [
10,
20,
30
],
"itemExample": 1,
"iteratee": "return exits.success(inputs.item+inputs.index);"
},

@@ -58,5 +74,9 @@ "outcome": "success",

"using": {
"array": "[10,20,30]",
"itemExample": "1",
"iteratee": "\"return exits.success(inputs.item+inputs.index);\""
"array": [
10,
20,
30
],
"itemExample": 1,
"iteratee": "return exits.success(inputs.item+inputs.index);"
},

@@ -71,2 +91,2 @@ "outcome": "success",

]
}
}

@@ -5,10 +5,18 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}, {\"name\": \"Louise\"}, {\"name\": \"Estelle\" }]",
"index": "1"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"index": 1
},

@@ -22,4 +30,17 @@ "outcome": "success",

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}, {\"name\": \"Louise\"}, {\"name\": \"Estelle\" }]",
"index": "10"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"index": 10
},

@@ -30,4 +51,17 @@ "outcome": "notFound"

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}, {\"name\": \"Louise\"}, {\"name\": \"Estelle\" }]",
"index": "-1"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"index": -1
},

@@ -34,0 +68,0 @@ "outcome": "notFound"

@@ -6,3 +6,16 @@ {

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]",
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"key": "name"

@@ -19,2 +32,2 @@ },

]
}
}

@@ -6,5 +6,12 @@ {

"using": {
"array": "[{\"name\":\"arya\"}, {\"name\":\"rob\"}]",
"iteratee": "\"return exits.success(inputs.resultSoFar+(inputs.index>0?\\\" \\\":\\\"\\\")+inputs.item.name);\"",
"resultExample": "\"bob rob\""
"array": [
{
"name": "arya"
},
{
"name": "rob"
}
],
"iteratee": "return exits.success(inputs.resultSoFar+(inputs.index>0?\" \":\"\")+inputs.item.name);",
"resultExample": "bob rob"
},

@@ -16,5 +23,16 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"jon\", \"wolf\": \"Ghost\" }, {\"name\":\"arya\"}, {\"name\":\"rob\"}]",
"iteratee": "\"return exits.success(inputs.resultSoFar+(inputs.index>0?\\\" \\\":\\\"\\\")+inputs.item.name);\"",
"resultExample": "\"bob rob\""
"array": [
{
"name": "jon",
"wolf": "Ghost"
},
{
"name": "arya"
},
{
"name": "rob"
}
],
"iteratee": "return exits.success(inputs.resultSoFar+(inputs.index>0?\" \":\"\")+inputs.item.name);",
"resultExample": "bob rob"
},

@@ -26,5 +44,15 @@ "outcome": "success",

"using": {
"array": "[1,2,3,4,5,-1,6,7,8]",
"iteratee": "\"if (inputs.item < 0) { return exits.halt(); } return exits.success('stopped at ---> '+inputs.item);\"",
"resultExample": "\"3a\""
"array": [
1,
2,
3,
4,
5,
-1,
6,
7,
8
],
"iteratee": "if (inputs.item < 0) { return exits.halt(); } return exits.success('stopped at ---> '+inputs.item);",
"resultExample": "3a"
},

@@ -35,2 +63,2 @@ "outcome": "success",

]
}
}

@@ -5,9 +5,4 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[]"
"array": []
},

@@ -18,3 +13,6 @@ "outcome": "success"

"using": {
"array": "[\"a\", \"b\"]"
"array": [
"a",
"b"
]
},

@@ -29,3 +27,7 @@ "outcome": "success",

"using": {
"array": "[\"a\", \"b\", \"c\"]"
"array": [
"a",
"b",
"c"
]
},

@@ -41,3 +43,7 @@ "outcome": "success",

"using": {
"array": "[1, 2, 3]"
"array": [
1,
2,
3
]
},

@@ -53,3 +59,5 @@ "outcome": "success",

"using": {
"array": "[\"stuff\"]"
"array": [
"stuff"
]
},

@@ -63,3 +71,10 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"Lucy\" }, {\"name\":\"Ricky\"}]"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
}
]
},

@@ -77,2 +92,2 @@ "outcome": "success",

]
}
}
{
"machine": "sample",
"expectations": [
{
"todo": true,
"using": {},
"outcome": "success"
}
]
"expectations": []
}

@@ -5,10 +5,18 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\": \"Lucy\"}, {\"name\": \"Ricky\"}, {\"name\": \"Louise\" }, { \"name\": \"Estelle\" }]",
"start": "1"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 1
},

@@ -30,4 +38,17 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"Lucy\"}, {\"name\": \"Ricky\"}, {\"name\": \"Louise\" }, { \"name\": \"Estelle\" }]",
"start": "0"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 0
},

@@ -52,4 +73,17 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"Lucy\"}, {\"name\": \"Ricky\"}, {\"name\": \"Louise\" }, { \"name\": \"Estelle\" }]",
"start": "3"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 3
},

@@ -65,4 +99,17 @@ "outcome": "success",

"using": {
"array": "[{\"name\": \"Lucy\"}, {\"name\": \"Ricky\"}, {\"name\": \"Louise\" }, { \"name\": \"Estelle\" }]",
"start": "5"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 5
},

@@ -73,5 +120,18 @@ "outcome": "success"

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]",
"start": "0",
"end": "0"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 0,
"end": 0
},

@@ -87,5 +147,18 @@ "outcome": "success",

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]",
"start": "0",
"end": "1"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 0,
"end": 1
},

@@ -104,5 +177,18 @@ "outcome": "success",

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]",
"start": "0",
"end": "3"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 0,
"end": 3
},

@@ -127,5 +213,18 @@ "outcome": "success",

"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Estelle\"}]",
"start": "0",
"end": "1000"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"start": 0,
"end": 1000
},

@@ -132,0 +231,0 @@ "outcome": "success",

@@ -5,9 +5,17 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}, {\"name\": \"Louise\"}, {\"name\": \"Estelle\" }]",
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
],
"key": "name"

@@ -32,2 +40,2 @@ },

]
}
}

@@ -6,3 +6,10 @@ {

"using": {
"array": "[4.7, -5, -100, 3, -4.29485, 100]"
"array": [
4.7,
-5,
-100,
3,
-4.29485,
100
]
},

@@ -21,3 +28,12 @@ "outcome": "success",

"using": {
"array": "[2000, 4.7, -5, -100, 3, -4.29485, 100, -4.29486]"
"array": [
2000,
4.7,
-5,
-100,
3,
-4.29485,
100,
-4.29486
]
},

@@ -37,2 +53,2 @@ "outcome": "success",

]
}
}

@@ -6,8 +6,22 @@ {

"using": {
"array": "[\"z\",\"a\",\"A\",\"2323\",\"m\",\"J\"]"
"array": [
"z",
"a",
"A",
"2323",
"m",
"J"
]
},
"outcome": "success",
"returns": "[\"2323\",\"A\",\"J\",\"a\",\"m\",\"z\"]"
"returns": [
"2323",
"A",
"J",
"a",
"m",
"z"
]
}
]
}
}

@@ -5,9 +5,17 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"},{\"name\":\"Louise\"},{\"name\":\"Louise\"}]",
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Louise"
}
],
"key": "name"

@@ -14,0 +22,0 @@ },

@@ -5,9 +5,17 @@ {

{
"todo": true,
"using": {},
"outcome": "success"
},
{
"using": {
"array": "[{\"name\":\"Lucy\"},{\"name\":\"Ricky\"}, {\"name\": \"Louise\"}, {\"name\": \"Estelle\" }]"
"array": [
{
"name": "Lucy"
},
{
"name": "Ricky"
},
{
"name": "Louise"
},
{
"name": "Estelle"
}
]
},

@@ -32,8 +40,22 @@ "outcome": "success",

"using": {
"array": "[4,4,4,5,1,8,3]"
"array": [
4,
4,
4,
5,
1,
8,
3
]
},
"outcome": "success",
"returns": [4,5,1,8,3]
"returns": [
4,
5,
1,
8,
3
]
}
]
}
}
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