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

typecodes

v2.1.2

Published

Basically the closest type evaluation system for the basic types the JavaScript language supports.

Downloads

17

Readme

Concept

Basically the closest type evaluation system for the basic types the JavaScript language supports.

The first thing is type comparison should be an INT comparison. I don't like string comparison's for types. It may make readable code but it is inefficient.

Get running as library and testing as a library first.

Get tests running in 4 browsers...then travis it then publish it...

Badges

Coveralls

Coverage Status

Circle CI Build

CircleCI

npm Version

npm version

npm big badge

NPM

Interface

CODES = {
  BOOLEAN: 0,
  NUMBER: 1,
  STRING: 2,
  FUNCTION: 3,
  OBJECT: 4,
  UNDEFINED: 5,
  NULL: 6,
  DATE: 7,
  ARRAY: 8,
  UNMAPPED: 9
};

get(value);
// var code = tc.getTypeCode('this data');

is(value, typecode);
// if (tc.isTypeOF(13, tc.CODES.NUMBER))

validateFunction(value, paramCount)
// if (tc.validateFunction(callback, 2)) {
//   callback(this, 'success');
// }
compare(objectOne, objectTWo, options)

isFloat(value)

// merges two objects with Object.assign on the lowest level.
deepAssign(objectOne, objectTwo)

Status

12/4/2018

Cleanuped tests simplified interface.

later we tried to derive from number so toString would return what the typecode is.. but failed and exposed anothe method not quite tested.

12/28/2018

tried instanceof then debugger would not load scripts...

3/30/2019

Cleaned up a little of karma running but it is still not running the tests in karma. the its are not being fired..

6/8/2019

migrated tests to jasmine Karma got building on circle ci.

7/18/2019

trying to debug coverals and circleci Integration. https://www.google.com/search?ei=VxgxXd_ROMqIggfg4p7gBQ&q=coveralls+circleci+javascript&oq=coveralls+circleci+javascript&gs_l=psy-ab.3...128423.135198..135406...2.0..0.107.1142.12j3......0....1..gws-wiz.......0i71j0i22i30j33i299j33i160j33i10i160j33i10..11%3A1j12%3A7j13%3A0.x1T24yxQqVM&ved=0ahUKEwif2c6N5r_jAhVKhOAKHWCxB1wQ4dUDCAo&uact=5

This looks like it only does travis https://github.com/nickmerwin/node-coveralls

Maybe we should migrate to jest because it seems to make it easier.

jest --coverage --coverageReporters=text-lcov | coveralls

Or maybe we can read jest and steal what it does to perform coverage.

10/02/2018

Got coveralls working. Need to check in readme. Adding line for requirejs.