vansak
v0.0.3
Published
filter character, find duplicate object in array by any key
Downloads
6
Maintainers
Readme
npm i vansak
import vansak from "vansak";
const {
filter: { chineseFilter, khmerFilter, zhuyinFilter, pinyinFilter },
} = vansak;
console.log(chineseFilter("你好|សួរស្តី|ㄋㄧ ˇ ㄏㄠ ˇ|nǐhǎo")); // 你好
console.log(khmerFilter("你好|សួរស្តី|ㄋㄧ ˇ ㄏㄠ ˇ|nǐhǎo")); // សួរស្តី
console.log(zhuyinFilter("你好|សួរស្តី|ㄋㄧ ˇ ㄏㄠ ˇ|nǐhǎo")); // nǐhǎo
console.log(pinyinFilter("你好|សួរស្តី|ㄋㄧ ˇ ㄏㄠ ˇ|nǐhǎo")); // ㄋㄧˇ ㄏㄠˇ
import vansak from "vansak";
const {
array: { uniqe, sort },
} = vansak;
const users = [
{ name: "jonh doe", age: 56 },
{ name: "vansak", age: 25 },
{ name: "jonh doe", age: 25 },
];
console.log(uniqe(users, "name"));
// {
// uniqe: [
// { name: "jonh doe", age: 56 },
// { name: "vansak", age: 25 },
// ],
// dupicate: [{ name: "jonh doe", age: 25 }],
// }
console.log(soort(users, "age", "desc"));
// [
// { name: 'jonh doe', age: 56 },
// { name: 'jonh doe', age: 25 },
// { name: 'vansak', age: 25 }
// ]