diff --git a/dist/helpers.js b/dist/helpers.js index 5f92884..11ad662 100644 --- a/dist/helpers.js +++ b/dist/helpers.js @@ -152,6 +152,6 @@ var flatten = (function (_flatten) { exports.flatten = flatten; var removeSymbols = function removeSymbols(string) { - return string.replace(/\W/g, ''); + return string.toString().replace(/\W/g, ''); }; exports.removeSymbols = removeSymbols; \ No newline at end of file diff --git a/npm-debug.log b/npm-debug.log index 6de215d..fa21c44 100644 --- a/npm-debug.log +++ b/npm-debug.log @@ -12,21 +12,21 @@ 8 silly cache add rawSpec: '.', 8 silly cache add spec: '/Users/mahdi/Documents/Workshop/equation', 8 silly cache add type: 'directory' } -9 verbose addLocalDirectory /Users/mahdi/.npm/equations/1.0.0/package.tgz not in flight; packing -10 verbose tar pack [ '/Users/mahdi/.npm/equations/1.0.0/package.tgz', +9 verbose addLocalDirectory /Users/mahdi/.npm/equations/1.0.1/package.tgz not in flight; packing +10 verbose tar pack [ '/Users/mahdi/.npm/equations/1.0.1/package.tgz', 10 verbose tar pack '/Users/mahdi/Documents/Workshop/equation' ] -11 verbose tarball /Users/mahdi/.npm/equations/1.0.0/package.tgz +11 verbose tarball /Users/mahdi/.npm/equations/1.0.1/package.tgz 12 verbose folder /Users/mahdi/Documents/Workshop/equation -13 info prepublish equations@1.0.0 -14 verbose addLocalTarball adding from inside cache /Users/mahdi/.npm/equations/1.0.0/package.tgz -15 silly cache afterAdd equations@1.0.0 -16 verbose afterAdd /Users/mahdi/.npm/equations/1.0.0/package/package.json not in flight; writing -17 verbose afterAdd /Users/mahdi/.npm/equations/1.0.0/package/package.json written +13 info prepublish equations@1.0.1 +14 verbose addLocalTarball adding from inside cache /Users/mahdi/.npm/equations/1.0.1/package.tgz +15 silly cache afterAdd equations@1.0.1 +16 verbose afterAdd /Users/mahdi/.npm/equations/1.0.1/package/package.json not in flight; writing +17 verbose afterAdd /Users/mahdi/.npm/equations/1.0.1/package/package.json written 18 silly publish { name: 'equations', -18 silly publish version: '1.0.0', +18 silly publish version: '1.0.1', 18 silly publish description: 'Equation ======== Solve math expressions or create equations for repeated and complex Math tasks.', 18 silly publish main: 'dist/index.js', -18 silly publish directories: { test: 'tests' }, +18 silly publish directories: { test: 'dist/tests' }, 18 silly publish scripts: { test: 'grunt test' }, 18 silly publish keywords: [ 'Math', 'JavaScript' ], 18 silly publish author: { name: 'Mahdi Dibaiee' }, @@ -41,41 +41,41 @@ 18 silly publish 'grunt-eslint': '^11.0.0', 18 silly publish 'grunt-mocha-test': '^0.12.7', 18 silly publish mocha: '^2.2.4' }, -18 silly publish readme: 'Equation\n========\nSolve math expressions or create equations for repeated and complex Math tasks.\n\nTo use in browser, download [`equation.min.js`](https://raw.githubusercontent.com/mdibaiee/Equation.js/master/equation.min.js).\n\nInstall using npm:\n\n```\nnpm install equations\n```\n\n####Examples:\n\n```javascript\n// solve\nconsole.log(Equation.solve(\'4 * lg(4) ^ 3\')); // 32\n\n// equation\nlet sphereArea = Equation.equation(\'4 * PI * r^2\');\n\nconsole.log(sphereArea(5)); // 314.1592653589793\n```\n\nYou can also register your own operators and constants.\n\n```javascript\n// these options are explained below\nEquation.registerOperator(\'$\', {\n fn: a => 1/a,\n format: \'10\',\n precedence: 2\n});\n\nEquation.solve(\'$2\'); // 0.5\nEquation.solve(\'$5\'); // 0.2\n\nEquation.registerConstant(\'N\', () => {\n return Math.random() * 10 + 10\n});\n\nEquation.solve(\'N\'); // a number between 10 and 20\n```\n\nAPI\n===\n####solve(expression: String)\nTakes a math expression and evaluates it, returning the result.\n\n####equation(expression: String)\nTakes a math expression containing variables, returning a function which\nreplaces the variables with given arguments, and solves the expression.\n\n####registerOperator(key: String, options: Object)\nRegisters a new operator.\n\nOptions:\n\n#####fn\n The function which is run on arguments and returns the result\n#####format\n The format which specifies how arguments are placed relative to operator, this is a string in which 1 represents the operator and zeroes represent arguments.\n\n For example `+` has the format `010` and factorial has `01`.\n#####precedence\n Specifies the precedence of operator. The less the value, the higher the precedence, resulting in sooner execution.\n\n####registerConstant(key: String, value: Function/Number)\nRegisters a new constant. value can be a function (takes no arguments), or a constant number.\n\nThat\'s right, we have named these *constants* but they actually can change, that\'s why we can use functions to define them. An example is the `RAND` constant which calls `Math.random`.\n\nContributing\n============\nThe code is commented and I hope you don\'t have a hard time contributing,\nanyway, some tips about contributing:\n\nThe source code is in `lib` directory and is then transpiled into `dist`.\n\n#####Grunt Tasks\n######default\nTranspiles `lib` to `dist`\n######build\nTranspiles, browserifies, uglifies\n######eslint\nRuns ESLint on `lib` and `tests`\n######test\nRuns the tests\n\n---\nPlease make sure to run `grunt eslint` before commiting.\n\nIf you\'re adding something new, please add a test, too.\n\nTODO\n====\n* Equation solver\n* More tests\n', +18 silly publish readme: 'Equation\n========\nSolve math expressions or create equations for repeated and complex Math tasks.\n\nTo use in browser, download [`equation.min.js`](https://raw.githubusercontent.com/mdibaiee/Equation.js/master/equation.min.js).\n\nInstall using npm:\n\n```\nnpm install equations\n```\n\n####Examples:\n\n```javascript\n// solve\nconsole.log(Equation.solve(\'4 * lg(4) ^ 3\')); // 32\n\n// equation\nlet sphereArea = Equation.equation(\'4 * PI * r^2\');\n\nconsole.log(sphereArea(5)); // 314.1592653589793\n```\n\nYou can also register your own operators and constants.\n\n```javascript\n// these options are explained below\nEquation.registerOperator(\'$\', {\n fn: a => 1/a,\n format: \'10\',\n precedence: 2\n});\n\nEquation.solve(\'$2\'); // 0.5\nEquation.solve(\'$5\'); // 0.2\n\nEquation.registerConstant(\'N\', () => {\n return Math.random() * 10 + 10\n});\n\nEquation.solve(\'N\'); // a number between 10 and 20\n```\n\nFor a list of operators and constants see `[operators.js](https://github.com/mdibaiee/Equation.js/blob/master/lib/operators.js)` and `[constants.js](https://github.com/mdibaiee/Equation.js/blob/master/lib/constants.js)`.\n\nAPI\n===\n####solve(expression: String)\nTakes a math expression and evaluates it, returning the result.\n\n####equation(expression: String)\nTakes a math expression containing variables, returning a function which\nreplaces the variables with given arguments, and solves the expression.\n\n####registerOperator(key: String, options: Object)\nRegisters a new operator.\n\nOptions:\n\n#####fn\n The function which is run on arguments and returns the result\n#####format\n The format which specifies how arguments are placed relative to operator, this is a string in which 1 represents the operator and zeroes represent arguments.\n\n For example `+` has the format `010` and factorial has `01`.\n#####precedence\n Specifies the precedence of operator. The less the value, the higher the precedence, resulting in sooner execution.\n\n####registerConstant(key: String, value: Function/Number)\nRegisters a new constant. value can be a function (takes no arguments), or a constant number.\n\nThat\'s right, we have named these *constants* but they actually can change, that\'s why we can use functions to define them. An example is the `RAND` constant which calls `Math.random`.\n\nContributing\n============\nThe code is commented and I hope you don\'t have a hard time contributing,\nanyway, some tips about contributing:\n\nThe source code is in `lib` directory and is then transpiled into `dist`.\n\n#####Grunt Tasks\n######default\nTranspiles `lib` to `dist`\n######build\nTranspiles, browserifies, uglifies\n######eslint\nRuns ESLint on `lib` and `tests`\n######test\nRuns the tests\n\n---\nPlease make sure to run `grunt eslint` before commiting.\n\nIf you\'re adding something new, please add a test, too.\n', 18 silly publish readmeFilename: 'README.md', -18 silly publish gitHead: 'b08841e51b4aa34cb11edaa9a19e6983dda53bff', -18 silly publish _id: 'equations@1.0.0', -18 silly publish _shasum: '56ad9f9971b9af509e9997f5907922b792e4b2a5', +18 silly publish gitHead: '0970f7eb2bfcad4c474f50616cb49430b3f5fc6d', +18 silly publish _id: 'equations@1.0.1', +18 silly publish _shasum: '16a7f64cfbb8232d8babeee9419029def2aa6f44', 18 silly publish _from: '.' } 19 silly mapToRegistry name equations 20 silly mapToRegistry using default registry 21 silly mapToRegistry registry https://registry.npmjs.org/ 22 silly mapToRegistry uri https://registry.npmjs.org/equations 23 verbose publish registryBase https://registry.npmjs.org/ -24 silly publish uploading /Users/mahdi/.npm/equations/1.0.0/package.tgz +24 silly publish uploading /Users/mahdi/.npm/equations/1.0.1/package.tgz 25 verbose request uri https://registry.npmjs.org/equations 26 verbose request sending authorization for write operation -27 info attempt registry request try #1 at 14:49:13 +27 info attempt registry request try #1 at 17:00:50 28 verbose request using bearer token for auth -29 verbose request id 87deb4516c1b4c02 +29 verbose request id cee8b60a55a1f3ce 30 http request PUT https://registry.npmjs.org/equations 31 http 403 https://registry.npmjs.org/equations -32 verbose headers { date: 'Tue, 21 Apr 2015 10:19:05 GMT', +32 verbose headers { date: 'Tue, 21 Apr 2015 12:30:43 GMT', 32 verbose headers server: 'Apache', 32 verbose headers 'content-type': 'application/json', 32 verbose headers 'cache-control': 'max-age=60', 32 verbose headers 'content-length': '95', 32 verbose headers 'accept-ranges': 'bytes', 32 verbose headers via: '1.1 varnish', -32 verbose headers 'x-served-by': 'cache-iad2126-IAD', +32 verbose headers 'x-served-by': 'cache-fra1246-FRA', 32 verbose headers 'x-cache': 'MISS', 32 verbose headers 'x-cache-hits': '0', -32 verbose headers 'x-timer': 'S1429611545.135478,VS0,VE364', +32 verbose headers 'x-timer': 'S1429619442.117266,VS0,VE919', 32 verbose headers 'keep-alive': 'timeout=10, max=50', 32 verbose headers connection: 'Keep-Alive' } 33 verbose request invalidating /Users/mahdi/.npm/registry.npmjs.org/equations on PUT 34 error publish Failed PUT 403 -35 verbose stack Error: "You cannot publish over the previously published version 1.0.0." : equations +35 verbose stack Error: "You cannot publish over the previously published version 1.0.1." : equations 35 verbose stack at CachingRegistryClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:254:14) 35 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:178:14) 35 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:344:22) @@ -94,7 +94,7 @@ 41 error node v0.12.0 42 error npm v2.5.1 43 error code E403 -44 error "You cannot publish over the previously published version 1.0.0." : equations +44 error "You cannot publish over the previously published version 1.0.1." : equations 45 error If you need help, you may report this error at: 45 error 46 verbose exit [ 1, true ] diff --git a/package.json b/package.json index f603f2f..63992b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "equations", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "dist/index.js", "directories": {