Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurvr committed Feb 18, 2015
0 parents commit 73b9f38
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions .jshintrc
@@ -0,0 +1,13 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"immed": true,
"newcap": true,
"noarg": true,
"undef": true,
"unused": "vars",
"strict": true
}
5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
sudo: false
language: node_js
node_js:
- 'iojs'
- '0.12'
5 changes: 5 additions & 0 deletions index.js
@@ -0,0 +1,5 @@
'use strict';

module.exports = function (o) {
return Object.prototype.toString.call(o) === '[object Map]';
};
21 changes: 21 additions & 0 deletions license
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Arthur Verschaeve

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
29 changes: 29 additions & 0 deletions package.json
@@ -0,0 +1,29 @@
{
"name": "is-map",
"version": "0.0.0",
"description": "Easily check if a givin object is an ES6 Map",
"keywords": [
"map",
"es6",
"esnext",
"harmony",
"typeof",
"type",
"object"
],
"license": "MIT",
"author": "Arthur Verschaeve <contact@arthurverschaeve.be>",
"files": [
"index.js"
],
"repository": "arthurvr/is-map",
"scripts": {
"test": "node test/test.js"
},
"devDependencies": {
"ava": "^0.0.4"
},
"engines": {
"node": ">=0.12.0"
}
}
25 changes: 25 additions & 0 deletions readme.md
@@ -0,0 +1,25 @@
# is-map [![Build Status](https://travis-ci.org/arthurvr/is-map.svg?branch=master)](https://travis-ci.org/arthurvr/is-map)

> Node module to easily check if an object is an [ES6 `Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
## Installation

```
$ npm install is-map --save
```

## Usage

```javascript
var isMap = require('is-map');

isMap(new Map());
//=> true

isMap({});
//=> false
```

## License

MIT © Arthur Verschaeve
10 changes: 10 additions & 0 deletions test/test.js
@@ -0,0 +1,10 @@
'use strict';

var test = require('ava');
var isMap = require('../');

test(function (t) {
t.assert(isMap(new Map()));
t.assert(!isMap(new Set()));
t.assert(!isMap({}));
});

0 comments on commit 73b9f38

Please sign in to comment.