npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bytepushers-js-obj-extensions

v0.0.13

Published

A collection of core object extensions and general utilities that can be used as base foundational classes.

Downloads

8

Readme

bytepushers-js-obj-extensions

Byte Pushers Object Extensions JavaScript library that supports core object extensions and general utilities that can be used as base fundamental classes.

Installation

npm install bytepushers-js-obj-extensions

Synopsis

Byte Pushers Object Extensions JavaScript library that supports common object extensions and general utilities that can be used as base fundamental classes. This module will be able to decipher and validate code from arrays to be able to tell whether a function is a constructor. This will show you how to use all code

Code Example

In the following code example, we call Object.isArray() method to determine if the array literal passed to this method is an array or not:

var result = Object.isArray([1, 3, 45, "d"]); // result ==> true

In the following code example, we call Object.isArray() method to determine if the object literal passed to this method is an array or not:

var obj = {};
var result = Object.isArray(obj); // result ==> false

In the following code example, we call Object.isString() method to determine if the string literal passed to this method is a string or not:

//string
var result = Object.isString("some string"); // result ==> true

In the following code example, we call Object.isString() method to determine if the numeric literal passed to this method is a string or not:

//string
var result = Object.isString(100); // result ==> false

The same injection method is used in all of the functions to test. Be in mind that these are all either static convenience functions or static functions. The trend of injecting your code as a parameter is followed throughout all of the function.

Motivation

The motivation behind the creation of the software.bytepushers.object.extensions.js is to create pre-made test for your code. This can be a time saver by keeping you away from "console.log()". The test ran will give you true or false for all code so you will quickly be able to tell whether the specified code is defined as expected.

| Testable Objects | | |:--------------------------|:---------------------------| |Arrays | Gets Properties | |Dates | Sets Properties | |Strings | Has Properties | |Numerics | Has Function | |Booleans | Functions | |Defined | Constructors | |Regular Expressions | Defined & not null or null |

API Reference

| Function Named | Function Description | |:----------------------------------|:------------------------------------------------------------------------| | Object.isArray(someArrayObject) |Static function that tells you whether someArrayObject is an array. Returns true if someArrayObject is an array; otherwise returns false.| | Object.isDate(someDateObject) |Static function that tells you whether someDateObject is a date or not. Returns true if someDateObject is an array; otherwise returns false. | | Object.isString(someStringObject) |Static function that tells you whether someStringObject is a string or not. Returns true if someString is an array; otherwise returns false. | | Object.isNumeric(someNumericObject) |Static function that tells you whether someNumericObject is numeric or not. Returns true if someNumericObject is an array; otherwise returns false. | | Object.isBoolean(someBooleanObject) |Static function that tells you whether someBooleanObject is a boolean or not. Returns true if someBooleanObject is an array; otherwise returns false. | | Object.isDefined(someDefinedObject) |Static function that tells you whether someDefinedObject is defined or not. Returns true if someDefinedObject is an array; otherwise returns false. | | Object.isRegEx(someRegExObject) |Static function that tells you whether someRegExObject is defined or not. Returns true if someRegExObject is an array; otherwise returns false. | | Object.getProperty(somePropertyObject) |Static function that tells you whether somePropertyObject is caught or not. Returns true if somePropertyObject is an array; otherwise returns false. | | Object.setProperty(somePropertyObject) |Static function that tells you whether somePropertyObject is set or not. Returns true if somePropertyObject is an array; otherwise returns false. | | Object.hasProperty(somePropertyObject) |Static function that tells you whether somePropertyObject is defined or not. Returns true if somePropertyObject is an array; otherwise returns false. | | Object.hasFunction(someFunctionObject) |Static function that tells you whether someFunctionObject is found or not. Returns true if someFunctionObject is an array; otherwise returns false. | | Object.isFunction(someFunctionObject) |Static function that tells you whether someFunctionObject is defined or not. Returns true if someFunctionObject is an array; otherwise returns false. | | Object.isConstructorFunction(someConstructor) |Static function that tells you whether someConstructor is defined as a constructor. Returns true if someConstructor is an array; otherwise returns false. | | Object.isDefinedAndNotNull(someObject) |Static convenience function that determines whether an object is defined and not null. | | Object.isUndefinedOrNull(someObject) |Static convenience function that determines whether an object is undefined or null. |