@voiceflow/common
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -8,2 +8,3 @@ 'use strict'; | ||
middleware: require('./middleware'), | ||
constants: require('./constants'), | ||
}; |
@@ -8,6 +8,4 @@ 'use strict'; | ||
intent: require('./intents'), | ||
intentConstants: require('./intentConstants'), | ||
slotConstants: require('./slotConstants'), | ||
draftToMarkdown: require('./draftToMarkdown'), | ||
draft: require('./draft'), | ||
intentCharRegex: require('./intentCharRegex'), | ||
}; |
@@ -7,14 +7,12 @@ 'use strict'; | ||
const randomstring = require('randomstring'); | ||
const { SLOT_TYPES } = require('./intentConstants'); | ||
const { SLOT_TYPES } = require('../constants/intents'); | ||
const { validSpokenCharacters, validLatinChars } = require('./intentCharRegex'); | ||
const draftToMarkdown = require('./draftToMarkdown'); | ||
const draft = require('./draft'); | ||
const ALPHABET = 'abcdefghijklmnopqrstuvwxyz'; | ||
const formatName = (name) => { | ||
let formatted_name = name.replace(' ', '_'); | ||
let formattedName = name.replace(' ', '_'); | ||
Array.from(Array(10).keys()).forEach((i) => { | ||
formatted_name = formatted_name.replace(i.toString(), String.fromCharCode(i + 65)); | ||
formattedName = formattedName.replace(i.toString(), String.fromCharCode(i + 65)); | ||
}); | ||
return formatted_name; | ||
return formattedName; | ||
}; | ||
@@ -171,3 +169,3 @@ | ||
// make sure the first letter is valid alphanumeric | ||
while (!ALPHABET.includes(name.charAt(0)) && name.length > 0) { | ||
while (!/[A-Za-z]/.test(name.charAt(0)) && name.length > 0) { | ||
name = name.substring(1); | ||
@@ -208,3 +206,3 @@ } | ||
if (typeof val === 'object' && val && val.blocks && val.entityMap) { | ||
val = draftToMarkdown(val); | ||
val = draft.toPlainTextSanitize(val); | ||
} | ||
@@ -211,0 +209,0 @@ if (typeof val === 'object' && val && val.value !== undefined && typeof val.value !== 'object') { |
{ | ||
"name": "@voiceflow/common", | ||
"description": "Junk drawer of utility functions", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"author": "Voiceflow", | ||
@@ -6,0 +6,0 @@ "bugs": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
89015
19
2896
1