+23
| 'hex utf8 ascii binary base64 ucs2 utf16le'.split(/\s+/).forEach(function (encoding) { | ||
| exports[encoding] = { | ||
| encode: function (data) { | ||
| return new Buffer(data, encoding) | ||
| }, | ||
| decode: function (buffer) { | ||
| return buffer.toString(encoding) | ||
| }, | ||
| buffer: true, | ||
| name: encoding | ||
| } | ||
| }) | ||
| exports.json = { | ||
| encode: JSON.stringify, | ||
| decode: JSON.parse, | ||
| buffer: false, | ||
| name: 'json' | ||
| } | ||
| exports['utf-8'] = exports.utf8 | ||
| exports['ucs-2'] = exports.ucs2 | ||
| exports['utf-16le'] = exports.utf16le |
Sorry, the diff of this file is not supported yet
+1
-1
| The MIT License | ||
| Copyright (c) 2013 Alan Gutierrez | ||
| Copyright (c) 2013-2015 Alan Gutierrez | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+4
-4
| { | ||
| "name": "encode", | ||
| "version": "0.0.1", | ||
| "version": "0.0.2", | ||
| "author": "Alan Gutierrez <alan@prettyrobots.com>", | ||
| "description": "Utilities for encoding and decoding records for database storage.", | ||
| "url": "http://bigeasy.github.com/encode", | ||
| "keywords": | ||
@@ -13,3 +12,3 @@ [ | ||
| "contributors": [], | ||
| "homepage": "https://github.com/bigeasy/revise", | ||
| "homepage": "https://bigeasy.github.io/encode", | ||
| "bugs": "https://github.com/bigeasy/encode/issues", | ||
@@ -26,2 +25,3 @@ "licenses": | ||
| }, | ||
| "main": "encode", | ||
| "dependencies": | ||
@@ -32,3 +32,3 @@ { | ||
| { | ||
| "proof": "0.0.36" | ||
| "proof": "0.0.51" | ||
| }, | ||
@@ -35,0 +35,0 @@ "scripts": |
@@ -1,5 +0,7 @@ | ||
| require('proof')(1, function (equal) { | ||
| require('proof')(1, prove) | ||
| function prove (assert) { | ||
| var string = 'abc', encoders = require('../..') | ||
| string = encoders.utf8.decode(encoders.utf8.encode(string)) | ||
| equal(string, 'abc', 'translated') | ||
| }) | ||
| assert(string, 'abc', 'translated') | ||
| } |
-23
| 'hex utf8 ascii binary base64 ucs2 utf16le'.split(/\s+/).forEach(function (encoding) { | ||
| exports[encoding] = { | ||
| encode: function (data) { | ||
| return new Buffer(data, encoding) | ||
| }, | ||
| decode: function (buffer) { | ||
| return buffer.toString(encoding) | ||
| }, | ||
| buffer: true, | ||
| name: encoding | ||
| } | ||
| }) | ||
| exports.json = { | ||
| encode: JSON.stringify, | ||
| decode: JSON.parse, | ||
| buffer: false, | ||
| name: 'json' | ||
| } | ||
| exports['utf-8'] = exports.utf8 | ||
| exports['ucs-2'] = exports.ucs2 | ||
| exports['utf-16le'] = exports.utf16le |
| require('proof')(1, function (ok) { | ||
| ok(require('../..'), 'require') | ||
| }) |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5232
8.66%27
-6.9%2
100%