Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kablamo/kerosene

Package Overview
Dependencies
Maintainers
6
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kablamo/kerosene - npm Package Compare versions

Comparing version 0.0.3 to 0.0.5

es/fetch/isNetworkError.js

3

es/index.js

@@ -5,2 +5,5 @@ export { default as contains } from './array/contains.js';

export { DAY, DAYS_PER_WEEK, DayOfWeek, HOUR, MINUTE, MONTHS_PER_YEAR, Month, SECOND } from './datetime/index.js';
export { default as isNetworkError } from './fetch/isNetworkError.js';
export { default as transform } from './fetch/transform.js';
export { default as transformAndCheckStatus } from './fetch/transformAndCheckStatus.js';
export { default as timeout } from './function/timeout.js';

@@ -7,0 +10,0 @@ export { default as waitForEventLoopToDrain } from './function/waitForEventLoopToDrain.js';

export * from "./array";
export * from "./datetime";
export { default as isNetworkError } from "./fetch/isNetworkError";
export { default as transform } from "./fetch/transform";
export { default as transformAndCheckStatus, } from "./fetch/transformAndCheckStatus";
export { default as timeout } from "./function/timeout";

@@ -4,0 +7,0 @@ export { default as waitForEventLoopToDrain, } from "./function/waitForEventLoopToDrain";

84

lib/index.js

@@ -9,21 +9,24 @@ 'use strict';

var __chunk_6 = require('./datetime/index.js');
var __chunk_7 = require('./function/timeout.js');
var __chunk_8 = require('./function/waitForEventLoopToDrain.js');
var __chunk_9 = require('./math/ceil.js');
var __chunk_10 = require('./math/floor.js');
var __chunk_11 = require('./math/round.js');
var __chunk_12 = require('./math/clamp.js');
var __chunk_13 = require('./math/isNegative.js');
var __chunk_14 = require('./math/divmod.js');
var __chunk_15 = require('./math/toDegrees.js');
var __chunk_16 = require('./string/caseInsensitiveEquals.js');
var __chunk_17 = require('./string/escape.js');
var __chunk_18 = require('./string/domSafeJson.js');
var __chunk_19 = require('./string/elide.js');
var __chunk_20 = require('./string/getRandomString.js');
var __chunk_21 = require('./string/isOnlyWhitespace.js');
var __chunk_22 = require('./string/parseSearch.js');
var __chunk_23 = require('./string/replaceAll.js');
var __chunk_24 = require('./string/removeLineBreaks.js');
var __chunk_25 = require('./string/toTitleCase.js');
var __chunk_7 = require('./fetch/isNetworkError.js');
var __chunk_8 = require('./fetch/transform.js');
var __chunk_9 = require('./fetch/transformAndCheckStatus.js');
var __chunk_10 = require('./function/timeout.js');
var __chunk_11 = require('./function/waitForEventLoopToDrain.js');
var __chunk_12 = require('./math/ceil.js');
var __chunk_13 = require('./math/floor.js');
var __chunk_14 = require('./math/round.js');
var __chunk_15 = require('./math/clamp.js');
var __chunk_16 = require('./math/isNegative.js');
var __chunk_17 = require('./math/divmod.js');
var __chunk_18 = require('./math/toDegrees.js');
var __chunk_19 = require('./string/caseInsensitiveEquals.js');
var __chunk_20 = require('./string/escape.js');
var __chunk_21 = require('./string/domSafeJson.js');
var __chunk_22 = require('./string/elide.js');
var __chunk_23 = require('./string/getRandomString.js');
var __chunk_24 = require('./string/isOnlyWhitespace.js');
var __chunk_25 = require('./string/parseSearch.js');
var __chunk_26 = require('./string/replaceAll.js');
var __chunk_27 = require('./string/removeLineBreaks.js');
var __chunk_28 = require('./string/toTitleCase.js');

@@ -53,22 +56,25 @@

