Skip to content

Commit

Permalink
adjustments for using module.exports.default, require(form-urlencoded…
Browse files Browse the repository at this point in the history
…).default
  • Loading branch information
bumblehead committed May 10, 2018
1 parent 6cb626d commit a4406ca
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MITLICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2012-2017 Bumblehead <[email protected]>
Copyright (c) Bumblehead <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ form-urlencoded
Returns 'x-www-form-urlencoded' string data, an encoding often used when an [HTML form is submitted][1]. Form data is serialised in [this format][2] and sent to a server.

```javascript
var formurlencoded = require('form-urlencoded');
var obj = {
const formurlencoded = require('form-urlencoded').default;
const obj = {
str : 'val',
num : 0,
arr : [3, {prop : false}, 1, null, 6],
Expand Down
2 changes: 1 addition & 1 deletion dist/form-urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
// Timestamp: 2017.07.04-19:19:11 (last modified)
// Author(s): Bumblehead (www.bumblehead.com), JBlashill ([email protected]), Jumper423 ([email protected])

module.exports = function (data) {
module.exports.default = function (data) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var sorted = Boolean(opts.sorted),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "form-urlencoded",
"main": "dist/form-urlencoded",
"version": "2.0.4",
"version": "2.0.5",
"description": "Return an object as an 'x-www-form-urlencoded' string",
"author": "Chris <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -46,7 +46,7 @@
"jasmine-spec-reporter": "3.2.0"
},
"scripts": {
"test": "node node_modules/jasmine/bin/jasmine.js --verbose",
"test": "jasmine --verbose",
"start": "./node_modules/babel-cli/bin/babel.js --plugins transform-es2015-unicode-regex --presets es2015 -d dist/ form-urlencoded.js",
"prepare": "npm start && npm test"
}
Expand Down
2 changes: 1 addition & 1 deletion spec/form-urlencoded.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Timestamp: 2017.07.05-02:33:29 (last modified)
// Author(s): bumblehead <[email protected]>

var formurlencoded = require('../');
var formurlencoded = require('../').default;

// tests assume behaviour not given in ecmascript specification,
// object properties accessed in 'order'
Expand Down

0 comments on commit a4406ca

Please sign in to comment.