@emmetio/snippets-registry
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -120,4 +120,18 @@ 'use strict'; | ||
var index = function() { | ||
return new SnippetsRegistry(); | ||
/** | ||
* Creates snippets registry, filled with given `data` | ||
* @param {Object|Array} data Registry snippets. If array is given, adds items | ||
* from array in order of precedence, registers global snippets otherwise | ||
* @return {SnippetsRegistry} | ||
*/ | ||
var index = function(data) { | ||
const registry = new SnippetsRegistry(); | ||
if (Array.isArray(data)) { | ||
data.forEach((snippets, level) => registry.add(level, snippets)); | ||
} else if (typeof data === 'object') { | ||
registry.add(data); | ||
} | ||
return registry; | ||
}; | ||
@@ -124,0 +138,0 @@ |
@@ -116,4 +116,18 @@ class Snippet { | ||
var index = function() { | ||
return new SnippetsRegistry(); | ||
/** | ||
* Creates snippets registry, filled with given `data` | ||
* @param {Object|Array} data Registry snippets. If array is given, adds items | ||
* from array in order of precedence, registers global snippets otherwise | ||
* @return {SnippetsRegistry} | ||
*/ | ||
var index = function(data) { | ||
const registry = new SnippetsRegistry(); | ||
if (Array.isArray(data)) { | ||
data.forEach((snippets, level) => registry.add(level, snippets)); | ||
} else if (typeof data === 'object') { | ||
registry.add(data); | ||
} | ||
return registry; | ||
}; | ||
@@ -120,0 +134,0 @@ |
{ | ||
"name": "@emmetio/snippets-registry", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "JavaScript module for storing and retrieving Emmet snippets", | ||
@@ -10,6 +10,5 @@ "main": "dist/snippets-registry.cjs.js", | ||
"build": "npm run build:cjs && npm run build:es", | ||
"build:cjs": "rollup -o dist/snippets-registry.cjs.js -f cjs ./index.js", | ||
"build:es": "rollup -o dist/snippets-registry.es.js -f es ./index.js", | ||
"prepublish": "npm run build", | ||
"watch": "rollup -w -o dist/snippets-registry.cjs.js -f cjs ./index.js" | ||
"build:cjs": "rollup -c -o dist/snippets-registry.cjs.js -f cjs ./index.js", | ||
"build:es": "rollup -c -o dist/snippets-registry.es.js -f es ./index.js", | ||
"prepublish": "npm run test && npm run build" | ||
}, | ||
@@ -31,5 +30,4 @@ "repository": { | ||
"mocha": "^3.1.2", | ||
"rollup": "^0.36.3", | ||
"rollup-watch": "^2.5.0" | ||
"rollup": "^0.41.1" | ||
} | ||
} |
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
4
14543
5
416