Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "toSrc", | ||
"description": "Turns every JavaScript object or primitive into valid source code.", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"homepage": "http://jhnns.github.com/toSrc", | ||
@@ -23,8 +23,5 @@ "repository": { | ||
"devDependencies": {}, | ||
"engines": { | ||
"node": "< 0.9.x" | ||
}, | ||
"scripts": { | ||
"test": "node test/test.js" | ||
} | ||
} | ||
} |
@@ -10,4 +10,2 @@ **toSrc** [![Build Status](https://secure.travis-ci.org/jhnns/toSrc.png?branch=master)](http://travis-ci.org/jhnns/toSrc) | ||
Works with node.js (tested) or in the browser (not tested) | ||
<br /> | ||
@@ -32,2 +30,4 @@ | ||
toSrc(true); // = 'true' | ||
toSrc(undefined); // = 'undefined' | ||
tOSrc(null); // = null | ||
toSrc("1"); // = '"1"' | ||
@@ -89,8 +89,12 @@ toSrc('1'); // = '"1"' toSrc always uses double-quotes | ||
API | ||
----- | ||
**toSrc(***obj*, *depth***)** | ||
- *{ * } obj*:<br /> | ||
###toSrc(obj: *, depth: Number): String | ||
- *obj*: <br/> | ||
The object to stringify. Can also be a primitive like `1` or `true`. | ||
- *{Number=1} depth*:<br /> | ||
@@ -123,3 +127,3 @@ The depth to go. All nested structures like objects or arrays deeper than this will be undefined. Defaults to 1, meaning that every object or array within `obj` will be undefined by default. | ||
* All dates are restored to their original time of creation, e.g.: `toSrc(new Date()) // = 'new Date(<time of creation in ms>)'` | ||
* Dynamic regular expressions created via `new RegExp()` will **not** be dynamic anymore. `toSrc(new RegExp(someString))` will return `'/<value of someString>/'` instead of `'new RegExp(someString)' | ||
* Dynamic regular expressions created via `new RegExp()` will **not** be dynamic anymore. `toSrc(new RegExp(someString))` will return `'/<value of someString>/'` instead of `'new RegExp(someString)'` | ||
@@ -133,23 +137,2 @@ Feel free to modify the code to meet your needs. | ||
(The MIT License) | ||
Copyright (c) 2012 Johannes Ewald <mail@johannesewald.de> | ||
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 the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
MIT |
@@ -178,3 +178,2 @@ ////////////////////////////////////////////////////////////////////////////////// | ||
console.log("Everything ok"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
22558
9
0
134