Permalink
Browse files

Improve relative requires and add is browser mapping

  • Loading branch information...
1 parent 83d53ef commit b047014fb7ecaf09c06d2002ff68e98b53d9c79d @creationix creationix committed May 10, 2013
Showing with 16 additions and 11 deletions.
  1. +9 −9 index.js
  2. +1 −0 package.json
  3. +4 −0 test/is.js
  4. +1 −1 typedarray/read.js
  5. +1 −1 typedarray/write.js
View
@@ -1,16 +1,16 @@
var proto = {}
module.exports = proto
-proto.from = require('./from')
-proto.to = require('./to')
-proto.is = require('./is')
-proto.subarray = require('./subarray')
-proto.join = require('./join')
-proto.copy = require('./copy')
-proto.create = require('./create')
+proto.from = require('./from.js')
+proto.to = require('./to.js')
+proto.is = require('./is.js')
+proto.subarray = require('./subarray.js')
+proto.join = require('./join.js')
+proto.copy = require('./copy.js')
+proto.create = require('./create.js')
-mix(require('./read'), proto)
-mix(require('./write'), proto)
+mix(require('./read.js'), proto)
+mix(require('./write.js'), proto)
function mix(from, into) {
for(var key in from) {
View
@@ -15,6 +15,7 @@
"./read.js": "./typedarray/read.js",
"./subarray.js": "./typedarray/subarray.js",
"./to.js": "./typedarray/to.js",
+ "./is.js": "./typedarray/is.js",
"./write.js": "./typedarray/write.js"
},
"repository": {
View
@@ -4,8 +4,12 @@ var test = require('tape')
test('is works', function(assert) {
var yes = binary.from("Hello")
, no = "World"
+ , never = { weird: true }
+ , noway = [ 42 ]
assert.equal(binary.is(yes), true)
assert.equal(binary.is(no), false)
+ assert.equal(binary.is(never), false)
+ assert.equal(binary.is(noway), false)
assert.end()
})
View
@@ -14,7 +14,7 @@ module.exports = {
, readDoubleBE: read_double_be
}
-var map = require('./mapped')
+var map = require('./mapped.js')
function read_uint8(target, at) {
return target[at]
View
@@ -14,7 +14,7 @@ module.exports = {
, writeDoubleBE: write_double_be
}
-var map = require('./mapped')
+var map = require('./mapped.js')
function write_uint8(target, value, at) {
return target[at] = value

0 comments on commit b047014

Please sign in to comment.