Socket
Book a DemoInstallSign in
Socket

samesame

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

samesame

Simple, Lightweight type checking of multiple arguments

unpublished
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
7
133.33%
Maintainers
1
Weekly downloads
 
Created
Source

samesame

package version package downloads standard-readme compliant package license make a pull request Greenkeeper badge Standard Travis Build

Simple, Lightweight type checking of multiple arguments

Table of Contents

About

This module uses the Object.prototype.toString() method to provide better type checking and supports comparing the types of multiple values.

same same

Install

cdn:

<script src="https://unpkg.com/samesame/lib/samesame.min.js"></script>
<!-- Or -->
<script src="https://rawgit.com/tiaanduplessis/samesame/master/lib/samesame.min.js"></script>

npm or yarn:

$ npm install --save samesame
# OR
$ yarn add samesame

Usage

const samesame = require('samesame')

samesame('They hate us', 'cause they ain\'t us') // true
samesame({}, {}) // true
samesame({}, 'Object') // true
samesame({}, undefined) // false
samesame('foo', 'bar', 'baz') // true
samesame('Boolean', true, false) // true
samesame([], 'Array') // true
samesame(true, 5) // false
samesame(/foo/, 'RegExp') // true
samesame('Function', () => {}) // true

The module exports a single function that can take multiple arguments and returns boolean value.

Supported type strings that can be passed as an argument are:

  • Array
  • Object
  • String
  • Date
  • RegExp
  • Function
  • Boolean
  • Number
  • Null
  • Undefined

Contribute

  • Fork it and create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

License

MIT

Keywords

type

FAQs

Package last updated on 24 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts