From 6e959ca5219c282f10e6d90b9dfd53ba4263b01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 3 Jan 2024 20:00:19 +0100 Subject: [PATCH] remove fixture files (#925) --- .../node_modules/.yarn-integrity | 4 +- .../node_modules/curry/README.md | 130 ----------------- .../node_modules/curry/curry.js | 97 ------------- .../node_modules/curry/curry.min.js | 1 - .../node_modules/curry/examples/usage.js | 38 ----- .../node_modules/curry/package.json | 43 ------ .../node_modules/curry/test/curry-test.js | 133 ------------------ .../yarnWorkspaces/packageA/package.json | 1 - src/test/fixtures/yarnWorkspaces/yarn.lock | 5 - src/test/package.test.ts | 8 -- 10 files changed, 1 insertion(+), 459 deletions(-) delete mode 100644 src/test/fixtures/yarnWorkspaces/node_modules/curry/README.md delete mode 100644 src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.js delete mode 100644 src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.min.js delete mode 100644 src/test/fixtures/yarnWorkspaces/node_modules/curry/examples/usage.js delete mode 100644 src/test/fixtures/yarnWorkspaces/node_modules/curry/package.json delete mode 100644 src/test/fixtures/yarnWorkspaces/node_modules/curry/test/curry-test.js diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/.yarn-integrity b/src/test/fixtures/yarnWorkspaces/node_modules/.yarn-integrity index ea5f503d..a40e555f 100644 --- a/src/test/fixtures/yarnWorkspaces/node_modules/.yarn-integrity +++ b/src/test/fixtures/yarnWorkspaces/node_modules/.yarn-integrity @@ -1,5 +1,5 @@ { - "systemParams": "darwin-x64-72", + "systemParams": "darwin-arm64-108", "modulesFolders": [ "node_modules", "node_modules" @@ -7,7 +7,6 @@ "flags": [], "linkedModules": [], "topLevelPatterns": [ - "curry@1.2.0", "filter-obj@2.0.1", "in-array@0.1.2", "is-number@7.0.0", @@ -17,7 +16,6 @@ "package-b@1.0.0" ], "lockfileEntries": { - "curry@1.2.0": "https://registry.yarnpkg.com/curry/-/curry-1.2.0.tgz#9e6dd289548dba7e653d5ae3fe903fe7dfb33af2", "filter-obj@2.0.1": "https://registry.yarnpkg.com/filter-obj/-/filter-obj-2.0.1.tgz#34d9f0536786f072df7aeac3a8bda1c6e767aec6", "in-array@0.1.2": "https://registry.yarnpkg.com/in-array/-/in-array-0.1.2.tgz#1a2683009177ab914ade0620a35c5039851f3715", "is-number@7.0.0": "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b", diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/curry/README.md b/src/test/fixtures/yarnWorkspaces/node_modules/curry/README.md deleted file mode 100644 index 8ae6ec36..00000000 --- a/src/test/fixtures/yarnWorkspaces/node_modules/curry/README.md +++ /dev/null @@ -1,130 +0,0 @@ -CURRY -===== - -A curry function without anything **too clever** -_(... because hunger is the finest spice)_ - -[![browser support](https://ci.testling.com/hughfdjackson/curry.png)](https://ci.testling.com/hughfdjackson/curry) - - -# Why - -If you don't know currying, or aren't sold on it's awesomeness, perhaps [a friendly blog post](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) will help. - - -# API - -### curry - -```javascript -var curry = require('curry'); - -//-- creating a curried function is pretty -//-- straight forward: -var add = curry(function(a, b){ return a + b }); - -//-- it can be called like normal: -add(1, 2) //= 3 - -//-- or, if you miss off any arguments, -//-- a new funtion that expects all (or some) of -//-- the remaining arguments will be created: -var add1 = add(1); -add1(2) //= 3; - -//-- curry knows how many arguments a function should take -//-- by the number of parameters in the parameter list - -//-- in this case, a function and two arrays is expected -//-- (fn, a, b). zipWith will combine two arrays using a function: -var zipWith = curry(function(fn, a, b){ - return a.map(function(val, i){ return fn(val, b[i]) }); -}); - -//-- if there are still more arguments required, a curried function -//-- will always return a new curried function: -var zipAdd = zipWith(add); -var zipAddWith123 = zipAdd([1, 2, 3]); - -//-- both functions are usable as you'd expect at any time: -zipAdd([1, 2, 3], [1, 2, 3]); //= [2, 4, 6] -zipAddWith123([5, 6, 7]); //= [6, 8, 10] - -//-- the number of arguments a function is expected to provide -//-- can be discovered by the .length property -zipWith.length; //= 3 -zipAdd.length; //= 2 -zipAddWith123.length; //= 1 -``` - -### curry.to - -Sometimes it's necessary (especially when wrapping variadic functions) to explicitly provide an arity for your curried function: - -```javascript -var sum = function(){ - var nums = [].slice.call(arguments); - return nums.reduce(function(a, b){ return a + b }); -} - -var sum3 = curry.to(3, sum); -var sum4 = curry.to(4, sum); - -sum3(1, 2)(3) //= 6 -sum4(1)(2)(3, 4) //= 10 -``` - -### curry.adapt - -It's a (sad?) fact that JavaScript functions are often written to take the 'context' object as the first argument. - -With curried functions, of course, we want it to be the last object. `curry.adapt` shifts the context to the last argument, -to give us a hand with this: - -```javascript -var delve = require('delve'); -var delveC = curry.adapt(delve); - -var getDataFromResponse = delveC('response.body.data'); -getDataFromResponse({ response: { body: { data: { x: 2 }} } }); //= { x: 2 } -``` - -### curry.adaptTo - -Like `curry.adapt`, but the arity explicitly provided: - -```javascript -var _ = require('lodash'); -var map = curry.adaptTo(2, _.map); -var mapInc = map(function(a){ return a + 1 }) - -mapInc([1, 2, 3]) //= [2, 3, 4] -``` - -# installation - -### node/npm - -```bash -npm install curry -``` - -### amd - -```javascript -define(['libs/curry.min'], function(curry){ - //-- assuming libs/curry.min.js is the downloaded minified version from this repo, - //-- curry will be available here -}); -``` - -### browser - -If you're not using tools like [browserify](https://github.com/substack/node-browserify) or [require.js](http://requirejs.org), you can load curry globally: -```html - - -``` -∏∏ diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.js b/src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.js deleted file mode 100644 index 9d8fe5ae..00000000 --- a/src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.js +++ /dev/null @@ -1,97 +0,0 @@ -var slice = Array.prototype.slice; -var toArray = function(a){ return slice.call(a) } -var tail = function(a){ return slice.call(a, 1) } - -// fn, [value] -> fn -//-- create a curried function, incorporating any number of -//-- pre-existing arguments (e.g. if you're further currying a function). -var createFn = function(fn, args, totalArity){ - var remainingArity = totalArity - args.length; - - switch (remainingArity) { - case 0: return function(){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 1: return function(a){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 2: return function(a,b){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 3: return function(a,b,c){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 4: return function(a,b,c,d){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 5: return function(a,b,c,d,e){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 6: return function(a,b,c,d,e,f){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 7: return function(a,b,c,d,e,f,g){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 8: return function(a,b,c,d,e,f,g,h){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 9: return function(a,b,c,d,e,f,g,h,i){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - case 10: return function(a,b,c,d,e,f,g,h,i,j){ return processInvocation(fn, concatArgs(args, arguments), totalArity) }; - default: return createEvalFn(fn, args, remainingArity); - } -} - -// [value], arguments -> [value] -//-- concat new arguments onto old arguments array -var concatArgs = function(args1, args2){ - return args1.concat(toArray(args2)); -} - -// fn, [value], int -> fn -//-- create a function of the correct arity by the use of eval, -//-- so that curry can handle functions of any arity -var createEvalFn = function(fn, args, arity){ - var argList = makeArgList(arity); - - //-- hack for IE's faulty eval parsing -- http://stackoverflow.com/a/6807726 - var fnStr = 'false||' + - 'function(' + argList + '){ return processInvocation(fn, concatArgs(args, arguments)); }'; - return eval(fnStr); -} - -var makeArgList = function(len){ - var a = []; - for ( var i = 0; i < len; i += 1 ) a.push('a' + i.toString()); - return a.join(','); -} - -var trimArrLength = function(arr, length){ - if ( arr.length > length ) return arr.slice(0, length); - else return arr; -} - -// fn, [value] -> value -//-- handle a function being invoked. -//-- if the arg list is long enough, the function will be called -//-- otherwise, a new curried version is created. -var processInvocation = function(fn, argsArr, totalArity){ - argsArr = trimArrLength(argsArr, totalArity); - - if ( argsArr.length === totalArity ) return fn.apply(null, argsArr); - return createFn(fn, argsArr, totalArity); -} - -// fn -> fn -//-- curries a function! <3 -var curry = function(fn){ - return createFn(fn, [], fn.length); -} - -// num, fn -> fn -//-- curries a function to a certain arity! <33 -curry.to = curry(function(arity, fn){ - return createFn(fn, [], arity); -}); - -// num, fn -> fn -//-- adapts a function in the context-first style -//-- to a curried version. <3333 -curry.adaptTo = curry(function(num, fn){ - return curry.to(num, function(context){ - var args = tail(arguments).concat(context); - return fn.apply(this, args); - }); -}) - -// fn -> fn -//-- adapts a function in the context-first style to -//-- a curried version. <333 -curry.adapt = function(fn){ - return curry.adaptTo(fn.length, fn) -} - - -module.exports = curry; diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.min.js b/src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.min.js deleted file mode 100644 index 7a93ac9d..00000000 --- a/src/test/fixtures/yarnWorkspaces/node_modules/curry/curry.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if("function"==typeof bootstrap)bootstrap("curry",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCurry=e}else"undefined"!=typeof window?window.curry=e():global.curry=e()}(function(){var define,ses,bootstrap,module,exports;return function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;slength)return arr.slice(0,length);else return arr};var processInvocation=function(fn,argsArr,totalArity){argsArr=trimArrLength(argsArr,totalArity);if(argsArr.length===totalArity)return fn.apply(null,argsArr);return createFn(fn,argsArr,totalArity)};var curry=function(fn){return createFn(fn,[],fn.length)};curry.to=curry(function(arity,fn){return createFn(fn,[],arity)});curry.adaptTo=curry(function(num,fn){return curry.to(num,function(context){var args=tail(arguments).concat(context);return fn.apply(this,args)})});curry.adapt=function(fn){return curry.adaptTo(fn.length,fn)};module.exports=curry},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/curry/examples/usage.js b/src/test/fixtures/yarnWorkspaces/node_modules/curry/examples/usage.js deleted file mode 100644 index 5a190c7f..00000000 --- a/src/test/fixtures/yarnWorkspaces/node_modules/curry/examples/usage.js +++ /dev/null @@ -1,38 +0,0 @@ -var curry = require('../'); - -//-- creating a curried function is pretty -//-- straight forward: -var add = curry(function(a, b){ return a + b }); - -//-- it can be called like normal: -add(1, 2) //= 3 - -//-- or, if you miss off any arguments, -//-- a new funtion that expects all (or some) of -//-- the remaining arguments will be created: -var add1 = add(1); -add1(2) //= 3; - -//-- curry knows how many arguments a function should take -//-- by the number of parameters in the parameter list - -//-- in this case, a function and two arrays is expected -//-- (fn, a, b). zipWith will combine two arrays using a function: -var zipWith = curry(function(fn, a, b){ - return a.map(function(val, i){ return fn(val, b[i]) }); -}); - -//-- if there are still more arguments required, a curried function -//-- will always return a new curried function: -var zipAdd = zipWith(add); -var zipAddWith123 = zipAdd([1, 2, 3]); - -//-- both functions are usable as you'd expect at any time: -zipAdd([1, 2, 3], [1, 2, 3]); //= [2, 4, 6] -zipAddWith123([5, 6, 7]); //= [6, 8, 10] - -//-- the number of arguments a function is expected to provide -//-- can be discovered by the .length property -zipWith.length; //= 3 -zipAdd.length; //= 2 -zipAddWith123.length; //= 1 diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/curry/package.json b/src/test/fixtures/yarnWorkspaces/node_modules/curry/package.json deleted file mode 100644 index a96c633a..00000000 --- a/src/test/fixtures/yarnWorkspaces/node_modules/curry/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "curry", - "description": "flexible but simple curry function", - "version": "1.2.0", - "homepage": "https://github.com/dominictarr/curry", - "repository": { - "type": "git", - "url": "git://github.com/dominictarr/curry.git" - }, - "author": "Dominic Tarr ", - "contributors": [ - "Hugh FD Jackson " - ], - "main": "./curry", - "devDependencies": { - "mocha": "1.8.1", - "browserify": "2.17.2", - "uglify-js": "2.3.6", - "lodash": "2.1.0", - "delve": "0.3.2" - }, - "testling": { - "files": "test/*-test.js", - "browsers": [ - "iexplore/6.0", - "iexplore/7.0", - "iexplore/8.0", - "iexplore/9.0", - "iexplore/10.0", - "chrome/4.0", - "chrome/23.0", - "firefox/3.0", - "firefox/17.0", - "safari/5.0.5", - "safari/5.1" - ], - "harness": "mocha" - }, - "scripts": { - "test": "./node_modules/mocha/bin/mocha test", - "prepublish": "./node_modules/browserify/bin/cmd.js --standalone curry -e curry.js | ./node_modules/uglify-js/bin/uglifyjs > curry.min.js" - } -} diff --git a/src/test/fixtures/yarnWorkspaces/node_modules/curry/test/curry-test.js b/src/test/fixtures/yarnWorkspaces/node_modules/curry/test/curry-test.js deleted file mode 100644 index 53e1911c..00000000 --- a/src/test/fixtures/yarnWorkspaces/node_modules/curry/test/curry-test.js +++ /dev/null @@ -1,133 +0,0 @@ -var curry = require('../'); -var a = require('assert'); - - -describe('curry', function(){ - - it('should curry in the haskell sense, taking the arity from the function', function(){ - var sum5 = function(a, b, c, d, e){ return a + b + c + d + e }; - var sum5C = curry(sum5); - - a.equal(sum5(1, 2, 3, 4, 5), sum5C(1)(2)(3)(4)(5)); - }); - - it('should be pure - each new argument should not affect the overall list', function(){ - var add = curry(function(a, b){ return a + b }); - var add1 = add(1); - var add2 = add(2); - a.equal(add1(1), 2); - a.equal(add1(2), 3); - a.equal(add1(3), 4); - a.equal(add1(4), 5); - - a.equal(add2(1), 3); - a.equal(add2(2), 4); - a.equal(add2(3), 5); - a.equal(add2(4), 6); - }); - - it('should drop "extra" arguments', function(){ - var reportArgs = curry(function(a, b){ return [].slice.call(arguments) }); - - a.deepEqual(reportArgs('a', 'b', 'c', 'd', 'e'), ['a', 'b']); - }); - - it('should allow multiple arguments to be passed at a time', function(){ - var sum3 = curry(function(a, b, c){ return a + b + c }); - - a.equal(sum3(1, 2, 3), sum3(1, 2)(3)); - a.equal(sum3(1, 2, 3), sum3(1)(2, 3)); - a.equal(sum3(1, 2, 3), sum3(1)(2)(3)); - }); - - it('should report the arity of returned functions correctly', function(){ - var sum3 = curry(function(a, b, c){ return a + b + c }); - - a.equal(sum3.length, 3); - a.equal(sum3(1).length, 2); - a.equal(sum3(1)(2).length, 1); - - a.equal(curry(function(){}).length, 0) - a.equal(curry(function(a){}).length, 1) - a.equal(curry(function(a, b){}).length, 2) - a.equal(curry(function(a, b, c){}).length, 3) - a.equal(curry(function(a, b, c, d){}).length, 4) - a.equal(curry(function(a, b, c, d, e){}).length, 5) - a.equal(curry(function(a, b, c, d, e, f){}).length, 6) - a.equal(curry(function(a, b, c, d, e, f, g){}).length, 7) - a.equal(curry(function(a, b, c, d, e, f, g, h){}).length, 8) - a.equal(curry(function(a, b, c, d, e, f, g, h, i){}).length, 9) - a.equal(curry(function(a, b, c, d, e, f, g, h, i, j){}).length, 10) - a.equal(curry(function(a, b, c, d, e, f, g, h, i, j, k){}).length, 11) - a.equal(curry(function(a, b, c, d, e, f, g, h, i, j, k, l){}).length, 12) - a.equal(curry(function(a, b, c, d, e, f, g, h, i, j, k, l, m){}).length, 13) - a.equal(curry(function(a, b, c, d, e, f, g, h, i, j, k, l, m, n){}).length, 14) - a.equal(curry(function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o){}).length, 15) - }); - - it('should allow 0 arg curried fns', function(){ - var noop = curry(function(){}); - - a.equal(noop(), undefined); - }); -}); - -describe('curry.to', function(){ - - it('should curry to the specified arity', function(){ - var noop = function(){}; - - for ( var i = 0; i < 15; i += 1 ) - a.equal(curry.to(i, noop).length, i); - }); - - it('should be curried', function(){ - var sum = function(){ - var nums = [].slice.call(arguments); - var count = 0; - - for ( var i = 0; i < nums.length; i += 1 ) count += nums[i]; - return count; - }; - - var sum3 = curry.to(3)(sum); - a.equal(sum3(1)(2)(3), 6); - }); -}); - -describe('curry.adapt', function(){ - it('should shift the first argument the end', function(){ - var noop = curry.adapt(function(){}); - var cat1 = curry.adapt(function(a){ return a }); - var cat2 = curry.adapt(function(a, b){ return a + b }); - var cat3 = curry.adapt(function(a, b, c){ return a + b + c }); - var cat4 = curry.adapt(function(a, b, c, d){ return a + b + c + d }); - - a.equal(noop(), undefined); - a.equal(cat1('a'), 'a'); - a.equal(cat2('a')('b'), 'ba'); - a.equal(cat3('a', 'b')('c'), 'bca'); - a.equal(cat4('a', 'b')('c', 'd'), 'bcda'); - }); -}); - -describe('curry.adaptTo', function(){ - it('should shift the first argument the end, and curry by a specified amount', function(){ - var cat = function(){ - var args = [].slice.call(arguments); - return args.join(''); - } - - var noop = curry.adaptTo(0)(cat); - var cat1 = curry.adaptTo(1)(cat); - var cat2 = curry.adaptTo(2)(cat); - var cat3 = curry.adaptTo(3)(cat); - var cat4 = curry.adaptTo(4)(cat); - - a.equal(noop(), ''); - a.equal(cat1('a'), 'a'); - a.equal(cat2('a')('b'), 'ba'); - a.equal(cat3('a', 'b')('c'), 'bca'); - a.equal(cat4('a', 'b')('c', 'd'), 'bcda'); - }); -}); diff --git a/src/test/fixtures/yarnWorkspaces/packageA/package.json b/src/test/fixtures/yarnWorkspaces/packageA/package.json index 741a1e2f..fd1302f5 100644 --- a/src/test/fixtures/yarnWorkspaces/packageA/package.json +++ b/src/test/fixtures/yarnWorkspaces/packageA/package.json @@ -6,7 +6,6 @@ "vscode": "*" }, "dependencies": { - "curry": "1.2.0", "filter-obj": "2.0.1" }, "devDependencies": { diff --git a/src/test/fixtures/yarnWorkspaces/yarn.lock b/src/test/fixtures/yarnWorkspaces/yarn.lock index 8dcbbab5..d14b6866 100644 --- a/src/test/fixtures/yarnWorkspaces/yarn.lock +++ b/src/test/fixtures/yarnWorkspaces/yarn.lock @@ -2,11 +2,6 @@ # yarn lockfile v1 -curry@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/curry/-/curry-1.2.0.tgz#9e6dd289548dba7e653d5ae3fe903fe7dfb33af2" - integrity sha1-nm3SiVSNun5lPVrj/pA/59+zOvI= - filter-obj@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-2.0.1.tgz#34d9f0536786f072df7aeac3a8bda1c6e767aec6" diff --git a/src/test/package.test.ts b/src/test/package.test.ts index 9f4b150a..d32ab8c3 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -275,14 +275,6 @@ describe('collect', function () { { path: 'extension/node_modules/package-a/important/prod.log', localPath: path.resolve(root, 'node_modules/package-a/important/prod.log') - }, - { - path: 'extension/node_modules/curry/curry.js', - localPath: path.resolve(root, 'node_modules/curry/curry.js') - }, - { - path: 'extension/node_modules/curry/package.json', - localPath: path.resolve(root, 'node_modules/curry/package.json') } ].forEach(expected => { const found = files.find(f => f.path === expected.path || f.localPath === expected.localPath);