Comparing version 0.1.2 to 0.1.3
50
dbf.js
@@ -1,11 +0,10 @@ | ||
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.dbf=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
module.exports.structure = _dereq_('./src/structure'); | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.dbf = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var fieldSize = require('./fieldsize'); | ||
},{"./src/structure":5}],2:[function(_dereq_,module,exports){ | ||
var fieldSize = _dereq_('./fieldsize'); | ||
var types = { | ||
string: 'C', | ||
number: 'N', | ||
boolean: 'L' | ||
boolean: 'L', | ||
// type to use if all values of a field are null | ||
null: 'C' | ||
}; | ||
@@ -30,3 +29,8 @@ | ||
function inherit(a, b) { | ||
for (var i in b) { a[i] = b[i]; } | ||
for (var i in b) { | ||
var isDef = typeof b[i] !== 'undefined' && b[i] !== null; | ||
if (typeof a[i] === 'undefined' || isDef) { | ||
a[i] = b[i]; | ||
} | ||
} | ||
return a; | ||
@@ -37,10 +41,12 @@ } | ||
var fields = {}, o = []; | ||
for (var p in _) fields[p] = typeof _[p]; | ||
for (var p in _) fields[p] = _[p] === null ? 'null' : typeof _[p]; | ||
for (var n in fields) { | ||
var t = types[fields[n]]; | ||
o.push({ | ||
name: n, | ||
type: t, | ||
size: fieldSize[t] | ||
}); | ||
if(t){ | ||
o.push({ | ||
name: n, | ||
type: t, | ||
size: fieldSize[t] | ||
}); | ||
} | ||
} | ||
@@ -59,3 +65,3 @@ return o; | ||
},{"./fieldsize":3}],3:[function(_dereq_,module,exports){ | ||
},{"./fieldsize":2}],2:[function(require,module,exports){ | ||
module.exports = { | ||
@@ -78,3 +84,3 @@ // string | ||
},{}],4:[function(_dereq_,module,exports){ | ||
},{}],3:[function(require,module,exports){ | ||
/** | ||
@@ -114,6 +120,6 @@ * @param {string} str | ||
},{}],5:[function(_dereq_,module,exports){ | ||
var fieldSize = _dereq_('./fieldsize'), | ||
lib = _dereq_('./lib'), | ||
fields = _dereq_('./fields'); | ||
},{}],4:[function(require,module,exports){ | ||
var fieldSize = require('./fieldsize'), | ||
lib = require('./lib'), | ||
fields = require('./fields'); | ||
@@ -221,4 +227,6 @@ /** | ||
},{"./fields":2,"./fieldsize":3,"./lib":4}]},{},[1]) | ||
(1) | ||
},{"./fields":1,"./fieldsize":2,"./lib":3}],5:[function(require,module,exports){ | ||
module.exports.structure = require('./src/structure'); | ||
},{"./src/structure":4}]},{},[5])(5) | ||
}); |
{ | ||
"name": "dbf", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "generate dbf files", | ||
"main": "index.js", | ||
"dependencies": { | ||
"jdataview": "~2.4.4" | ||
"jdataview": "~2.5.0" | ||
}, | ||
"files": [ | ||
"dbf.js", | ||
"src", | ||
"index.js", | ||
"json2dbf.js" | ||
], | ||
"devDependencies": { | ||
"tap": "~0.4.8", | ||
"browserify": "~3.44.2" | ||
"tap": "~5.7.2", | ||
"browserify": "~13.0.1" | ||
}, | ||
"scripts": { | ||
"test": "tap test/*.js", | ||
"make": "browserify -s dbf ./ > dbf.js" | ||
"make": "browserify -s dbf ./ > dbf.js", | ||
"prepublish": "npm run make" | ||
}, | ||
@@ -17,0 +24,0 @@ "repository": { |
# dbf | ||
[![Build Status](https://travis-ci.org/mapbox/dbf.svg?branch=master)](https://travis-ci.org/mapbox/dbf) | ||
Write [dBase files](https://en.wikipedia.org/wiki/DBase) in pure JavaScript, | ||
@@ -16,4 +18,6 @@ in node.js or browsers. Requires [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBuffer) | ||
https://raw.github.com/mapbox/dbf/master/dbf.js | ||
https://npmcdn.com/dbf@latest/dbf.js | ||
Replace `latest` with the latest version if you want to be sure. | ||
## example | ||
@@ -20,0 +24,0 @@ |
@@ -6,3 +6,5 @@ var fieldSize = require('./fieldsize'); | ||
number: 'N', | ||
boolean: 'L' | ||
boolean: 'L', | ||
// type to use if all values of a field are null | ||
null: 'C' | ||
}; | ||
@@ -27,3 +29,8 @@ | ||
function inherit(a, b) { | ||
for (var i in b) { a[i] = b[i]; } | ||
for (var i in b) { | ||
var isDef = typeof b[i] !== 'undefined' && b[i] !== null; | ||
if (typeof a[i] === 'undefined' || isDef) { | ||
a[i] = b[i]; | ||
} | ||
} | ||
return a; | ||
@@ -34,3 +41,3 @@ } | ||
var fields = {}, o = []; | ||
for (var p in _) fields[p] = typeof _[p]; | ||
for (var p in _) fields[p] = _[p] === null ? 'null' : typeof _[p]; | ||
for (var n in fields) { | ||
@@ -43,3 +50,3 @@ var t = types[fields[n]]; | ||
size: fieldSize[t] | ||
}); | ||
}); | ||
} | ||
@@ -46,0 +53,0 @@ } |
14253
60
3
9
406
+ Addedjdataview@2.5.0(transitive)
- Removedjdataview@2.4.6(transitive)
Updatedjdataview@~2.5.0