Toshihiko Base Adapter is a TypeScript library for extending object properties and providing basic database adapter functionalities.
Install the package using npm:
npm install --save @toshihiko/base-adapterThe extend function is used to extend the properties of an object.
import { extend } from '@toshihiko/base-adapter';
const defaultOptions = { a: 1, b: { c: 2 } };
const options = { b: { d: 3 }, e: 4 };
const result = extend(defaultOptions, options);
console.log(result);
// Output: { a: 1, b: { c: 2, d: 3 }, e: 4 }The Adapter class provides basic database adapter functionalities.
import { Adapter, AdapterOptions } from '@toshihiko/base-adapter';
const options = { key: 'value' };
const adapter = new Adapter<{ key: string }>(options);
adapter.find({}, {}).catch(err => console.error(err.message));
// Output: this adapter's find function is not implemented yet.Feel free to submit issues and pull requests to improve this project.
This project is licensed under the MIT License. See the LICENSE file for details.