parse-googlesheets
Advanced tools
Comparing version 2.1.0 to 2.2.0
export declare const string: (data: string | undefined) => string | undefined; | ||
export declare const number: (data: string | undefined) => number | undefined; | ||
export declare const boolean: (data: string | undefined) => boolean | undefined; | ||
export declare const required: <T extends Func<[any], any>>(func: T) => (param: Parameters<T>[0]) => ReturnType<T> extends infer R ? R extends undefined ? never : R : never; | ||
@@ -4,0 +5,0 @@ export declare const defaultTo: <T extends Func<[any], any>, D extends ReturnType<T>>(func: T, def: D) => (param: Parameters<T>[0]) => ReturnType<T> extends infer R ? R extends undefined ? D : R : never; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadGoogleSheets = exports.parseGoogleSheets = exports.defaultTo = exports.required = exports.number = exports.string = void 0; | ||
exports.loadGoogleSheets = exports.parseGoogleSheets = exports.defaultTo = exports.required = exports.boolean = exports.number = exports.string = void 0; | ||
var request_1 = require("./request"); | ||
@@ -18,4 +18,12 @@ var ifElse = function (expression, onTrue, onFalse) { | ||
: Number(value); }; | ||
var toBooleanOrNil = function (value) { | ||
return (value === 'true' || value === '1') | ||
? true | ||
: (value === 'false' || value === '0') | ||
? false | ||
: undefined; | ||
}; | ||
exports.string = ifElse(isNil, always(undefined), identity); | ||
exports.number = ifElse(isNil, always(undefined), toNumberOrNil); | ||
exports.boolean = ifElse(isNil, always(undefined), toBooleanOrNil); | ||
var required = function (func) { return function (param) { | ||
@@ -22,0 +30,0 @@ var result = func(param); |
@@ -23,3 +23,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Object.defineProperty(exports, "__esModule", ({ value: true })); | ||
exports.loadGoogleSheets = exports.parseGoogleSheets = exports.defaultTo = exports.required = exports.number = exports.string = void 0; | ||
exports.loadGoogleSheets = exports.parseGoogleSheets = exports.defaultTo = exports.required = exports.boolean = exports.number = exports.string = void 0; | ||
var request_1 = __webpack_require__(/*! ./request */ "./src/request.ts"); | ||
@@ -39,4 +39,12 @@ var ifElse = function (expression, onTrue, onFalse) { | ||
: Number(value); }; | ||
var toBooleanOrNil = function (value) { | ||
return (value === 'true' || value === '1') | ||
? true | ||
: (value === 'false' || value === '0') | ||
? false | ||
: undefined; | ||
}; | ||
exports.string = ifElse(isNil, always(undefined), identity); | ||
exports.number = ifElse(isNil, always(undefined), toNumberOrNil); | ||
exports.boolean = ifElse(isNil, always(undefined), toBooleanOrNil); | ||
var required = function (func) { return function (param) { | ||
@@ -158,2 +166,2 @@ var result = func(param); | ||
}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9wYXJzZS1nb29nbGVzaGVldHMvd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovL3BhcnNlLWdvb2dsZXNoZWV0cy8uL3NyYy9pbmRleC50cyIsIndlYnBhY2s6Ly9wYXJzZS1nb29nbGVzaGVldHMvLi9zcmMvcmVxdWVzdC50cyIsIndlYnBhY2s6Ly9wYXJzZS1nb29nbGVzaGVldHMvZXh0ZXJuYWwgXCJub2RlLWZldGNoXCIiLCJ3ZWJwYWNrOi8vcGFyc2UtZ29vZ2xlc2hlZXRzL3dlYnBhY2svYm9vdHN0cmFwIiwid2VicGFjazovL3BhcnNlLWdvb2dsZXNoZWV0cy93ZWJwYWNrL3N0YXJ0dXAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELE87Ozs7Ozs7Ozs7QUNWYTtBQUNiLDhDQUE2QyxDQUFDLGNBQWMsRUFBQztBQUM3RCx3QkFBd0IsR0FBRyx5QkFBeUIsR0FBRyxpQkFBaUIsR0FBRyxnQkFBZ0IsR0FBRyxjQUFjLEdBQUcsY0FBYztBQUM3SCxnQkFBZ0IsbUJBQU8sQ0FBQyxtQ0FBVztBQUNuQztBQUNBLDRCQUE0Q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jaGVfX1ttb2R1bGVJZF0pIHtcblx0XHRyZXR1cm4gX193ZWJwYWNrX21vZHVsZV9jYWNoZV9fW21vZHVsZUlkXS5leHBvcnRzO1xuXHR9XG5cdC8vIENyZWF0ZSBhIG5ldyBtb2R1bGUgKGFuZCBwdXQgaXQgaW50byB0aGUgY2FjaGUpXG5cdHZhciBtb2R1bGUgPSBfX3dlYnBhY2tfbW9kdWxlX2NhY2hlX19bbW9kdWxlSWRdID0ge1xuXHRcdC8vIG5vIG1vZHVsZS5pZCBuZWVkZWRcblx0XHQvLyBubyBtb2R1bGUubG9hZGVkIG5lZWRlZFxuXHRcdGV4cG9ydHM6IHt9XG5cdH07XG5cblx0Ly8gRXhlY3V0ZSB0aGUgbW9kdWxlIGZ1bmN0aW9uXG5cdF9fd2VicGFja19tb2R1bGVzX19bbW9kdWxlSWRdKG1vZHVsZSwgbW9kdWxlLmV4cG9ydHMsIF9fd2VicGFja19yZXF1aXJlX18pO1xuXG5cdC8vIFJldHVybiB0aGUgZXhwb3J0cyBvZiB0aGUgbW9kdWxlXG5cdHJldHVybiBtb2R1bGUuZXhwb3J0cztcbn1cblxuIiwiLy8gbW9kdWxlIGV4cG9ydHMgbXVzdCBiZSByZXR1cm5lZCBmcm9tIHJ1bnRpbWUgc28gZW50cnkgaW5saW5pbmcgaXMgZGlzYWJsZWRcbi8vIHN0YXJ0dXBcbi8vIExvYWQgZW50cnkgbW9kdWxlIGFuZCByZXR1cm4gZXhwb3J0c1xucmV0dXJuIF9fd2VicGFja19yZXF1aXJlX18oXCIuL3NyYy9pbmRleC50c1wiKTtcbiJdLCJzb3VyY2VSb290IjoiIn0= |
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("node-fetch"));else if("function"==typeof define&&define.amd)define(["node-fetch"],t);else{var r="object"==typeof exports?t(require("node-fetch")):t(e["node-fetch"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e){return(()=>{"use strict";var t={432:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.loadGoogleSheets=t.parseGoogleSheets=t.defaultTo=t.required=t.number=t.string=void 0;var n=r(602),o=function(e,t,r){return function(n){return e(n)?t(n):r(n)}},u=function(e){return null==e},i=function(e){return function(){return e}};t.string=o(u,i(void 0),(function(e){return e})),t.number=o(u,i(void 0),(function(e){return isNaN(Number(e))?void 0:Number(e)})),t.required=function(e){return function(t){var r=e(t);if(void 0===r)throw new Error("Value is empty!");return r}},t.defaultTo=function(e,t){return function(r){var n=e(r);return void 0===n?t:n}},t.parseGoogleSheets=function(e,t){var r=t.feed.entry.reduce((function(e,t){var r=Number(t.gs$cell.row),n=Number(t.gs$cell.col);return e[r]||(e[r]=[]),e[r][n]=t.content.$t,e}),[]).filter((function(e){return e.filter((function(e){return!!e}))})),n=r[0],o=Object.entries(e),u=n.reduce((function(e,t,r){var n,u=null!==(n=o.find((function(e){return e[0],e[1].columnName.toLowerCase()===t.trim().toLowerCase()})))&&void 0!==n?n:[void 0,{type:void 0}],i=u[0],c=u[1].parse;return i&&c&&(e[i]={index:r,parse:c}),e}),Object.create(null));return r.slice(1).map((function(e){return Object.entries(u).reduce((function(t,r){var n=r[0],o=r[1],u=o.index,i=o.parse;return t[n]=i(e[u]),t}),Object.create(null))}))},t.loadGoogleSheets=function(e,r,o){return void 0===o&&(o=1),n.request("https://spreadsheets.google.com/feeds/cells/"+r+"/"+o+"/public/full?alt=json").then((function(e){return e.ok?e.json():e.text().then((function(e){return Promise.reject(e)}))})).then((function(r){return t.parseGoogleSheets(e,r)}))}},602:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.request=void 0,t.request="function"==typeof fetch?fetch.bind(window):r(786)},786:t=>{t.exports=e}},r={};return function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{}};return t[n](o,o.exports,e),o.exports}(432)})()})); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("node-fetch"));else if("function"==typeof define&&define.amd)define(["node-fetch"],t);else{var r="object"==typeof exports?t(require("node-fetch")):t(e["node-fetch"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e){return(()=>{"use strict";var t={432:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.loadGoogleSheets=t.parseGoogleSheets=t.defaultTo=t.required=t.boolean=t.number=t.string=void 0;var n=r(602),o=function(e,t,r){return function(n){return e(n)?t(n):r(n)}},u=function(e){return null==e},i=function(e){return function(){return e}};t.string=o(u,i(void 0),(function(e){return e})),t.number=o(u,i(void 0),(function(e){return isNaN(Number(e))?void 0:Number(e)})),t.boolean=o(u,i(void 0),(function(e){return"true"===e||"1"===e||"false"!==e&&"0"!==e&&void 0})),t.required=function(e){return function(t){var r=e(t);if(void 0===r)throw new Error("Value is empty!");return r}},t.defaultTo=function(e,t){return function(r){var n=e(r);return void 0===n?t:n}},t.parseGoogleSheets=function(e,t){var r=t.feed.entry.reduce((function(e,t){var r=Number(t.gs$cell.row),n=Number(t.gs$cell.col);return e[r]||(e[r]=[]),e[r][n]=t.content.$t,e}),[]).filter((function(e){return e.filter((function(e){return!!e}))})),n=r[0],o=Object.entries(e),u=n.reduce((function(e,t,r){var n,u=null!==(n=o.find((function(e){return e[0],e[1].columnName.toLowerCase()===t.trim().toLowerCase()})))&&void 0!==n?n:[void 0,{type:void 0}],i=u[0],c=u[1].parse;return i&&c&&(e[i]={index:r,parse:c}),e}),Object.create(null));return r.slice(1).map((function(e){return Object.entries(u).reduce((function(t,r){var n=r[0],o=r[1],u=o.index,i=o.parse;return t[n]=i(e[u]),t}),Object.create(null))}))},t.loadGoogleSheets=function(e,r,o){return void 0===o&&(o=1),n.request("https://spreadsheets.google.com/feeds/cells/"+r+"/"+o+"/public/full?alt=json").then((function(e){return e.ok?e.json():e.text().then((function(e){return Promise.reject(e)}))})).then((function(r){return t.parseGoogleSheets(e,r)}))}},602:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.request=void 0,t.request="function"==typeof fetch?fetch.bind(window):r(786)},786:t=>{t.exports=e}},r={};return function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{}};return t[n](o,o.exports,e),o.exports}(432)})()})); | ||
//# sourceMappingURL=parse-googlesheets.min.js.map |
{ | ||
"name": "parse-googlesheets", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Parse google sheets", | ||
@@ -5,0 +5,0 @@ "main": "dist/parse-googlesheets.min.js", |
@@ -18,2 +18,9 @@ import { request } from './request'; | ||
const toBooleanOrNil = (value: string | undefined) => | ||
(value === 'true' || value === '1') | ||
? true | ||
: (value === 'false' || value === '0') | ||
? false | ||
: undefined; | ||
export const string: (data: string | undefined) => string | undefined = ifElse( | ||
@@ -31,2 +38,8 @@ isNil, | ||
export const boolean: (data: string | undefined) => boolean | undefined = ifElse( | ||
isNil, | ||
always(undefined), | ||
toBooleanOrNil | ||
); | ||
export const required = <T extends Func<[any], any>>(func: T): (param: Parameters<T>[0]) => ReturnType<T> extends infer R ? R extends undefined ? never : R : never => (param) => { | ||
@@ -33,0 +46,0 @@ const result = func(param); |
Sorry, the diff of this file is not supported yet
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
38635
382