Skip to content

AliBasicCoder/string-any

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string-any

Codacy Badge npm GitHub npm bundle size

string-any is a package to convert any object to a string and not [object Object]

Usage

const { toStr } = require('string-any');

// objects
toStr(
  {
    name: "name",
    id: 32918,
    randomThing: {
      dwq: "hello"
    },
    func: () => "hello"
  }
);
// => "{
// =>   name: "name",
// =>   id: 32918,
// =>   randomThing: {
// =>      dwq: "hello"
// =>   },
// =>   func: () => "hello"
// => }"

// functions
toStr(() => {}) // => "() => {}"

// numbers
toStr(10) // => "10"

// Strings
toStr("hello") // => '"hello"'

// String Objects
toStr(new String("hello")) // => "hello"

// Arrays
toStr([1,2,3]) // => "[1, 2, 3]"

LICENSE

MIT License

Copyright (c) 2019 AliBasicCoder

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published