exports.SECOND = __chunk_6.SECOND;
exports.timeout = __chunk_7.default;
exports.waitForEventLoopToDrain = __chunk_8.default;
exports.ceil = __chunk_9.default;
exports.floor = __chunk_10.default;
exports.round = __chunk_11.default;
exports.clamp = __chunk_12.default;
exports.isNegative = __chunk_13.default;
exports.divmod = __chunk_14.default;
exports.toDegrees = __chunk_15.default;
exports.caseInsensitiveEquals = __chunk_16.default;
exports.escape = __chunk_17.default;
exports.domSafeJson = __chunk_18.default;
exports.elide = __chunk_19.default;
exports.getRandomString = __chunk_20.default;
exports.isOnlyWhitespace = __chunk_21.default;
exports.parseSearch = __chunk_22.default;
exports.replaceAll = __chunk_23.default;
exports.removeLineBreaks = __chunk_24.default;
exports.TITLE_CASE_LOWERCASE_WORDS = __chunk_25.TITLE_CASE_LOWERCASE_WORDS;
exports.toTitleCase = __chunk_25.default;
exports.isNetworkError = __chunk_7.default;
exports.transform = __chunk_8.default;
exports.transformAndCheckStatus = __chunk_9.default;
exports.timeout = __chunk_10.default;
exports.waitForEventLoopToDrain = __chunk_11.default;
exports.ceil = __chunk_12.default;
exports.floor = __chunk_13.default;
exports.round = __chunk_14.default;
exports.clamp = __chunk_15.default;
exports.isNegative = __chunk_16.default;
exports.divmod = __chunk_17.default;
exports.toDegrees = __chunk_18.default;
exports.caseInsensitiveEquals = __chunk_19.default;
exports.escape = __chunk_20.default;
exports.domSafeJson = __chunk_21.default;
exports.elide = __chunk_22.default;
exports.getRandomString = __chunk_23.default;
exports.isOnlyWhitespace = __chunk_24.default;
exports.parseSearch = __chunk_25.default;
exports.replaceAll = __chunk_26.default;
exports.removeLineBreaks = __chunk_27.default;
exports.TITLE_CASE_LOWERCASE_WORDS = __chunk_28.TITLE_CASE_LOWERCASE_WORDS;
exports.toTitleCase = __chunk_28.default;
//# sourceMappingURL=index.js.map
'use strict';
var __chunk_17 = require('./escape.js');
var __chunk_20 = require('./escape.js');

@@ -20,3 +20,3 @@ /**

return JSON.stringify(value).replace(UNSAFE_CHARACTERS_REGEX, function (character) {
return __chunk_17.default(character);
return __chunk_20.default(character);
});

@@ -23,0 +23,0 @@ }

'use strict';
var __chunk_23 = require('./replaceAll.js');
var __chunk_26 = require('./replaceAll.js');
var removeLineBreaks = function removeLineBreaks(input) {
var result = input;
result = __chunk_23.default("\n", " ", result);
result = __chunk_23.default("\r", " ", result);
result = __chunk_26.default("\n", " ", result);
result = __chunk_26.default("\r", " ", result);
return result;

@@ -10,0 +10,0 @@ };

{
"name": "@kablamo/kerosene",
"version": "0.0.3",
"version": "0.0.5",
"repository": {

@@ -28,2 +28,3 @@ "type": "git",

"@types/lodash": "^4.14.121",
"content-type": "^1.0.4",
"core-js-pure": "^3.1.3",

@@ -30,0 +31,0 @@ "lodash": "^4.17.11"

@@ -63,2 +63,18 @@ # Kerosene

## Fetch
### `isNetworkError(error)`
Returns whether or not `error` is a `fetch()` Network Error, accounting for browser differences.
Can be used to detect when the network is not available, although may be falsely triggered by CORS.
### `transform(response)`
Returns a Promise which transforms the body of a `fetch()` request according to content type header.
### `transformAndCheckStatus(response)`
Returns a Promise which transforms the body of a `fetch()` request according to content type header and rejects if the status is not 2xx.
## Function

@@ -65,0 +81,0 @@

@@ -5,2 +5,8 @@ export * from "./array";

export { default as isNetworkError } from "./fetch/isNetworkError";
export { default as transform } from "./fetch/transform";
export {
default as transformAndCheckStatus,
} from "./fetch/transformAndCheckStatus";
export { default as timeout } from "./function/timeout";

@@ -7,0 +13,0 @@ export {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc