Skip to content

Instantly share code, notes, and snippets.

View gentlefox's full-sized avatar

Greg Arnott gentlefox

View GitHub Profile
@gentlefox
gentlefox / Utils.js
Created July 23, 2019 05:36 — forked from jirwong/Utils.js
Utils.js
const Utils = {};
/**
Verifies that a value is `null` or `undefined`, an empty string, or an empty
array.
Constrains the rules on `isNone` by returning true for empty strings and
empty arrays.
If the value is an object with a `size` property of type number, it is used
to check emptiness.
```javascript
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
// This is not some kind of polyfill! It's just to prevent old browsers from failing horribly
var fallback = function() {};
var methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'profile', 'profileEnd', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn', 'table'];
if(typeof console === 'undefined') {
var console = {};
}
for(var i in methods) {