A simple library utilizing the 'are-arrays' and 'are-objects' packages for advanced type validation in JavaScript.
npm install typecheck-utils
const typeCheckUtils = require('typecheck-utils');
const arrayOfObjects = [{ name: "Alice" }, { age: 30 }];
const nestedObject = { data: { key: "value" } };
console.log(typeCheckUtils.isArrayOfObjects(arrayOfObjects)); // true
console.log(typeCheckUtils.isNestedObject(nestedObject)); // true
- isArrayOfObjects(data)
- Returns
true
if the provided data is an array where all elements are objects. - Returns
false
otherwise.
- Returns
- isNestedObject(data)
- Returns
true
if the provided data is an object containing at least one nested object within its values. - Returns
false
otherwise.
- Returns
Contributions and suggestions are welcome! Please open an issue or submit a pull request.
MIT
Let me know if you have any other content you'd like to include in the README!