csv-stringify
Advanced tools
Comparing version 5.3.0 to 5.3.1
# Changelog | ||
## Version 5.3.1 | ||
* pacakge: latest dependencies | ||
* package: replace npm ignore with file field | ||
* project: fix license in package.json | ||
* package: simplify pretest comamnd | ||
## Version 5.3.0 | ||
@@ -17,3 +24,3 @@ | ||
* package: latest dependencies | ||
* typescript: type tests | ||
* ts: type tests | ||
@@ -73,3 +80,3 @@ ## Version 5.2.0 | ||
* package: update license to MIT | ||
* travis: test agains Node.js 11 | ||
* travis: test against Node.js 11 | ||
* samples: improve some scripts | ||
@@ -76,0 +83,0 @@ |
@@ -17,4 +17,6 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
@@ -32,2 +34,4 @@ | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
@@ -37,12 +41,9 @@ | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
// Generated by CoffeeScript 2.3.2 | ||
// Generated by CoffeeScript 2.4.1 | ||
// # CSV Stringifier | ||
// Please look at the [project documentation](https://csv.js.org/stringify/) for additional | ||
// information. | ||
var Stringifier, get, isObject, stream, underscore, util; | ||
var Stringifier, castPath, charCodeOfDot, get, isObject, isSymbol, reEscapeChar, rePropName, stream, toKey, underscore, util; | ||
stream = require('stream'); | ||
util = require('util'); | ||
get = require('lodash.get'); // ## Usage | ||
util = require('util'); // ## Usage | ||
// This module export a function as its main entry point and return a transform | ||
@@ -151,3 +152,3 @@ // stream. | ||
writableObjectMode: true | ||
}, options))); | ||
}, {}, options))); | ||
options = {}; | ||
@@ -253,8 +254,8 @@ | ||
// Backward compatibility | ||
options.cast.boolean = options.cast.bool; | ||
options.cast["boolean"] = options.cast.bool; | ||
} // Custom cast | ||
if ((base = options.cast).boolean == null) { | ||
base.boolean = function (value) { | ||
if ((base = options.cast)["boolean"] == null) { | ||
base["boolean"] = function (value) { | ||
// Cast boolean to string by default | ||
@@ -345,3 +346,3 @@ if (value) { | ||
_assertThisInitialized(_assertThisInitialized(_this)); | ||
_assertThisInitialized(_this); | ||
@@ -550,3 +551,3 @@ return _this; | ||
options = _objectSpread({}, this.options, options); | ||
options = _objectSpread({}, this.options, {}, options); | ||
} else if (value === void 0 || value === null) { | ||
@@ -656,3 +657,3 @@ options = this.options; | ||
} else if (type === 'boolean') { | ||
return [void 0, this.options.cast.boolean(value, context)]; | ||
return [void 0, this.options.cast["boolean"](value, context)]; | ||
} else if (value instanceof Date) { | ||
@@ -750,2 +751,71 @@ return [void 0, this.options.cast.date(value, context)]; | ||
}); | ||
}; // ## Lodash implementation of `get` | ||
charCodeOfDot = '.'.charCodeAt(0); | ||
reEscapeChar = /\\(\\)?/g; // Match anything that isn't a dot or bracket. | ||
// Or match property names within brackets. | ||
// Match a non-string expression. | ||
// Or match strings (supports escaping characters). | ||
// Or match "" as the space between consecutive dots or empty brackets. | ||
rePropName = RegExp('[^.[\\]]+' + '|' + '\\[(?:' + '([^"\'][^[]*)' + '|' + '(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' + ')\\]' + '|' + '(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'); | ||
isSymbol = function isSymbol(value) { | ||
var type; | ||
type = _typeof(value); | ||
return type === 'symbol' || type === 'object' && value !== null && getTag(value) === '[object Symbol]'; | ||
}; | ||
castPath = function castPath(string) { | ||
var result; | ||
result = []; | ||
if (string.charCodeAt(0) === charCodeOfDot) { | ||
result.push(''); | ||
} | ||
string.replace(rePropName, function (match, expression, quote, subString) { | ||
var key; | ||
key = match; | ||
if (quote) { | ||
key = subString.replace(reEscapeChar, '$1'); | ||
} else if (expression) { | ||
key = expression.trim(); | ||
} | ||
return result.push(key); | ||
}); | ||
return result; | ||
}; | ||
toKey = function toKey(value) { | ||
var ref, result; | ||
if (typeof value === 'string' || isSymbol(value)) { | ||
return value; | ||
} | ||
result = "".concat(value); | ||
return (ref = result === '0' && 1 / value === -INFINITY) != null ? ref : { | ||
'-0': result | ||
}; | ||
}; | ||
get = function get(object, path) { | ||
var index, length; | ||
path = Array.isArray(path) ? path : castPath(path, object); | ||
index = 0; | ||
length = path.length; | ||
while (object !== null && index < length) { | ||
object = object[toKey(path[index++])]; | ||
} | ||
if (index && index === length) { | ||
return object; | ||
} else { | ||
return void 0; | ||
} | ||
}; |
"use strict"; | ||
// Generated by CoffeeScript 2.3.2 | ||
// Generated by CoffeeScript 2.4.1 | ||
// # CSV Stringify Sync | ||
@@ -5,0 +5,0 @@ // Provides a synchronous alternative to the CSV stringifier. |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.3.2 | ||
// Generated by CoffeeScript 2.4.1 | ||
// # CSV Stringifier | ||
@@ -6,3 +6,3 @@ | ||
// information. | ||
var Stringifier, get, isObject, stream, underscore, util; | ||
var Stringifier, castPath, charCodeOfDot, get, isObject, isSymbol, reEscapeChar, rePropName, stream, toKey, underscore, util; | ||
@@ -13,4 +13,2 @@ stream = require('stream'); | ||
get = require('lodash.get'); | ||
// ## Usage | ||
@@ -576,1 +574,64 @@ | ||
}; | ||
// ## Lodash implementation of `get` | ||
charCodeOfDot = '.'.charCodeAt(0); | ||
reEscapeChar = /\\(\\)?/g; | ||
// Match anything that isn't a dot or bracket. | ||
// Or match property names within brackets. | ||
// Match a non-string expression. | ||
// Or match strings (supports escaping characters). | ||
// Or match "" as the space between consecutive dots or empty brackets. | ||
rePropName = RegExp('[^.[\\]]+' + '|' + '\\[(?:' + '([^"\'][^[]*)' + '|' + '(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' + ')\\]' + '|' + '(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'); | ||
isSymbol = function(value) { | ||
var type; | ||
type = typeof value; | ||
return type === 'symbol' || (type === 'object' && value !== null && getTag(value) === '[object Symbol]'); | ||
}; | ||
castPath = function(string) { | ||
var result; | ||
result = []; | ||
if (string.charCodeAt(0) === charCodeOfDot) { | ||
result.push(''); | ||
} | ||
string.replace(rePropName, function(match, expression, quote, subString) { | ||
var key; | ||
key = match; | ||
if (quote) { | ||
key = subString.replace(reEscapeChar, '$1'); | ||
} else if (expression) { | ||
key = expression.trim(); | ||
} | ||
return result.push(key); | ||
}); | ||
return result; | ||
}; | ||
toKey = function(value) { | ||
var ref, result; | ||
if (typeof value === 'string' || isSymbol(value)) { | ||
return value; | ||
} | ||
result = `${value}`; | ||
return (ref = result === '0' && (1 / value) === -INFINITY) != null ? ref : { | ||
'-0': result | ||
}; | ||
}; | ||
get = function(object, path) { | ||
var index, length; | ||
path = Array.isArray(path) ? path : castPath(path, object); | ||
index = 0; | ||
length = path.length; | ||
while (object !== null && index < length) { | ||
object = object[toKey(path[index++])]; | ||
} | ||
if (index && index === length) { | ||
return object; | ||
} else { | ||
return void 0; | ||
} | ||
}; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.3.2 | ||
// Generated by CoffeeScript 2.4.1 | ||
// # CSV Stringify Sync | ||
@@ -3,0 +3,0 @@ |
{ | ||
"version": "5.3.0", | ||
"version": "5.3.1", | ||
"name": "csv-stringify", | ||
@@ -10,3 +10,3 @@ "description": "CSV stringifier implementing the Node.js `stream.Transform` API", | ||
], | ||
"license": "BSD-3-Clause", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -17,23 +17,36 @@ "type": "git", | ||
"homepage": "https://csv.js.org/stringify/", | ||
"dependencies": { | ||
"lodash.get": "~4.4.2" | ||
"coffeelintConfig": { | ||
"indentation": { | ||
"level": "error", | ||
"value": 2 | ||
}, | ||
"line_endings": { | ||
"level": "error", | ||
"value": "unix" | ||
}, | ||
"max_line_length": { | ||
"level": "ignore" | ||
} | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/preset-env": "^7.2.3", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.18", | ||
"@babel/cli": "^7.5.5", | ||
"@babel/core": "^7.5.5", | ||
"@babel/preset-env": "^7.5.5", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^12.6.9", | ||
"@types/should": "^13.0.0", | ||
"coffeescript": "~2.3.2", | ||
"csv-generate": "~3.2.0", | ||
"mocha": "~5.2.0", | ||
"coffeescript": "~2.4.1", | ||
"csv-generate": "~3.2.3", | ||
"mocha": "~6.2.0", | ||
"should": "~13.2.3", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.2.4" | ||
"ts-node": "^8.3.0", | ||
"typescript": "^3.5.3" | ||
}, | ||
"files": [ | ||
"/lib" | ||
], | ||
"optionalDependencies": {}, | ||
"main": "./lib", | ||
"scripts": { | ||
"preversion": "grep '## Trunk' CHANGELOG.md && rm -rf lib/*.js && npm test && cp lib/*.ts lib/es5", | ||
"preversion": "grep '## Trunk' CHANGELOG.md && rm -rf lib/*.js && npm test && cp lib/*.ts lib/es5 && git add lib/es5/*.ts", | ||
"version": "version=`grep '^ \"version\": ' package.json | sed 's/.*\"\\([0-9\\.]*\\)\".*/\\1/'` && sed -i \"s/## Trunk/## Version $version/\" CHANGELOG.md && git add CHANGELOG.md", | ||
@@ -44,4 +57,4 @@ "postversion": "git push && git push --tags && npm publish", | ||
"major": "npm version major -m 'Bump to version %s'", | ||
"coffee": "coffee -b -o lib src && cd lib && babel *.js -d es5 && cd ..", | ||
"pretest": "coffee -b -o lib src && cd lib && babel *.js -d es5 && cd ..", | ||
"build": "coffee -b -o lib src && cd lib && babel *.js -d es5 && cd ..", | ||
"pretest": "npm run build", | ||
"test": "mocha test/**/*.{coffee,ts}" | ||
@@ -48,0 +61,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
66214
0
0
12
1503
- Removedlodash.get@~4.4.2
- Removedlodash.get@4.4.2(transitive)