Releases: shysolocup/stews
Publish Test 0
Publish-Test-0 Update package.json
1.8.3
added try catches to proxies to stop it from crashing from a symbol bug
1.8.2
updated for aepl update
1.8.1
updated class builder to use aepl
1.8.0
- Updated class builders
- Added new Stew.Class() new Soup.Class() and new Noodle.Class()
const { Soup } = require('stews');
new Soup.Class("Leaderboard", class {
constructor(func) {
let parent = this.parent;
if (!func) func = function(a, b) {
return b - a;
}
return parent.sortBy(parent.values, func);
}
});
let thing = new Soup({
player1: 50,
player2: 10,
player3: 100,
});
console.log(new thing.Leaderboard()); // { player3: 100, player1: 50, player2: 10 }
1.7.2
Updated links and installation
1.7.1
Stews 1.7.1 🍲
- added noodle.equalTo()
let nood = new Noodle("abc")
nood.equalTo("a") // false
nood.equalTo("abc") // true
nood.equalTo("a", "abc") // true
1.7.0
STEWS 1.7.0! 🍲
I've waited long enough to release this update and I'm looking forward to actively using it.
I was busy for a while with other projects but I kinda just decided to finish it up and release it because I'm pretty happy with it.
hopefully more updates will come soon because I unfortunately had to remove things like bowls and there may be bugs with noodles
Noodles 🍜
there's an entirely new class called Noodle which is made primarily for strings and string manipulation
it carries over a lot of the functions from stews but also adds some new ones from normal strings
const { Noodle } = require('stews')
var noodle = new Noodle("abc 123") // Noodle { content: "abc 123" }
console.log(noodle.length) // 7
console.log(noodle.wordCount) // 2
console.log(noodle.toUpperCase(0)) // Noodle { content: "Abc 123" }
console.log(noodle.endsWith("abc")) // false
console.log(noodle.endsWith("abc", 123)) // true
noodle.push(" 123")
console.log(noodle.replaceAll("123", "abc")) // Noodle { content: "abc abc abc" }
Misc
- Added optional index arguments to all toUpperCase() and toLowerCase() functions for Stews, Soups, and Noodles
- Removed Bowls possibly for a later update
- Probably fixed another bug with sort()
1.6.6
Stews v1.6.6 🍲
- all sort related functions now return their output instead of just automatically overwriting the original
- fully rewrote sort() and I hopefully shouldn't have to change it again
- added sortBy() so you can use it for things like more efficient leaderboards
- added fetch() as an alternative to get()
- added fetchValue() as a way to get from values
- added trim() to remove unnecessary spaces from keys and values
- added trimKeys() to remove unnecessary spaces from keys
- added trimValues() to remove unnecessary spaces from values
const { Stew, Soup } = require('stews');
// it works the same way for soups to save time I won't do both
let list = new Stew( ["a", "b", "c", "d"] );
let pair = new Stew( {"key0": "value0", "key1": "value1"} );
list.fetch(0); // { value: "a", index: 0 }
list.fetch(1); // { value: "b", index: 1 }
list.fetch("c"); // { value: "c", index: 2 }
pair.fetch(0); // { key: "key0", value: "value0", index: 0 }
pair.fetch(1); // { key: "key1", value: "value1", index: 1 }
pair.fetch("key1"); // { key: "key1", value: "value1", index: 1 }
const { Stew, Soup } = require('stews');
// it works the same way for soups to save time I won't do both
let thing = new Stew({
"user1": 5,
"user2": 50,
"user3": 10
});
thing.sortBy(thing.values); // { 'user1': 5, 'user3': 10, 'user2': 50 }
thing.sortBy(thing.values, (a, b) => { return b - a } ); // { 'user2': 50, 'user3': 10, 'user1': 5 }
1.6.5
I'm an idiot and messed something up lol