@contentful/rich-text-types
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -5,2 +5,9 @@ "use strict"; | ||
} | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -14,2 +21,4 @@ var blocks_1 = require("./blocks"); | ||
__export(require("./schemaConstraints")); | ||
var helpers = __importStar(require("./helpers")); | ||
exports.helpers = helpers; | ||
//# sourceMappingURL=index.js.map |
@@ -29,3 +29,3 @@ 'use strict'; | ||
*/ | ||
var inlines = { | ||
var INLINES = { | ||
HYPERLINK: 'hyperlink', | ||
@@ -81,4 +81,30 @@ ENTRY_HYPERLINK: 'entry-hyperlink', | ||
/** | ||
* Checks if the node is an instance of Inline. | ||
*/ | ||
function isInline(node) { | ||
return Object.values(INLINES).includes(node.nodeType); | ||
} | ||
/** | ||
* Checks if the node is an instance of Block. | ||
*/ | ||
function isBlock(node) { | ||
return Object.values(BLOCKS).includes(node.nodeType); | ||
} | ||
/** | ||
* Checks if the node is an instance of Text. | ||
*/ | ||
function isText(node) { | ||
return node.nodeType === 'text'; | ||
} | ||
var helpers = /*#__PURE__*/Object.freeze({ | ||
isInline: isInline, | ||
isBlock: isBlock, | ||
isText: isText | ||
}); | ||
exports.helpers = helpers; | ||
exports.BLOCKS = BLOCKS; | ||
exports.INLINES = inlines; | ||
exports.INLINES = INLINES; | ||
exports.MARKS = marks; | ||
@@ -85,0 +111,0 @@ exports.TOP_LEVEL_BLOCKS = TOP_LEVEL_BLOCKS; |
@@ -6,1 +6,3 @@ export { default as BLOCKS } from './blocks'; | ||
export * from './types'; | ||
import * as helpers from './helpers'; | ||
export { helpers }; |
{ | ||
"name": "@contentful/rich-text-types", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"main": "dist/rich-text-types.es5.js", | ||
@@ -38,3 +38,3 @@ "typings": "dist/types/index.d.ts", | ||
}, | ||
"gitHead": "4531fd40a4e459fda941272917d3e42bdacd9f00" | ||
"gitHead": "0c308468f7858c0c8e9391cdf95601e8dd75f9f9" | ||
} |
Sorry, the diff of this file is not supported yet
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
26593
32
544