Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Refactor all the things #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Claudio-test.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test

}
],
"settings": {
"codestream.team": "Team CodeStream"
}
}
6 changes: 6 additions & 0 deletions shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class Rectangle {
}
}

class CircleGetsTheSquare {
Copy link

@dsellarsnr dsellarsnr Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test comment that is very long and will need to be wrapped or truncated so i can see how that works in the UI yay almost done ok i think that is enough

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test comment with relative path link HOWDY!

constructor(circumference, radius) {
this.circumference = circumference
this.radius = radius
}

class Square extends Rectangle {
constructor(x) {
super(x, x)
Expand Down
64 changes: 63 additions & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,41 @@ _.min = function(obj, iteratee, context) {
lastComputed = Infinity,
value,
computed;

n = Math.max(Math.min(n, length), 0);
var last = length - 1;
for (var index = 0; index < n; index++) {
var rand = _.random(index, last);
var temp = sample[index];
sample[index] = sample[rand];
sample[rand] = temp;
}
return sample.slice(0, n);
};

_.sortBy = function(obj, iteratee, context) {
var index = 0;




iteratee = cb(iteratee, context);
return _.pluck(
_.map(obj, function(value, key, list) {





if (
iteratee == null ||

(typeof iteratee == "number" && typeof obj[0] != "object" && obj != null)
) {
obj = isArrayLike(obj) ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
Reset);
if (value != null && value < result) {
result = value;
}
Expand All @@ -19,17 +47,40 @@ _.min = function(obj, iteratee, context) {
_.each(obj, function(v, index, list) {
computed = iteratee(v, index, list);
if (computed < lastComputed || (computed === Infinity && result === Infinity)) {


result = v;

lastComputed = computed;
}
});
}
return result;
};

_.sampleThis = function(obj, n, guard) {
if (n == null || guard) {
if (!isArrayLike(obj)) obj = _.values(obj);
return obj[_.random(obj.length - 1)];
}
var sample = isArrayLike(obj) ? _.clone(obj) : _.values(obj);
var length = getLength(sample);


n = Math.max(Math.min(n, length), 0);
var last = length - 1;
for (var index = 0; index < n; index++) {
var rand = _.random(index, last);
var temp = sample[index];
sample[index] = sample[rand];
sample[rand] = temp;
}
return sample.slice(0, n);
};

_.shuffle = function(obj) {
return _.sample(obj, Infinity);
};
}

_.sample = function(obj, n, guard) {
if (n == null || guard) {
Expand All @@ -38,6 +89,8 @@ _.sample = function(obj, n, guard) {
}
var sample = isArrayLike(obj) ? _.clone(obj) : _.values(obj);
var length = getLength(sample);


n = Math.max(Math.min(n, length), 0);
var last = length - 1;
for (var index = 0; index < n; index++) {
Expand All @@ -51,16 +104,25 @@ _.sample = function(obj, n, guard) {

_.sortBy = function(obj, iteratee, context) {
var index = 0;




iteratee = cb(iteratee, context);
return _.pluck(
_.map(obj, function(value, key, list) {
return {


value: value,
index: index++,
criteria: iteratee(value, key, list)
};


}).sort(function(left, right) {
var a = left.criteria;

var b = right.criteria;
if (a !== b) {
if (a > b || a === void 0) return 1;
Expand Down