Skip to content

Commit

Permalink
improved package pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Jan 21, 2019
1 parent 400289d commit fddb380
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .npmignore
@@ -1,10 +1,12 @@
.idea
flow-typed
.babelrc
babel.config.js
rollup.config.js
coverage
docs
resources
.travis.yml
.jsbeautifyrc
tsconfig.json
test
.vscode
.vscode
types
8 changes: 4 additions & 4 deletions src/utils/console.tsx
@@ -1,23 +1,23 @@
/**
*
*/
import myPackage from '../../package.json'
import { name } from '../../package.json'

let deprecationsSeen: any = {}

const consoleWarn = (...args: any[]) => {
if (typeof console === 'object' && typeof console.warn === 'function') {
if (__DEV__ && typeof console === 'object' && typeof console.warn === 'function') {
console.warn(...args)
}
}

export const deprecate = (msg: any) => {
if (!deprecationsSeen[msg]) {
deprecationsSeen[msg] = true
consoleWarn(`${myPackage.name} | DEPRECATION: ${msg}`)
consoleWarn(`${name} | DEPRECATION: ${msg}`)
}
}

export const warn = (msg: string) => {
consoleWarn(`${myPackage.name} | WARNING: ${msg}`)
consoleWarn(`${name} | WARNING: ${msg}`)
}

0 comments on commit fddb380

Please sign in to comment.