Skip to content

Instantly share code, notes, and snippets.

@boxmein
Created January 24, 2018 16:29
Show Gist options
  • Save boxmein/51948f5634ac2178712f2947c95e4f90 to your computer and use it in GitHub Desktop.
Save boxmein/51948f5634ac2178712f2947c95e4f90 to your computer and use it in GitHub Desktop.
Number parsing bug
#!/bin/bash
~> webpack --env.numerical 5 --env.commitId 12180e3
# outputs { numerical: 5, commitId: 12180000 }
~> webpack --env.numerical 5 --env.commitId "12180e3" [255]
# outputs { numerical: 5, commitId: 12180000 }
~> webpack --env.numerical 5 --env.commitId "12180e3" --env.TEST_STRING test [255]
# { numerical: 5, commitId: 12180000, TEST_STRING: 'test' }
const util = require('util');
module.exports = (env) => console.log(util.inspect(env, { colors: true, showHidden: true }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment