Socket
Socket
Sign inDemoInstall

hastscript

Package Overview
Dependencies
4
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.1 to 5.1.0

svg-case-sensitive-tag-names.json

23

factory.js

@@ -11,3 +11,7 @@ 'use strict'

function factory(schema, defaultTagName) {
var own = {}.hasOwnProperty
function factory(schema, defaultTagName, caseSensitive) {
var adjust = caseSensitive ? createAdjustMap(caseSensitive) : null
return h

@@ -19,4 +23,7 @@

var children = Array.prototype.slice.call(arguments, 2)
var name = node.tagName.toLowerCase()
var property
node.tagName = adjust && own.call(adjust, name) ? adjust[name] : name
if (properties && isChildren(properties, node)) {

@@ -194,1 +201,15 @@ children.unshift(properties)

}
function createAdjustMap(values) {
var length = values.length
var index = -1
var result = {}
var value
while (++index < length) {
value = values[index]
result[value.toLowerCase()] = value
}
return result
}

9

package.json
{
"name": "hastscript",
"version": "5.0.1",
"version": "5.1.0",
"description": "Hyperscript compatible DSL for creating virtual hast trees",

@@ -26,3 +26,4 @@ "license": "MIT",

"html.js",
"svg.js"
"svg.js",
"svg-case-sensitive-tag-names.json"
],

@@ -41,2 +42,3 @@ "dependencies": {

"remark-preset-wooorm": "^5.0.0",
"svg-tag-names": "^2.0.0",
"tape": "^4.0.0",

@@ -47,2 +49,3 @@ "tinyify": "^2.0.0",

"scripts": {
"generate": "node build",
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",

@@ -54,3 +57,3 @@ "build-bundle": "browserify . -s hastscript > hastscript.js",

"test-coverage": "nyc --reporter lcov tape test.js",
"test": "npm run format && npm run build && npm run test-coverage"
"test": "npm run generate && npm run format && npm run build && npm run test-coverage"
},

@@ -57,0 +60,0 @@ "nyc": {

@@ -142,3 +142,3 @@ # hastscript

DSL to create virtual [HAST][] trees for HTML or SVG.
DSL to create virtual [**hast**][hast] [*trees*][tree] for HTML or SVG.

@@ -145,0 +145,0 @@ ##### Parameters

'use strict'
var schema = require('property-information/svg')
var caseSensitive = require('./svg-case-sensitive-tag-names.json')
var factory = require('./factory')
var svg = factory(schema, 'g')
var svg = factory(schema, 'g', caseSensitive)
svg.displayName = 'svg'
module.exports = svg
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc