Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1# SMOB 🧪2 3[](https://badge.fury.io/js/smob)4[](https://github.com/tada5hi/smob/actions/workflows/main.yml)5[](https://codecov.io/gh/tada5hi/smob)6[](https://snyk.io/test/github/Tada5hi/smob?targetFile=package.json)7[](https://github.com/semantic-release/semantic-release)8 9A zero dependency library to **s**afe **m**erge **ob**jects and arrays with customizable behavior.10 11**Table of Contents**12 13- [Installation](#installation)14- [Usage](#usage)15 - [Merger](#merger)16 - [Utils](#utils)17- [License](#license)18 19## Installation20 21```bash22npm install smob --save23```24 25## Usage26 27```typescript28import { merge } from "smob";29 30const output = merge(...sources);31```32 33The following merge options are set by default:34- **array**: `true` Merge object array properties.35- **arrayDistinct**: `false` Remove duplicates, when merging array elements.36- **arrayPriority**: `left` (options.priority) The source aka leftmost array has by **default** the highest priority.37- **clone**: `false` Deep clone input sources.38- **inPlace**: `false` Merge sources in place.39- **priority**: `left` The source aka leftmost object has by **default** the highest priority.40 41The merge behaviour can be changed by creating a custom [merger](#merger).42 43**Arguments**44- sources `(any[] | Record<string, any>)[]`: The source arrays/objects.45 46```typescript47import { merge } from 'smob';48 49merge({ a: 1 }, { b: 2 }, { c: 3 });50// { a: 1, b: 2, c: 3 }51 52merge(['foo'], ['bar']);53// ['foo', 'bar']54 55```56 57### Merger58 59A custom merger can simply be created by using the `createMerger` method.60 61**Array**62```typescript63import { createMerger } from 'smob';64 65const merge = createMerger({ array: false });66 67merge({ a: [1,2,3] }, { a: [4,5,6] });68// { a: [1,2,3] }69```70 71**ArrayDistinct**72```typescript73import { createMerger } from 'smob';74 75const merge = createMerger({ arrayDistinct: true });76 77merge({ a: [1,2,3] }, { a: [3,4,5] });78// { a: [1,2,3,4,5] }79```80 81**Priority**82```typescript83import { createMerger } from 'smob';84 85const merge = createMerger({ priority: 'right' });86 87merge({ a: 1 }, { a: 2 }, { a: 3 })88// { a: 3 }89```90 91**Strategy**92```typescript93import { createMerger } from 'smob';94 95const merge = createMerger({96 strategy: (target, key, value) => {97 if (98 typeof target[key] === 'number' &&99 typeof value === 'number'100 ) {101 target[key] += value;102 return target;103 }104 }105});106 107merge({ a: 1 }, { a: 2 }, { a: 3 });108// { a: 6 }109```110 111A returned value indicates that the strategy has been applied.112 113## Utils114 115### distinctArray116 117```typescript118import { distinctArray } from 'smob';119 120distnctArray(['foo', 'bar', 'foo']);121// ['foo', 'bar']122```123 124The function also removes non-primitive125elements that are identical by value or reference.126 127**Objects**128```typescript129import { distinctArray } from 'smob';130 131distinctArray([{ foo: 'bar' }, { foo: 'bar' }]);132// [{ foo: 'bar' }]133```134 135**Arrays**136```typescript137import { distinctArray } from 'smob';138 139distinctArray([['foo', 'bar'], ['foo', 'bar']]);140// [['foo', 'bar']]141```142 143### isEqual144 145Checks if two (non-primitive) elements146are identical by value or reference.147 148````typescript149import { isEqual } from 'smob';150 151isEqual({foo: 'bar'}, {foo: 'bar'});152// true153 154isEqual(['foo', 'bar'], ['foo', 'bar']);155// true156````157 158## License159 160Made with 💚161 162Published under [MIT License](./LICENSE).163 