Giter Club home page Giter Club logo

is.js's People

Contributors

arasatasaygin avatar battaglr avatar bryant1410 avatar cfj avatar codekhol avatar codemonkey800 avatar erikalim avatar fay-jai avatar fluxsauce avatar fslone-nomi avatar genediazjr avatar guru107 avatar ihopepeace avatar indus avatar ironmaniiith avatar jdalton avatar jonhester avatar jt3k avatar jucrouzet avatar kikobeats avatar mathiasbynens avatar modood avatar mvalim avatar ozsay avatar photostu avatar rproenca avatar ryantemple avatar salihsagdilek avatar weblancaster avatar zekiunal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

is.js's Issues

Environment checks "inconsistency"

Hi,

I was taking a look at the environment checks section of the library, and I've notice that you are lower-casing the User Agent. However, later you perform regexp tests ignoring the case (using the i option), and even not ignoring the case and using uppercase letters, as in the case of Opera, which indeed doesn't work.

Perhaps an easier way to test the browser is just the one in here (which only misses the IE-version check): https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator

I would like taking this opportunity to first thank you for this nice job; but also to let here an idea: having a "builder" that allows you to select only the functions you really need (maybe at a module level), which as far as I've heard is a path that libraries like lodash will sensitively take.

is.chrome(value:number).orLater()

In some of my projects I need to check if a browser has at least a specific version. It would be great if I could use is.js for that purpose.

So I would like to have a function that returns true if a browser version is greater than or equal to a given number. Like: is.ie(8).orLater(). Same goes for other browsers like Chrome, Firefox, etc.

isUTC

hey, in my project i need this everytime. do you think it would fit in your lib? :)

isUTC: function(UTC) {
            var now = new Date();
            if (UTC >= new Date(now.getTime() + now.getTimezoneOffset() * 60000))
                return false;
            else
                return true;
        }

Test is.ip

It will be great if we can validate a IP adress

Implementation of is.undefined?

Hello, there.

Is there a reason you used value === void 0; to check if value is undefined rather than typeof value === 'undefined'?

Thanks for the awesome library, btw.

How to use in node.js

Could anyone tell me how to use this fantastic library in node.js?

When I using:

require ('is'); 

I get the error:

Can not find module 'is_js'

IE10 - navigator.vendor not supported

Still trying to figure out pull requests, until then, my attempt to fix this:

line 523:
var vendor = 'navigator' in window && 'vendor' in navigator && navigator.vendor.toLowerCase() || '';

Method name suggestions for version 1.0.0

Some method names are not as good as it should be. (Thanks to my poor English)
However I don't want to change api so fast. So please list your suggestions on method names here for now:

Name suggestions:

@tbasse suggested here #43 :
is.under() —> is.below()

@colindresj suggested here #23 :
is.setNamespace() —> is.noConflict()

@njenia suggested
is.within(num, min, max) —> is.between(num, min, max)

@Guru107 suggested
is.function() —> is.typeFunction()
is.null() —> is.typeNull()

Alias suggestions:

@justincampbell suggested here #78 :
is.present() as an alias of is.existy()

Ubuntu not being recognized as Linux

Hi,

I think the OS needs some more checks to be determined accurately. In this particular case I've found that Ubuntu is not recognized as a GNU/Linux OS. The navigator.appVersion value is "5.0 (X11)". Typical scripts that perform this task include a forth check to determine if the OS is Unix-like. You can see an example here: http://www.javascripter.net/faq/operatin.htm

Extending is.js with with own checks

I just listed your readme and realized that is not only a great pack of functions but a great API for a new ones. So maybe you will provide some extending function to create something like is.myExtension…?

Accept String Input for number check?

I want to check if a string is in integer or decimal format, is there a way to do this using is.js?

I am using jQuery first:

  if (jQuery.isNumeric(input)) {
    input = Number(input);
  }

And then use is.js:

  if (is.integer(input)) {
    ...
  } else if (is.decimal(input)) {
    ...
  }

Issue when requiring is.js with webpack

Just came across a weird issue when trying to require is.js when using the module bundler webpack. In JavaScript I do:

var is = require("is_js");

When using webpack this causes webpack to freak out and give an error message like this:

ERROR in ./~/is_js/is.js
Module not found: Error: Cannot resolve module 'is' in C:\jonrh\isjs-webpack-bugExample\node_modules\is_js
 @ ./~/is_js/is.js 8:8-13:10

I'm not entirely sure where the fault is but I suspect it has something to do with is.js and AMD module loading. Maybe even webpack.

I created a repository with some sample code and documentation to reproduce this issue. Included in the repository is a very hacky way to prevent this issue.

npm package?

Hi,

Is there a npm package?

Thanks for this library!

Best regards,
Louis

Make is.js compatible with 'use strict'

The library is not using 'use strict' at the moment. As a consequence it breaks when concatenated with strict mode code. It could be nice to make it compatible, they are not many triggered errors (1)

line 28

    var root = this || global; // global is undefined

should become something like:

    var root = (typeof global !== 'undefined' && (typeof window === 'undefined' || window === global.window)) ? global : window;

Is it possible to add it in angularjs?

I wonder if it can be implemented in angular js eg:

angular.controller('Ctrl', ['$scope', '$isJs', function($scope, $isJs){
 if($scope.someModel.is.Something()) {
  doSomething; 
 }
}]);

is.space - text is all white space characters

i tried to check if a the given value is all white space characters.
is.space('      ') is currently returning false
i think, it should return true
or
implementation another new method called is.whitespace

Under is not the opposite of Above

First of all, excuse me in advance if I'm very picky here but the naming of the is.above() and is.under() methods are really bothering me. It really should be above/below or over/under but definitely not abover/under :)

Maybe just rename is.under() to is.below() and alias those methods to is.over() and is.under().

Again, I might be very picky here but the current naming just looks very odd.

typeof NaN is 'number'

// is a given value number?
is.number = function(value) {
    return toString.call(value) === '[object Number]';
};

should be
is.number = function(value) {
return toString.call(value) === '[object Number]' && !isNaN(value);
};
???

FEATURE - can you add an 'is.inArray()' check?

For example if I have an item and I want to check to see if it's in an array I have:

is.inArray([1, 2, 3, 4, 5, 6], 2);
=> true

is.not.inArray([1, 2, 3, 4, 5, 6], 10);
=> true

Theoretically you could also do 'is.inObject()' or even 'is.inString()'.

make it JSHint friendly

any chance we could make this jshint friendly? is.function will prompt usage of a reserved word.

why is.js require itself

why is.js require itself.

if(typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['is'], function(is) {
        // Also create a global in case some scripts
        // that are loaded still are looking for
        // a global even when an AMD loader is in use.
        return (root.is = factory(is));
    });
} else if(typeof exports === 'object') {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like enviroments that support module.exports,
    // like Node.
    module.exports = factory(require('is_js'));
} else {
    // Browser globals (root is window)
    root.is = factory(root.is);
}

Support version numbers for all browsers

Hi, thanks for your great library!

I just read your documentation and found that you support checks for specific Internet Explorer versions with is.ie(value:number). I was wondering why don't support the same thing for Firefox, Chrome, etc. like is.chrome(value:number)?

To be consistent and because it is helpful I suggest to add the version checks for all browsers as version checks become more and more important with the evolvement of new HTML5 features.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.