It's better to fail with your own error than undefined is not a function.
A simple assertion solution would let your application fail early and fail at the right point in runtime execution. Allowing you to handle it better.
| React={Component:function(e){this.props=e},[C="createElement"]:(t,s,...a)=>t.bind?new t(s):(e=document[C](t),(()=>{for(n in s)e[n]=s[n]})(),g(a).map(t=>e[A](t.props?t.render():t.part?t:new Text(t))),e)},g=(e=>(e=e||[],e.map?e.flatMap(g):[e])),A="appendChild" |
| @s | |
| --- dir/bla/yo.py | |
| print("yo") | |
| --- | |
| --- dir/blado.py | |
| print("bla") | |
| --- |
| const fs = require('fs'); | |
| function tree(dir, shortName = dir, prefix = '') { | |
| const ls = fs.readdirSync(dir); | |
| const isDir = ls.map(item => fs.statSync(`${dir}/${item}`).isDirectory()); | |
| const files = ls.filter((item, index) => !isDir[index]); | |
| const dirs = ls.filter((item, index) => isDir[index]); | |
| const filesPrefix = prefix + ' '; | |
| console.log(); | |
| console.log(`${prefix}${shortName || '.'}/`); | |
| if (files.length) { |
| <style id="jsbin-css"> | |
| body { | |
| font: 14px "Century Gothic", Futura, sans-serif; | |
| margin: 20px; | |
| } | |
| ol, ul { | |
| padding-left: 30px; | |
| } |
| var fs = require('fs'), | |
| UglifyJS = require('uglify-js'); | |
| var express = require('express'), | |
| app = express(); | |
| var repo = process.argv[2]; | |
| var html = fs.readFileSync(__dirname + '/' + repo + '/build/index.html').toString(); | |
| var js = UglifyJS.minify(__dirname + '/' + repo + '/build/' + repo + '.bundle.js').code; | |
| //js = fs.readFileSync(__dirname + '/' + repo + '/build/' + repo + '.bundle.js').toString(); | |
| html = html.replace('<script src="' + repo + '.bundle.js"></script>', '<script>' + js + '</script>'); |
| #!/usr/bin/env coffee | |
| fs = require 'fs' | |
| sh = require 'execSync' | |
| config = require './package.json' | |
| name = config.name = "#{config.name}-semver" | |
| version = config.version = config.version.replace(/\./g, '') + '.0.0' |
| var assert = require('assert'), | |
| http = require('http'), | |
| sockets = require('socket.io'), | |
| socketClient = require('socket.io-client'); | |
| describe('Socket.io', function () { | |
| it('should take / as the default namespace', function (done) { | |
| var port = 5001, | |
| io = sockets.listen(port); | |