Comparing version 0.0.2 to 0.0.3
@@ -8,3 +8,3 @@ var fs = require('fs') | ||
figlet.text('Cute v' + pkg.version, {font: 'Small'}, function (e, art) { | ||
var pattern = /^.*\/(projects|workspace|node_modules|lighterio)\/([\d\w-_]+)\//i | ||
var pattern = /^.*\/(projects|modules|workspace|node_modules|lighterio)\/([\d\w-_]+)\//i | ||
var url = 'https://github.com/lighterio/$2/blob/master/' | ||
@@ -55,6 +55,6 @@ var urls = [] | ||
fs.writeFileSync(dir + '/cute.js', asset.getContent()) | ||
asset | ||
.replace(/ +\n/g, '\n') | ||
.write(dir, 'cute.js') | ||
// asset | ||
// .replace(/ +\n/g, '\n') | ||
// .write(dir, 'cute.js') | ||
}) | ||
}) |
33
cute.js
@@ -1,6 +0,6 @@ | ||
/** ___ _ __ __ _ | ||
* / __| _| |_ ___ __ __/ \ / \ / | | ||
* | (_| || | _/ -_) \ V / () | () || | | ||
* \___\_,_|\__\___| \_/ \__(_)__(_)_| | ||
* | ||
/** ___ _ __ __ ____ | ||
* / __| _| |_ ___ __ __/ \ / \ |__ / | ||
* | (_| || | _/ -_) \ V / () | () | |_ \ | ||
* \___\_,_|\__\___| \_/ \__(_)__(_)___/ | ||
* | ||
* http://lighter.io/cute | ||
@@ -35,3 +35,3 @@ * | ||
var Cute = {} | ||
Cute.version = '0.0.1' | ||
Cute.version = '0.0.3' | ||
@@ -79,3 +79,4 @@ /* istanbul ignore next */ | ||
* @param {String} url A URL from which to request a response. | ||
* @param {String} data An optional query, which if provided, makes the request a POST. | ||
* @param {String} data An optional query, which if provided, makes a POST | ||
* request, or if `null` makes a DELETE request. | ||
* @param {Function} fn An optional function which takes (data, status) arguments. | ||
@@ -94,13 +95,11 @@ */ | ||
var text = request.responseText | ||
var data = Cute.parse(text, 0) | ||
var data = Cute.parse(text, data) | ||
fn(data, status) | ||
} | ||
} | ||
var method = data ? 'POST' : 'GET' | ||
var method = data ? 'POST' : Cute.isNull(data) ? 'DELETE' : 'GET' | ||
request.open(method, url, true) | ||
if (data) { | ||
request.setRequestHeader('content-type', 'application/x-www-form-urlencoded') | ||
if (Cute.isObject(data)) { | ||
data = 'json=' + Cute.encode(Cute.stringify(data)) | ||
} | ||
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') | ||
data = Cute.stringify(data) | ||
} | ||
@@ -791,3 +790,3 @@ request.send(data || null) | ||
* | ||
* @param {DOMElement} element An element. | ||
* @param {DOMElement} element An element. | ||
* @param {String} name An attribute name. | ||
@@ -1071,3 +1070,3 @@ * @param {String} value A value to set the attribute to. | ||
if (isMatch) { | ||
fn(eventTarget, type, event) | ||
fn(event.data || eventTarget, event, type) | ||
} | ||
@@ -1134,3 +1133,3 @@ return !event.stop | ||
* | ||
* @param {DOMElement} input A form element. | ||
* @param {DOMElement} input A form element. | ||
* @param {String|Array} newValue An optional new value for the element. | ||
@@ -1788,3 +1787,3 @@ * @return {String|Array} The current or new value. | ||
* @param {Object} object An object to bind a timer to. | ||
* @param (String) name A name for the timer. | ||
* @param {String} name A name for the timer. | ||
* @param {Function} fn A function to run if the timer is reached. | ||
@@ -1791,0 +1790,0 @@ * @param {Integer} delay An optional delay in milliseconds. |
{ | ||
"name": "cute", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Minifier-friendly JavaScript built for speed and power.", | ||
@@ -5,0 +5,0 @@ "dependencies": {}, |
@@ -23,3 +23,4 @@ /** | ||
* @param {String} url A URL from which to request a response. | ||
* @param {String} data An optional query, which if provided, makes the request a POST. | ||
* @param {String} data An optional query, which if provided, makes a POST | ||
* request, or if `null` makes a DELETE request. | ||
* @param {Function} fn An optional function which takes (data, status) arguments. | ||
@@ -38,13 +39,11 @@ */ | ||
var text = request.responseText | ||
var data = Cute.parse(text, 0) | ||
var data = Cute.parse(text, data) | ||
fn(data, status) | ||
} | ||
} | ||
var method = data ? 'POST' : 'GET' | ||
var method = data ? 'POST' : Cute.isNull(data) ? 'DELETE' : 'GET' | ||
request.open(method, url, true) | ||
if (data) { | ||
request.setRequestHeader('content-type', 'application/x-www-form-urlencoded') | ||
if (Cute.isObject(data)) { | ||
data = 'json=' + Cute.encode(Cute.stringify(data)) | ||
} | ||
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') | ||
data = Cute.stringify(data) | ||
} | ||
@@ -51,0 +50,0 @@ request.send(data || null) |
@@ -216,3 +216,3 @@ /** | ||
* | ||
* @param {DOMElement} element An element. | ||
* @param {DOMElement} element An element. | ||
* @param {String} name An attribute name. | ||
@@ -219,0 +219,0 @@ * @param {String} value A value to set the attribute to. |
@@ -119,3 +119,3 @@ /** | ||
if (isMatch) { | ||
fn(eventTarget, type, event) | ||
fn(event.data || eventTarget, event, type) | ||
} | ||
@@ -122,0 +122,0 @@ return !event.stop |
/** | ||
* Get or set the value of a form element. | ||
* | ||
* @param {DOMElement} input A form element. | ||
* @param {DOMElement} input A form element. | ||
* @param {String|Array} newValue An optional new value for the element. | ||
@@ -6,0 +6,0 @@ * @return {String|Array} The current or new value. |
@@ -5,3 +5,3 @@ /** | ||
* @param {Object} object An object to bind a timer to. | ||
* @param (String) name A name for the timer. | ||
* @param {String} name A name for the timer. | ||
* @param {Function} fn A function to run if the timer is reached. | ||
@@ -8,0 +8,0 @@ * @param {Integer} delay An optional delay in milliseconds. |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
128248
38
3920
0