How to use the @sindresorhus/slugify.default function in @sindresorhus/slugify

To help you get started, we’ve selected a few @sindresorhus/slugify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wilsson / papyrum / packages / papyrum-core / dist / init.js View on Github external
return [4 /*yield*/, mdx_1.parseMdx(filePath)];
                                    case 1:
                                        ast = _a.sent();
                                        metasArray = mdx_1.getMetadata(ast);
                                        finalRoute = path.basename(item).replace(path.extname(item), '');
                                        entries[item] = {
                                            filepath: item
                                        };
                                        metasArray && metasArray.forEach(function (_a) {
                                            var key = _a.key, value = _a.value;
                                            if (key && value)
                                                entries[item][key] = value;
                                        });
                                        entries[item] = {
                                            name: entries[item].name || humanize_string_1.default(slugify_1.default(finalRoute)),
                                            route: entries[item].route || "/" + slugify_1.default(finalRoute)
                                        };
                                        return [2 /*return*/];
                                }
                            });
                        }); }))];
github wilsson / papyrum / packages / papyrum-core / dist / init.js View on Github external
filePath = path.resolve(process.cwd(), "./" + item);
                                        return [4 /*yield*/, mdx_1.parseMdx(filePath)];
                                    case 1:
                                        ast = _a.sent();
                                        metasArray = mdx_1.getMetadata(ast);
                                        finalRoute = path.basename(item).replace(path.extname(item), '');
                                        entries[item] = {
                                            filepath: item
                                        };
                                        metasArray && metasArray.forEach(function (_a) {
                                            var key = _a.key, value = _a.value;
                                            if (key && value)
                                                entries[item][key] = value;
                                        });
                                        entries[item] = {
                                            name: entries[item].name || humanize_string_1.default(slugify_1.default(finalRoute)),
                                            route: entries[item].route || "/" + slugify_1.default(finalRoute)
                                        };
                                        return [2 /*return*/];
                                }
                            });
                        }); }))];

@sindresorhus/slugify

Slugify a string

MIT
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis

Popular @sindresorhus/slugify functions